Gwt hosted mode stopped working from Eclipse on adding a special dependency via maven - gwt

On integrating a library on server side of my gwt app (maven, gwt 2.4) the development/hosted mode stopped working. The app works fine if deployed or run with "gwt:run" and all unit tests and integration tests pass as before.
If i start development mode (run/debug as web application) from Eclipse the develpoment mode view pops up but nothing else happens. normally the console should show some output but console keeps empty. So i don't even have a hint whats going wrong.
Can someone give some advice where to look / what to do to get at least a hint what's wrong?
if i check out the revision before integrating the library the development mode works! - at the moment i add the dependency (only adding not using it) it stops working.
Background about library i added (don't know if my problem relates to this):I had some problem on integrating the library. the library uses eclipse birt charting engine. This engine has a dependency to Apache derby db, this conflicted with another library. i solved this by excluding the derby dependency via maven. the second problem was a "command line too long" error on unit test - this was solved by updating the maven-surefire-plugin.

The Problem was hard but the solution is simple: With Java 7 it is working!
The problem could be reproduced on 2 of 3 machines. The machine without the problem is the only one that uses java 7. So i installed java 7 on my machine and linked eclipse to it - now hosted mode (from eclipse) works again :-).

Related

How enable production mode in GWT 2.7 application

I would like to deploy my GWT 2.7 application on my server through gwt-maven-plugin and jenkins. But, after compile process, when I launch my application, I've this error message :
Couldn't load APPLICATION_NAME from Super Dev Mode
server at http://MY_IP:9876.
Please make sure this server is ready.
Indeed, the super dev mode is enabled by default since 2.7. So, how disable it to use production mode ?
Ok thank you very much for your comment. Indeed, my problem concerned the *.nocache.js and *.devmode.js files. I started my project (my first one in GWT) in 2.6 version and these files were created (by dev and super-dev-mode) and versionned by my fault. So, when my jenkins deployed my project, it used these files so even if I did mvn clean before deploy it had no effect.
So, I removed these files from my project and I did a mvn clean install before deploy to fix my issue.

GWT/GPE Development / Eclipse Slow - Workspace recreation helped

Im finding after a few weeks of GWT development my Development Mode compilations suddenly slow down at the stage where you see this in the Development Mode console log:
Validating newly compiled units
I've found a related question but this seemed a little vague compared to my issue
Eclipse getting too slow - workspace recreation helped
Since I lose window/toolbar layout settings (even if export/import prefs) and other useful things when I recreate the workspace I want to find out which files I can clean?
I've raised a bug with GWT..
Another answer which really solved it in my case.
Is it possible that you are operating behind a proxy which has to be configured in Preferences->General->Network Connections (e.g. for installing plugins)?
That's true in my case but I had deactivated the proxy settings to reach the in-house SVN. As it seemed, the Validation routine always tries to download ui binder XSDs without success which takes a lot of time.
Concerning my comment in my first answer: yes, it run a lot faster after reinstallation but the reason was that I had to activate the proxy settings for reinstallation. Once I deactivated it again for an SVN commit, it ran slow again ;-)
I have similar problems with Eclipse (Indigo Service Release 1 Build id: 20110916-0149)
and the GWT plugin. Especially when starting Eclipse, Validating the GWT components in my project takes ages.
Googling revealed that the GWT designer in combination with a 64Bit Eclipse Indigo causes this issue.
http://code.google.com/p/google-web-toolkit/issues/detail?id=6602
I wil try to reinstall the GWT plugin without Designer.

Speeding up code changes in Eclipse Web Browser?

I'm developing an application using the Vaadin framework in Eclipse. I'm using the Tomcat v6.0 servlet and run the application in the Eclipse Web Browser. A problem I've been having though is to have recent changes show in the browser when I test the application.
No matter how many times I restart Tomcat, clean all published resources and restart the Eclipse Web Browser the changes still won't take effect. The changes seem to take effect randomly where time is the biggest factor, which is of great frustration when developing...
So my question is if anyone else has noticed this problem and have any ideas of how to solve it, if there is a configuration I can do or if I'm missing a step in the restart which blocks the changes from taking effect..?
Any help would be greatly appreciated!
In Vaadin most of the code runs in the server and is contained in normal Java files. There are three levels of resource/class changes:
The runtime "hot code replacement". If running Tomcat in debug mode some Java class changes can be published without redeploying the web application. However, if the Tomcat is configured to "auto publish" (check your server settings in Eclipse), the redeployment is automatically done whenever classes change and this causes full context reload and sessions serialization (see #2) . Hot code replacement can be enhanced using tools like JRebel.
Web application deployment. This is essentially deploying a new war file to the server. Causes the previous version to be undeployed and deploys the new version of all classes and resources. Sometimes there are some resources left in the servers work directory or classes are not reloaded, in which case the server restart (#3) is needed.
Server restart. This makes the whole JVM to reload and all the classes and web applications are also reloaded. Still cleaning the work directory separately is needed to make sure everything is reloaded.
In addition to this there is the client-side part of Vaadin (essentially a JavaScript compiled with GWT), which is treated as a static resource by Tomcat. If you modify the client-side Java code the GWT is used to recompile the JavaScript. Deployment should be simply file copying. The browsers cache the generated HTML/JS files, but GWT includes mechanism to avoid this.
You should first try to change the server settings for automatic publishing and see if that helps. Also, I've noticed that different Tomcat version behave differently. This is unfortunate, but the only thing you can do is to try to find the versions/set-up that works for you.
Just to make sure: you have been adding ?restartApplication in the URL to force application to restart on page reload, haven't you?

Eclipse Hot Code Replace Fail - republish web application

I use the Hot Swap java debugging feature with web app on Tomcat. After some class signature change, I got "Hot Code Replace Fail" Eclipse dialog - I understand that.
What I want in such case is to republish the application (I can do that) and work with the newly deployed code. However the debugger stil complains, until I restart the server. Because other apps and long startup I don't want that.
Is there a way how to tell to the debugger, that there is the new class version already reloaded in a new webapp classloader and that it is save to continue?
Thanks.
Why don't you try with JRebel?
JRebel is a JVM Java Agent that integrates with application servers, making classes reloadable with existing class loaders. Only changed classes are recompiled and instantly reloaded in the running application.
JRebel plugs into IDEs and build systems. Classes and static resources are loaded straight from the workspace.
http://zeroturnaround.com/software/jrebel/
Regards,
Andrea
There is a old PHD project. The guy who made it was brought by Oracle but his work didnt made it to the Java 8 and hopefully will be seen in Java 9 but is more likely to be in Java 10. There is a new Version of this for Java 8 I guess. I havent tried it yet.
My Original Question for additional information: Advanced Code Hot Swapping in JDK 8?
And the Project page on Github: https://github.com/dcevm/dcevm
With this you can hot replace almost any class change freeing you from restarting the JDK ever after. (beside sideeffects for static objets and singletons but that would be logical)
Did you try Server Options - Serve modules without publishing along with Publishing?
Also not sure what you are saying about other apps.

GWT in its web-mode throws StatusCodeException but in its hosted-mode , it's working perfect

I am new to this forum.
Actually I have an issue here regarding my application which is
hibernate+struts based application. Recently we have decided to
integrate GWT into our application. We are using gwt 1.5.3 build.
We have set up everything exactly as we find in documentation and
various blogs. Yeah I am now in a very nervy state as gwt in its web-
mode is treating me in a very embarassing manner. But it is compiling
and working perfectly fine in its hosted-mode and everything works
fine as we expected and designed. When I try to integrate GWT with our
application i.e. running in tomcat (http://localhost:8080/myapps/example.do?
reqCode=takeMeToGWT&userId=12&templateId=10). The gwt page is loaded
partially and in the midst it throws an exception i.e.
StatusCodeException. This doesn't happen when I run the gwt
application in hosted-mode ( http://localhost:8888/com.myapp.gwt.MyApp/Home.html
) .
I am using Intellij Idea 8, struts 1.3 ,hibernate 3 and tomcat 5.5 .
Expecting your responses at the earliest possible time.
Thanking you
B Roshnikanta Sharma
broshnikanta#gmail.com