GWT issue 2079 error message not possible to remove - gwt

i am using gwt and mgwt for my project.
When i am running my project on eclipse jetty server i get the following alert error message:
cross-site hosted mode not yet implemented. See issue http:// code.google.com/p/google-web-toolkit/issues/detail?id=2079
and this has to do wih the following linker in the appname.gwt.xml file
<add-linker name="xs" />
but when i remove the linker from the gwt.xml module the error is still there.
I cleaned the project and refreshed it but i get still the error message.
It's not possible to test the app in the browser any more.
How to solve the problem. Please help!

Try deleting the *.nocache.js file.
BTW, xs linker is deprecated, use the xsiframe one (which supports DevMode, as stated in issue 2079)

Replace 'xs' to 'xsiframe' in add-linker tag then after add this tag
<set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>
then rebuild project

Related

Ionic 2 serve error

I got the following errors after ionic serve --lab:
Any Idea why the error above is occurred?
Ionic cli version 3.9.0
App scripts version 1.4.1
Typescript 2.3.9
Thanks.
Stylesheets don't get applied and javascript is not executed, because your browser reports wrong MIME types for these requested documents. They're all sent as text/html.
It seems to be the same problem, as reported here.
You may try to go to any of the .ts files like user.ts or app.ts and save them again. This will trigger the automatic build, once finished, your app should run fine again.
After some investigations I found very similar problems.
Could you try the following:
Add <base href="/"> in head before linking all css files
https://github.com/froala/angular-froala/issues/170#issuecomment-386117678
https://github.com/angular/angular-cli/issues/10325#issuecomment-399329033
I faced the same issue many times.when i close the console and run it again as ionic serve it worked for me properly.Try this once.

Using an ANTLR Lexer For Syntax Coloring: Module excluded from the target platform error

I'm new to Netbeans Platform Development and following this tutorial.
When I try to build the project I get this error:
Module org.netbeans.modules.editor.util excluded from the target platform
There are apparently no errors in the app.
I'm using
NB 8.0
JDK jdk1.7.0_45
OS Win 8.1
What might be going wrong?
UPDATE:
Somehow the module was excluded via the disabled.modules in the platform.properties properties file.
When i comment it out (or remove it), it runs but gives this warning
Regards,
I nailed part of the problem. The error occurred because of unresolved dependencies.
I went through the tut again on a Linux Mint with NB7.4.
Now I get no errors but facing yet another problem. Now as I open a file, it opens the file but the Cookie Editor disappears.
I'm expecting someone will help on the second Issue.
Moderators: I'm not sure how will you guys respond to this but I've no clue how to go about my half solved problem.

Can not make GWT application work as Chrome packaged app, probably due to CSP

Keep getting CSP errors: "Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'"
The problem is probably due to HTML files generated by GWT which contain inline JS.
UPD: Changing to manifest version 1 helped, but this is a temporary workaroud, as Chrome 21 complains that it will no longer be supported.
UPD2: <add-linker name="xsiframe" /> does not help either
GWT 2.5.1 has finally fixed this problem. The release notes documenting this are here:
https://developers.google.com/web-toolkit/release-notes#Release_Notes_2_5_1
and they state that:
"Apps built with DirectInstallLinker should work in a page where inline scripts are forbidden (e.g. a Chrome extension)"
This means that it is now possible to use DirectInstallLinker to link your Chrome packaged app in a manner that satisfies the new security requirements of manifest version 2 regarding inline scripts. That is, by using DirectInstallLinker to link your app with GWT 2.5.1 selected as your GWT version, GWT will not place any script elements inline in its generated Javascript, and thus the new manifest version 2 requirement that there be no inline scripts will not be violated.
I have found that SingleScriptLinker also seems to work for my own app; however, Issue 7685 warns against using the SingleScriptLinker because "This generates a $doc.write line which is forbidden in packaged apps." I am using DirectInstallLinker myself.
Here is the Javadoc for DirectInstallLinker:
http://google-web-toolkit.googlecode.com/svn/javadoc/2.5/com/google/gwt/core/linker/DirectInstallLinker.html
To use this linker, you can include the following in your *.gwt.xml file:
<define-linker name="dil" class="com.google.gwt.core.linker.DirectInstallLinker"/>
<add-linker name="dil" />
(dil can be replaced by anything you choose, so long as there are no dashes or other illegal characters).
You will need to select GWT 2.5.1 as your version of GWT. If you're using an older version of GWT in an out-of-date version of Eclipse such as Ganymede (as I was), you'll have to upgrade to at least Helios and then import your project to your new Eclipse environment. The archive URLs for the Google Plugin for Eclipse that can be used for the latest three Eclipse versions can be found here:
https://developers.google.com/eclipse/docs/download
With the above in place, you should be able to set
"manifest_version": 2
in your manifest.json file and not experience any errors due to GWT-generated inline Javascript. This should allow your Chrome Web app to be acceptable to the Chrome Web Store (which now requires manifest version 2 for any new apps or for updates to present apps), so long as there are no other issues.
EDIT: new GWT bug reported: http://code.google.com/p/google-web-toolkit/issues/detail?id=7685, see also http://gwt-code-reviews.appspot.com/1838803/ which is related to this bug
In other words, it looks like, when fixed, you'll simply have to use the DirectInstallLinker (<add-linker name='direct_install'/>).
In the mean time, IIUC, you'd have to extend DirectInstallLinker and:
override getJsInstallLocation to return a copy a installLocaltionIframe.js without the $wnd part
override getModulePrefix to prepend var $wnd = $wnd || window.parent; to what's generated by super.getModulePrefix
I don't know CSP enough to give a complete answer, but the xsiframe linker is "customizable": create a class that extends com.google.gwt.core.linker.CrossSiteIframeLinker and overrides the appropriate methods, then use with a <define-linker> and <add-linker> in your *.gwt.xml.
For instance, getJsInstallLocation defaults to com/google/gwt/core/ext/linker/impl/installLocationIframe.js but there's a com/google/gwt/core/ext/linker/impl/installLocationMainWindows.js alternate implementation.
Similarly (and probably more importantly), getJsInstallScript defaults to com/google/gwt/core/ext/linker/impl/installScriptEarlyDownload.js but there's also a com/google/gwt/core/ext/linker/impl/installScriptDirect.js alternate implementation.
See http://code.google.com/p/google-web-toolkit/source/browse/trunk/dev/core/src/com/google/gwt/core/linker/CrossSiteIframeLinker.java#204, http://code.google.com/p/google-web-toolkit/source/browse/trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/ and http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/core/Core.gwt.xml
Thanks to Thomas Broyer's advice. I created this GWT Linker. Now my GWT application runs perfectly as an Chrome Application (Tested on Chrome 32 and GWT 2.5.1).
public class CSPCompatibleLinker extends DirectInstallLinker {
#Override
protected String getJsInstallLocation(LinkerContext context) {
return "com/google/gwt/core/ext/linker/impl/installLocationMainWindow.js";
}
}
Dont forget to declare the Linker into your*.gwt.xml file:
<define-linker name="csp" class="com.sfeir.linker.CSPCompatibleLinker"/>
<add-linker name="csp" />
Manifest version 2 does not allow inline scripts. You need to make sure all scripts are linked instead and no JavaScript in HTML elements.

How can I fix this Android SDK build problem in Eclipse?

I am using Eclipse for Android dev and everything was going fine until I tried to incorporate the facebook SDK. Now when I tried to back it out, there appears to be an artifact left behind that Eclipse tries to link the FB library?!?
[2010-11-17 18:50:22 - Library Project] Unable to set linked path var '_android_com.facebook.android' for library /Users/mobibob/Projects/workspace/facebook-android-sdk/facebook: Path variable name cannot contain character: ..
Any clue where this command / reference is in the build configuration? I have scoured it as best that I can, but I still get the same error.
Problem solved ... as it turns out, it was not so much the Facebook SDK but something that I did in the process of configuring the library reference. I am not entirely certain of how I misconfigured, but I was tweaking the various "path" settings such that, once when the automatic build tried to build my project, an import for android.R was added to my source module. This superseded com.myproject.R and would not resolve the values for resource references.
There were other problems with path order and setting that I modified during the troubleshooting that made it worse. Recreating the project without Facebook was the first step to discovery and fixing.
Either way, the lesson I learned is that the build error messages can misdirect one to the configuration when the problem is in the source code.

Vaadin - GWT error "module xxx may need to be recompiled

I'm ramping up on Vaadin and I'm getting this javascript alert whenever I try and run the demo apps.
GWT module 'com.vaadin.terminal.gwt.DefaultWidgetSet' may need to be recompiled
I've tried cleaning the project to no avail.
As I said, I'm ramping up so I'm sure there's some simple step I'm missing or a concept I haven't grasped.
I don't know anything about Vaadin, but there's a more general context in which this error occurs:
So long as you're testing in Eclipse, the dynamic coding of your app is still real Java coding being run in a JVM. This coding is made available through debugger that's accessible via a socket. You get a URL that looks like this:
http://127.0.0.1:8888/MyApp.html?gwt.codesvr=127.0.0.1:9997
with this codesvr thing being your eclipse-hosted debugger process for your Java code.
Before your app can run standalone, GWT has to translate your Java code to JavaScript; separate versions of the code are produced for each browser type (Firefox, WebKit, Opera, ...) and language that you want to support. Only once this is done can you access your app the usual way via
http://127.0.0.1:8888/MyApp.html
After weeks of running my app only in Eclipse, I'd managed to forget about the compiling-for-browsers step and wondered about the message. The way to fire up the compiler, if you're not using the Ant task, is to hit Google|GWT Compile in the project's context menu. That done, the JS in your app gets fleshed out and your app can run without Java on the client side.
And of course the message goes away.
It is a warning not an error. Does the app work? Otherwise you have to recompile the Vaadin widgetset. These might help too: http://vaadin.com/directory/help/using-vaadin-add-ons
Often this message meens:
you're missing the ?gwt.codesvr=127.0.0.1:9997 parameter in the URL (or have misspelled it).
your module uses the xs linker <add-linker name="xs" />. This is a known limitation and will be fixed in the future: Issue 4232: Allow Development Mode to work with XS Linker
You may need to clear the browser cache. It is possible that the compiled js that the browser is using is not the js that has most recently been compiled.
In Chrome you can see if the cached js is being used in the developer tools windows (ctrl + shift + i). In the size column it will say (from cache) instead of the actual size. You can then right click and clear the browser cache. ctrl + r to reload and the error should be gone.
Carl Smotricz is absolutely right.
Just Cleaning and Build Project on the topmost menu doesn't work.
You must use "Google | GWT Compile" on the context menu generated when right-clicking on your GWT project, prior to deployment.
The error may not be about not-adding "?gwt.codesvr=127.0.0.1:9997" at the end of host web page if he or she tried to deploy the GWT-based webapp on WAS external to Eclipse.
Server restart did the job for me.
I had tried clearing cache, clean and rebuild .. but i was still getting the same warning message.
Server restart made it reload all the stull from the latest compiled war.
It was a hit and trial and i am glad it worked :) :)