GWT SuperDevMode throws this: Multiple fragment 0 sourcemaps found. Too many permutations - gwt

I am using SuperDevMode with Chrome and it worked fine until suddently the sourcemaps stopped showing in Chrome.
And CodeServer throws the following exception: Multiple fragment 0 sourcemaps found. Too many permutations.
During compilation it shows:
Compiling 5 permutations
Compiling permutation 0...
Source Maps Enabled
Compiling permutation 1...
Source Maps Enabled
Compiling permutation 2...
Source Maps Enabled
Compiling permutation 3...
Source Maps Enabled
Compiling permutation 4...
Source Maps Enabled
Compile of permutations succeeded
Any ideas?

By default GWT compiles 6 basic permutations, one for each category of browser.
Firefox, all versions
All Webkit browsers (Safari, Chrome, Android Browser, etc)
IE6 and IE7
IE8
IE9 (and IE10)
Opera
There is a reported issue about that: Issue 7458: Super Dev Mode shouldn't compile 6 permutations when user.agent is missing
Suggested workaround from the issue description:
is to restrict the browser permutations in the gwt.xml file. For example, if you are using Chrome or Safari:
<set-property name="user.agent" value="safari"/>
Also if you're using Sencha GXT I also recommend look through the following article: Using the GWT Compiler for Better Builds
According to the article I also added following line to my gwt.xml:
<collapse-all-properties />
So finaly my config for SuperDev mode is the following:
<add-linker name="xsiframe"/>
<set-configuration-property name="devModeRedirectEnabled" value="true"/>
<set-property name="compiler.useSourceMaps" value="true" />
<set-property name="user.agent" value="safari"/>
<collapse-all-properties />
As result GWT compiles only one permutation:
binding: user.agent=safari
binding: compiler.useSourceMaps=true
binding: locale=en
Compiling module com.mycompany.Main
...
Compiling 1 permutation
Compiling permutation 0...
Source Maps Enabled
Compile of permutations succeeded

This can happen if you add locales but do not add the en locale explicitly and/or don't "remove" the default locale and you didn't Dev Mode Off before loading the page in your browser.
For instance, in my module, I had:
<extend-property name="locale" values="fr" />
<set-property-fallback name="locale" value="fr"/>
With this setting, there are 2 locales: fr and default (but the default locale is no longer used, as I override the fallback to fr).
When launching SuperDevMode, it compiles 2 permutations (probably because it forces the locale to en but doesn't actually checks whether such a locale exists in the module).
I had previously launched the app and turned Dev Mode On, but then stopped and restarted the SuperDevMode. When I refresh the page in Chrome, because it's still in dev mode (the state is stored in localStorage), it loads the script from SuperDevMode and tries to load the source maps right away, and this fails as the SuperDevMode compiled 2 permutations and not just one.
Clicking Dev Mode On and Compile forces the SuperDevMode to recompile using the properties from the browser environment (locale=fr here, as it's the fallback). It thus compiles a single permutation and source maps work again.
In my specific case, I needed a single permutation; all I had to do was to add <set-property name="locale" value="fr"/>.
You must be in a similar situation.
I'm sorry that's all the information I can share. Nothing authoritative.

Related

configuring Java 9 in JNLP

The docs say I can configure the Java 9 platform in JNLP like this:
<j2se version="9" ... />
However if I do so and try to run it using Java 9.0.4 I get a warning saying the requested Java version (9) is not installed. My code:
<j2se version="9" java-vm-args="-Xmx1g" href="http://java.sun.com/products/autodl/j2se"/>
If I do this instead, there is no such popup:
<j2se version="9.*" ... />
But I cannot find such a "*" wildcard in the specs. What is going on?
I found out what's wrong. My example was incomplete, because I did not mention the href attribute I was using in the j2se element.
Solution: In contrast to versions, platforms must be specified without href attributes.
If a platform version is specified (that is, no href attribute is
provided)
https://docs.oracle.com/javase/9/deploy/jnlp-file-syntax.htm
Fixed element (for the example in the question):
<j2se version="9" java-vm-args="-Xmx1g"/>

ie6 wast not previously defined error in GWT 2.6.0/GXT2.5.1

I got the following error when compiling the code with GWT 2.6.0 and GXT 2.5.1.
Loading inherited module 'com.sencha.gxt.ui.GXT'L
Loading inherited module 'com.sencha.gxt.data.Data'
Loading inherited module 'com.sencha.gxt.core.Core'
[ERROR] The value ie6 was not previously defined.
[ERROR] Line 96: Unexpected exception while processing element 'set-property'
Even though we don't specify ie6 in gxt.user.agent, we still get the error: "[ERROR] The value ie6 was not previously defined."
Why does GXT still try to set ie6 despite we don't set it in gxt.user.agent?
Does anyone know when Sencha will release a new GXT version that resolve this problem?
They released a beta already: https://www.sencha.com/blog/announcing-gxt-3.1-beta/
…or you could re-enable the ie6 permutation:
<extend-property name="user.agent" value="ie6" />
Just to clarify 2 points,
If using GXT-3.0.1 or earlier => It is only compatible with GWT-2.5.1 (or earlier).
If using GXT-3.1.0_Beta => It is only compatible with GWT-2.6.0 (or later).
Otherwise various errors will be caused during compilation/runtime.

Running GWT SuperDevMode in IDEA on Win8

I am trying to configure my GWT project to run in SuperDevMode and experience severe problem during server run time.
So, I have working "regular" devMode configuration in Intellij IDEA. Created a new GWT configuration in app-servers list. Set the following values:
[Checked] Super Dev Mode
VM options: -Xmx512m -XX:MaxPermSize=384M
Dev Mode parameters: -bindAddress 0.0.0.0 -port 1234 -workDir d:\projects\myApp\SDV\ -src d:\projects\myApp\src\main\java com.app.MyApp
Made changes to my project's build xml file adding the lines in the end of file:
<add-linker name="xsiframe"/>
<set-configuration-property name="devModeRedirectEnabled" value="true"/>
<!-- enable source maps -->
<set-property name="compiler.useSourceMaps" value="true" />
Here is the console output on this config run:
workDir: d:\projects\myApp\SDV
deleting: d:\projects\myApp\SDV\com.app.MyApp\compile-1
binding: user.agent=safari
binding: compiler.useSourceMaps=true
binding: locale=en
Compiling module com.app.MyApp
Compiling 1 permutation
Compiling permutation 0...
Source Maps Enabled
Compile of permutations succeeded
Linking into d:\projects\myApp\SDV\com.app.MyApp\compile-1\war\myapp; Writing extras to d:\projects\myApp\SDV\com.app.MyApp\compile-1\extras\myapp
Link succeeded
Compilation succeeded -- 84.458s
Compile completed in 85210 ms
deleting: d:\projects\myApp\SDV\com.app.MyApp\compile-1
[ERROR] unable to create directory: d:\projects\myApp\SDV\com.app.MyApp\compile-1
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
at com.google.gwt.dev.codeserver.CompileDir.mkdir(CompileDir.java:103)
at com.google.gwt.dev.codeserver.CompileDir.create(CompileDir.java:93)
at com.google.gwt.dev.codeserver.Recompiler.makeCompileDir(Recompiler.java:267)
at com.google.gwt.dev.codeserver.Recompiler.compile(Recompiler.java:82)
....
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Process finished with exit code 1
I suspect it maybe Win8 file access permissions problem: cannot create the directory because it wasn't deleted successfully. Both lines in the log above that have this text:
deleting: d:\projects\myApp\SDV\com.app.MyApp\compile-1
are of red color in IDEA (if that has any special meaning).
I unchecked READ_ONLY checkbox in the properties of for the work folder in file explorer, and also run idea64.exe as Admin. Should I somehow run this codeserver compiler "as admin" too? Is it possible?
Also it may be a configuration issue, if it is and somebody can see it from the details below - I would really appreciate the help. Thanks in advance!
UPDATE
Running the superDevMode config with parameter "-noprecompile" gives the same results:
workDir: d:\projects\myApp\sdv
deleting: d:\projects\myApp\sdv\com.app.MyApp\compile-1
Module setup completed in 865 ms
deleting: d:\projects\myApp\sdv\com.app.MyApp\compile-1
[ERROR] unable to create directory: d:\projects\myApp\sdv\com.app.MyApp\compile-1
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
at com.google.gwt.dev.codeserver.CompileDir.mkdir(CompileDir.java:103)
at com.google.gwt.dev.codeserver.CompileDir.create(CompileDir.java:93)
at com.google.gwt.dev.codeserver.Recompiler.makeCompileDir(Recompiler.java:267)
So, definitely looks like file access problem (delete doesn't do its job?). Javadoc to CompileDir.create() method says: "Creates a new compileDir directory structure. The directory must not already exist, but its parent should exist." Seems that it already exists.
I think your configuration is correct. I am using the same parameters (with another portnumber) on my Mac and it works as expected.
The red color of the text:
deleting: d:\projects\myApp\SDV\com.app.MyApp\compile-1
is normal and indicates no problem.
I am not familiar with Windows 8, but would think, that you don't need to run idea.exe with admin rights. I think, uncheck the read-only checkbox should solve your problems.
Another way should be, that you create your workDir directory with Intellij.
File -> New -> directory
(That's what I did).
Ok, so this is fixed now in GWT 2.7.0 by GWT team.
https://code.google.com/p/google-web-toolkit/issues/detail?id=8619
Runs well, even though I can notice the message in the IDE console:
[WARN] unable to delete 'C:\Users\me\AppData\Local\Temp\gwt-codeserver-1341369077945982663.tmp\com.bla.MyAPP\compile-1' (skipped)
[ERROR] unable to create directory: C:\Users\me\AppData\Local\Temp\gwt-codeserver-1341369077945982663.tmp\com.bla.MyAPP\compile-1
Loading Java files in com.bla.MyAPP.
after printing this the IDE continues to run the app server.
Resolving the issue.
I also found that if you are converting your project from GWT 2.6.0 to 2.7.0, you should delete your 2.6.0 run configuration and setup a new one with GWT 2.7.0 defaults.

Runtime error when deploying a JavaFX application

I'm trying to deploy a JavaFX app. The app I've been working on is fairly complex and includes several libraries. When I create a jnlp and try to run it I always get a "Runtime error. Click for details" message. Someone suggested I try doing just a simple Hello World app to see if it's an issue with the included libraries. I tried that and I still get the "Runtime error."
Here's the build.xml I'm trying to use.
<project name="App" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"
classpath="C:\Program Files\Java\jdk7\lib\ant-javafx.jar" />
<target name="default">
<fx:deploy width="600" height="400" outdir="${basedir}/dist" outfile="App">
<fx:application name="App" mainClass="${javafx.main.class}"/>
<fx:resources>
<!-- include application jars -->
<fx:fileset dir="${basedir}" includes="*.jar"/>
<fx:fileset dir="${basedir}/lib" includes="*.jar"/>
<fx:fileset dir="${basedir}" includes="app.ini" />
<fx:fileset dir="${basedir}/template" includes="*.template" />
</fx:resources>
<!-- request user level installation -->
<fx:preferences install="false"/>
</fx:deploy>
</target>
</project>
For the Hello World version I just removed the <fx:resources> section.
I run both of them from inside eclipse as an ant task. They both created a dist folder in my project with a .jnlp and a .html file. I then click on the jnlp to run the app and see a small window that has the text, "Runtime error. Click for details.' I click it and get an error window that says, "The application failed to run. There was an error while executing the application. Click 'Details' for more information." I click the 'Details' button and see a Java Console with the following information (HelloWorld version):
Java Plug-in 10.7.2.11
Using JRE version 1.7.0_07-b11 Java HotSpot(TM) 64-Bit Server VM
User home directory = C:\Users\user
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
Match: beginTraversal
Match: digest selected JREDesc: JREDesc[version 1.6+, heap=-1--1, args=null, href=http://java.sun.com/products/autodl/j2se, sel=false, null, null], JREInfo: JREInfo for index 0:
platform is: 1.7
product is: 1.7.0_07
location is: http://java.sun.com/products/autodl/j2se
path is: C:\Program Files\Java\jre7\bin\javaw.exe
args is: null
native platform is: Windows, amd64 [ x86_64, 64bit ]
JavaFX runtime is: JavaFX 2.2.1 found at C:\Program Files\Java\jre7\
enabled is: true
registered is: true
system is: true
Match: ignoring maxHeap: -1
Match: ignoring InitHeap: -1
Match: digesting vmargs: null
Match: digested vmargs: [JVMParameters: isSecure: true, args: ]
Match: JVM args after accumulation: [JVMParameters: isSecure: true, args: ]
Match: digest LaunchDesc: file:/G:/workspaces/JavaProjects/JavaFXHelloWorld/dist/HelloWorld.jnlp
Match: digest properties: []
Match: JVM args: [JVMParameters: isSecure: true, args: ]
Match: endTraversal ..
Match: JVM args final:
Match: Running JREInfo Version match: 1.7.0.07 == 1.7.0.07
Match: Running JVM args match: have:<> satisfy want:<>
CacheEntry[file:/G:/workspaces/JavaProjects/JavaFXHelloWorld/dist/HelloWorld.jnlp]: updateAvailable=false,lastModified=Fri Sep 14 07:13:28 MDT 2012,length=915
I get a nearly identical error when I run the app I'm working on.
I just uninstalled java and then reinstalled the latest SDK. That didn't do anything except may the app use the 64 bit JVM instead of a 32 bit JVM I had installed. The error message stayed the same.
Does anyone know what I'm doing wrong? Is my build script incorrect? Is there a better way to deploy? I don't have to have a jnlp so I'm open to any deploy method. I just need something I can run on a windows machine and possibly a mac.
I've tried googling my problem and I've searched StackOverflow and can't seem to find anything relevent. I might just be using the wrong search terms.
Any help would be greatly appreciated.
Thanks,
Hardy
If you are using netbeans then Right Click on the Project and Go to Project Properties then to Libraries then click on Manage Platform then select the Default Javafx platform then go to JAVAFX tab and then change the JAVAFX SDK location to where your Java fx 2 sdk is and also similarly change the JAVAFX JRE. Hope this will solve your Problem.
I eventually found out that, in my case, this issue was caused by a bug in the jar signing process. The problem is avoided by emptying the Java cache (on Windows, this can be done through the Java control panel). After doing so and rebuilding, the error no longer occurred in my case.
I'm unsure this will fix your problem, though, as you do not appear to do any signing.

ANT Javac and special characters

I have an ANT task defined like so:
<javac source="1.5" target="1.5" srcdir="${src.dir}" destdir="${classes.dir}" deprecation="on" debug="on" classpathref="classpath" fork="true" memoryMaximumSize="512m" encoding="UTF-8">
<include name="${app.directory}/**/*.java"/>
</javac>
This works fine, but when I have classes with special characters in their names it gives me the following error:
[iosession] Compiling 131 source files to /C24/PUB/io-stds/trunk/standards/GSIT/build/test/deployment/build/classes
[iosession] javac: file not found: /C24/PUB/io-stds/trunk/standards/GSIT/build/test/deployment/src/java/biz/c24/io/minos/AléaChiffréClass.java
[iosession] Usage: javac <options> <source files>
[iosession] use -help for a list of possible options
[iosession] Target compile finished
[iosession]
[iosession] Building unsuccessful 2 seconds
When I remove the "fork=true" it works, but then it ignores the "memoryMaximumSize" setting. I also tried the nested approach, but to no avail.
Any ideas?
It's perhaps not the answer you expect but my advice would be to remove all non-ascii letters from the names of methods and classes. I'm French-speaking too, and I've never seen any company, even in France and using French as its development language, accept accented letters in class names and methods. It's just not good practice, simply because it would be very hard for a non French developer, without accents on his keyboard, to use these classes and methods.
If you use a good IDE, it should allow you to refactor your code easily.
Apache did confirm that the encoding attribute only applies to the file contents and not file names. I reverted back to using fork only when needed and kept encoding="UTF-8".