superdev mode not loading module - gwt

Hello I'm upgrading my gwt from 2.4.0 to 2.7.0 with gxt 2.3.1a. Everything was looking alright ultil I try to debug the application. I start the debug using superdev mode without any problems aparently. Here is the end of my debug start.
"
[INFO] Unification traversed 108163 fields and methods and 8186 types. 8146 are considered part of the current module and 8146 had all of their fields and methods traversed.
[INFO] Compiling 1 permutation
[INFO] Compiling permutation 0...
[INFO] Linking per-type JS with 8130 new types.
[INFO] prelink JS size = 26317582
[INFO] prelink sourcemap = 26317582 bytes and 534648 lines
[INFO] postlink JS size = 26027857
[INFO] postlink sourcemap = 26027857 bytes and 528723 lines
[INFO] Source Maps Enabled
[INFO] Compile of permutations succeeded
[INFO] Compilation succeeded -- 128,510s
[INFO] Linking into C:\Users\ALEXAN~1.RIS\AppData\Local\Temp\gwt-codeserver-3435183735990420589.tmp\br.com.webb.ria.Application\compile-2\war\br.com.webb.ria.Application; Writing extras to C:\Users\ALEXAN~1.RIS\AppData\Local\Temp\gwt-codeserver-3435183735990420589.tmp\br.com.webb.ria.Application\compile-2\extras\br.com.webb.ria.Application
[INFO] Link succeeded
[INFO] Linking succeeded -- 11,742s
[INFO] 147,211s total -- Compile completed
"
After I start the remote debug I get the normal gray window of gwt debug plugin. Everything is processed without any errors. When I copy the generated link on my browser I get the following message.
"Compiling br.com.webb.ria.Application" My gwt module.
The problem is that after the message vanishes I get nothing but the plain html. The module is not loaded on screen and I can't see my application.
I've tried using the "Dev Mode On" button from my bookmark, nothing happens. I tried to stop using "Dev Mode Off" and then clicking on "Dev Mode On" again, nothing happens.
I also tried enabling https support and <set-property name="user.agent" value="safari" />. Nothing seems to help. Any ideas?

Unlike convencional debug mode, superdev mode requires a full compilation before debuging to work. If you are using maven and face the same problem, perform a mvn clean package before trying to debug.

Related

Scala Play SBT is timing out [duplicate]

I am starting the the application from the command line using either
activator run
activator ~run
or after I start the activator console I use run or ~run.
everything seems to work and it gives the expected
--- (Running the application, auto-reloading is enabled) ---
play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
(Server started, use Ctrl+D to stop and go back to the console...)
I can view the application in the browser and I can make changes in the code and they are reloaded just fine. the issue is that after only a couple minutes it seems like something "times-out" because if I try to reload after this the browser just sits there spinning.
if i let it spin long enough I get.
[error] application -
[info]
[info] ! Internal server error, for (GET) [/] ->
[info]
[info] java.util.concurrent.TimeoutException: Futures timed out after [300000 milliseconds]
[info] at scala.concurrent.impl.Promise$DefaultPromise.ready(Promise.scala:219) ~[scala-library-2.11.1.jar:na]
[info] at scala.concurrent.impl.Promise$DefaultPromise.result(Promise.scala:223) ~[scala-library-2.11.1.jar:na]
[info] at scala.concurrent.Await$$anonfun$result$1.apply(package.scala:111) ~[scala-library-2.11.1.jar:na]
[info] at scala.concurrent.BlockContext$DefaultBlockContext$.blockOn(BlockContext.scala:53) ~[scala-library-2.11.1.jar:na]
[info] at scala.concurrent.Await$.result(package.scala:111) ~[scala-library-2.11.1.jar:na]
I would really appreciate any help. Since having to restart the app all over again each time I make a change really takes away the appeal of the framework.
I upgraded to activator 1.3.2 with Play 2.3.9 and I also had the same issue. It drove me nuts. I found that the cause was the new set "fork in run" setting added in activator 1.3.2.
Open up build.sbt and you will find :
fork in run := true
Set this to false as follows :
fork in run := false
Running activator start or better sbt start fixes the issue as well without having to remove the forking behavior.

Does lombok work with GWT super dev mode?

I use lombok extensively at backend, it's really nice and I hope to integrate it into GWT, so I can take advantage of the magic.
I managed to let gwt-maven-plugin recognize lombok by using the -javaagent:lombok.jar=ECJ vm args to be able to compile successfully, however, I'm not sure how to make it work with GWT super dev mode, as it continues complaining "missing getter method" in my IDE(Intellij IDEA).
Also tried the delombok goal of lombok-maven-plugin but without luck.
Any ideas?
Make sure to delete your workDir before starting gwt:run-codeserver. This directory might contain files from previous (lombok-unaware) compilation attempts.
[INFO] --- gwt-maven-plugin:2.8.0-beta1:run-codeserver (default-cli) # Web ---
[INFO] Turning off precompile in incremental mode.
[INFO] Super Dev Mode starting up
[INFO] workDir: C:\Users\jzaruba\AppData\Local\Temp\gwt-codeserver-1653004051676437159.tmp
This is what my mvn-gwt-codeserver.bat looks like:
call mvn clean dependency:properties gwt:run-codeserver %*
(I added dependency:properties because my gwt-maven-plugin configuration refers to Lombok via project dependency: ${org.projectlombok:lombok:jar}, i.e. no static path.)
And if you don't like launching the codeserver from command line, this is how "VM arguments" in my "GWT Codeserver" launch configuration look like:
-javaagent:path/to/lombok.jar=ECJ

Can not reflect changes using gwt-maven-plugin superdev

Follow steps in this post,
I use gwt-maven-plugin 2.6.0, when I run mvn gwt:run-codeserver it compiled successfully:
[INFO] binding: user.agent=safari
[INFO] Compiling module com.example.myModule
[INFO] Validating units:
[INFO] Ignored 3 units with compilation errors in first pass.
[INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
[INFO] ...
[INFO] Compiling 1 permutation
[INFO] Compiling permutation 0...
[INFO] Source Maps Enabled
[INFO] Compile of permutations succeeded
[INFO] Linking into C:\Users\admin\AppData\Local\Temp\gwt-codeserver-5664784549647002986.tmp\com.example.myModule\compile-4\war\myModule;
Writing extras to C:\Users\admin\AppData\Local\Temp\gwt-codeserver-5664784549647002986.tmp\com.example.myModule\compile-4\extras\myModule
[INFO] Link succeeded
[INFO] Compilation succeeded -- 3.401s
[INFO] Compile completed in 3496 ms
Then I started the dev server using mvn install gwt:run, made changes on my source file and click the Dev Mode On bookmark. After compiling the changes cannot reflect to UI: the UI always show old values.
Any ideas on this problem?
There's a bug in gwt-maven-plugin up to (including) 2.6.0; you have to run mvn process-classes gwt:run-codeserver instead of just mvn gwt:run-codeserver. This is fixed in 2.6.1.
Also, if you change anything in src/main/resources, you'll have to run mvn process-resources to make your changes available to Super Dev Mode (this is because you might use resource filtering, so Super Dev Mode doesn't directly look at src/main/resources).
Similarly, if you use plugins that generate resources or Java sources, you'll have to run them manually (e.g. mvn generate-sources or mvn generate-resources; or just use the same mvn process-resources as above, which will do everything at once). This will be necessary for example if you use gwt:generateAsync and change your GWT-RPC interface (note that you'll also have to redeploy your server-side code).
Note: I just updated my answer in the linked post for GWT 2.6.0, and added a note about GWT-RPC, and the gwt-maven-plugin bug.

Error to compile when applying Single Script Linker

Because I am creating a chrome extension with GWT project, I want to use Single Script Linker to avoid inline scripting restriction (sigh...).
And I found this resource on line: http://tech-drum.blogspot.ch/2012/08/gwt-chrome-extension-using-version-2.html
This single script linker looks like a charm, but when I really added it into my gwt.xml file and compile, it got errors... (sigh again)
The following is the error msg:
[INFO] --- gwt-maven-plugin:2.5.1:compile (default) # fake-app ---
[INFO] auto discovered modules [com.fake...]
[INFO] Compiling module com.fake.name.app
[INFO] Compiling 6 permutations
[INFO] Compiling permutation 0...
[INFO] Process output
[INFO] Compiling
[INFO] Compiling permutation 3...
[INFO] Process output
[INFO] Compiling
[INFO] Compiling permutation 1...
[INFO] Process output
[INFO] Compiling
[INFO] Compiling permutation 2...
[INFO] Compiling permutation 4...
[INFO] Compiling permutation 5...
[INFO] Compile of permutations succeeded
[INFO] Linking into /path/to/fake/app
[INFO] Invoking Linker Single Script
[INFO] [ERROR] The module must have exactly one distinct permutation when using the Single Script Linker; found 6
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
What's the problem with this? It looks that permutation number (assumed as js file?) to be larger than expected, but shouldn't the linker put size restriction when creating permutations? In short, how to fix this? Thanks a lot!
Selecting just the user agent for Chrome should fix your problem.
You don't need more user-agent permutations since your extension only works with one browser.
The linker you are using is the correct one for producing just a javascript file with the code of your extension.
<set-property name="user.agent" value="safari" />
The linker runs after the code is compiled, it can't make judgements about the output until that point. This particular linker expects to produce exactly one JS file (plus images, etc perhaps, but not more code) hence 'single script'. Generating more than one permutation prevents it from doing its job.
Consider selecting a different linker, or combining all of the properties you are using (likely just user.agent) into one permutation with this in your module file (from http://code.google.com/p/google-web-toolkit/wiki/SoftPermutations):
<collapse-all-properties />

Problem upgrading to GWT 2.3.0

I'm totally flummoxed by a GWT problem, and have no clue how to interpret the GWT log or how to troubleshoot the problem. I'm working on a fairly trivial template project. I upgraded to GWT 2.3.0 and am now running into the following issue when compiling the module using the maven-gwt-plugin:
[INFO] --- gwt-maven-plugin:2.3.0:compile (default) # gaewebtemplate ---
[INFO] auto discovered modules [stuff.gaegwttemplate.Main, stuff.gaegwttemplate.security.SecurityRequest]
[INFO] Loading inherited module 'com.google.gwt.activity.Activity'
[INFO] Loading inherited module 'com.google.gwt.place.Place'
[INFO] Loading inherited module 'com.google.gwt.user.User'
[INFO] Loading inherited module 'com.google.gwt.animation.Animation'
[INFO] Loading inherited module 'com.google.gwt.core.Core'
[INFO] Loading inherited module 'com.google.gwt.core.CrossSiteIframeLinker'
[INFO] [ERROR] Unable to load class 'com.google.gwt.core.linker.DirectInstallLinker'
[INFO] java.lang.ClassNotFoundException: com.google.gwt.core.linker.DirectInstallLinker
< Huge stack-trace removed >
[INFO] [ERROR] Failure while parsing XML
[INFO] com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
< Huge stack-trace removed >
[INFO] [ERROR] Unexpected error while processing XML
[INFO] com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
The two stack traces and cryptic error messages above is then repeated creating page after page of (as far as I can tell) completely useless log information.
Does anyone know what might be going on here? Any idea what logging "strategy" Google is using here :).
Gunnar,
I ran into a similar issue. If you are trying to use a GWT SDK newer than the maven plugin, you have to also point the maven plugin to that SDK, like this:
http://mojo.codehaus.org/gwt-maven-plugin/user-guide/using-different-gwt-sdk-version.html
Otherwise, I believe the maven plugin will still use the GWT version that matches it (if you were to delete your GWT jars from your maven repo, you could confirm this by seeing it downloading the older version.)
The DirectInstallLinker class doesn't appear to be present in GWT 2.3, but I do see it in trunk - are you sure you are using 2.3.0? To get this error, it seems likely that you have at least one copy of something newer than 2.3.0 on your classpath.
GWT 2.3.0 was released on May 2, while the DirectInstallLinker doesn't appear to have been added to source until May 6.
The GWT compiler is using the TreeLogger class, built in to GWT as a way for the compiler and generators to nest debug/error/info messages.
I got the same error when upgrading from gwt 2.3 to gwt 2.4. I was being silly and updated the version on the gwt-user dependency but not on the gwt-dev dependency. So, check that you aren't also being silly.