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.
Related
As a long-time J2EE developer, I have always been curious as to why NetBeans uses(i.e. forces you to use) the Tomcat Manager app to deploy while Eclipse seems perfectly happy/able to deploy without the manager app? Though I have googled this exhaustively over the years, I have never found even the beginning to an answer. Perhaps this is nothing more than how each product started and has never changed.
Does anyone have any insight or educated theories they would be willing to share?
[Edit] Sigh... to address shekhar's comment, I see that it is not absolutely clear that I am referring ONLY to using Tomcat. I mistakenly assumed that the title and context of my question was sufficient, but again, I am specifically referring to using Tomcat as the Servlet Container with these IDEs. Thanks.
[Edit] I don't know who down-voted this but I have researched this for a long time and found zero reason for it. As for down-voting because it might not be useful, I think that is in the eye of the beholder; also, it usefulness can only be determined based on the answer which is why I am asking.
Sounds like a good topic for Quora but anyway...
I can only speak about NetBeans. It originally used a patched version of Tomcat 3. (early NetBeans 3.x releases). Tomcat Manager was added in Tomcat 4 and it was used because it was possible to integrate easily with your Tomcat installation without knowing much details about their setup. Start/stop Tomcat can use default scripts and will pick up your settings. Deploy does not need to care about access rights and it just assumes that manager works.
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 :-).
Previously i worked with Spring 2.5.6, and whenever i do some changes in jsp pages, i simply refresh the project in eclipse and the change will be reflect.
But then, we are migrating this to 3.0 and everything is fine, but even when i make some changes in JSP, and refresh the project, it is not reflecting. Every time we need to restart the server, to see the changes.
I tried everywhere and didn't get a solution for this.
I am using Eclipse 3.3 + jdk 1.6.0_22 + Windows 7. I am suffering a lot because of this and it would be great if someone helps me fix this issue
Sometimes this can be due to your browser caching, especially "big" files like javascript or css. Couple things to try might be clearing your cache manually, or getting a browser like Firefox or Chrome, using the private browsing feature (nothing is cached in private browsing) and using that to test new features. (This is especially true if you're using the new <resources> bean in Spring MVC, which I believe automatically caches resources it's pointed at)
If this does not work, your container could be set to not republish on application changes.
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.
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?