I'm currently using jboss/maven/eclipse to debug a web app. I've enabled remote debugging in the jboss run.conf file and then use mvn war:inplace to compile and with that I can successfully add a breakpoint and step through code.
However I remember a while back using Tomcat I was able to hotswap or hot-replace a java class by making changes, saving it and then having the debugger re-enter the method. I'm thinking there has to be a way to do this but don't know how.
You can try JBoss Tools Eclipse plugin, or if all else fails, JRebel (however, its not free).
Related
My originally question has been marked as duplicate as this question and asked to ask a new one. So here I repeat, I am not looking for a remote debug solution. What I am asking is how to debug WAR inside eclipse just as a JAVA application. Following is my original question.
I have seen many online tutorial explaining how to use eclipse to do remote debug of WAR file.
But what I want to know is how to do the debug inside eclipse just as debugging a JAVA application? I have Tomcat 7 configured in my eclipse as a server. And I have tested it with a sample servlet program successfully meaning I can set breakpoint in the source code and run into it.
My WAR application is built by gradle. I have imported the gradle project into my eclipse and build it ok inside eclipse by running gradle task inside "gradle tasks view". I added the project into the server. However, when I try to use "Debug as > Debug on Server", it fails and the breakpoint is not get hit. Anyone could share the experience to debug WAR inside eclipse?
I'm developing a java web-application with vaadin and spring and I'm using tomcat7-maven-plugin like application server during development. The problem is that when I run my application and I try to change everythings, I'm getting the following error.
I read many thread like:
Hot Code Replace Failed (eclipse)
How do I get Java “hot code replacement” working in JBoss?
But I'm sure that my jdk is the same for both compile and run steps, I have also the flag Project->Build Automatically activated but each time that I try to modify any thing I get the error above.
Unfortunately Eclipse can't deal very well with hot code modifications.
I would suggest you to have a look to JRebel as I suggest in Eclipse Hot Code Replace Fail - republish web application post.
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.
hey guys please help me to find a way out for debugging my application on eclipse helios.
i have to configure jboss and debug my application
please guide me
thanks a lot
If you're deploying your application via Eclipse, then heldt's comment above is enough for you. However, if you're not you can make use of the remote debugging capabilities built-in to the Java platform.
Import your project into Eclipse
Start JBoss in debug mode (make note of the port being used, it's usually 8787) by editing the configurations to look like the following:
set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n %JAVA_OPTS%
Use the debugger in Eclipse to connect to the server process on the debug port. On my setup of Eclipse 3.5, I need to go to Run > Debug Configurations, select Remote Java Application from the sidebar, create a new configuration and set the appropriate connection parameters.
Here are are links to a few tutorials that explain this process in more detail:
http://blog.mangar.com.br/?p=53
http://www.jacoozi.com/index.php?option=com_content&task=view&id=119&Itemid=134
http://onjava.com/onjava/2005/08/31/eclipse-jboss-remote-debug.html
http://java.sys-con.com/node/44918
I'm having this problem in eclipse (EE) when I change things in my code (even something as simple as the text I'm printing using println) it doesn't get applied. I'm using JBoss and when I rerun the servlet, nothing happens.
Any idea how I can force JBoss/Eclipse to do this? I can't preview anything so it's really annoying if I want to test some new code.
Thanks!
Eclipse publishes the newer versions of your application periodically (its called the automatic publish feature). Either the interval is too large, or you're not waiting sufficiently long enough for re-deployment, or automatic publishing of the application has been disabled.
Sometimes, despite ensuring the above, Eclipse might still not publish the newer classes, in which case you might want to perform a clean build, which causes the newly built classes to be loaded into JBoss.
Sorry to ask such a basic question: Do you save your changes before testing?
Eclipse uses its own compiler to check for syntax errors while you are editing, but you have to save the file before the edits take effect in the application.
I only ask because this could be confusing if you are new to Eclipse, having changed from a different IDE. File permission settings can also prevent your files from being saved or built.
Working on EJB deployed in JBoss with Eclipse IDE.
We have ANT build file, in which first old project is deleted from JBoss,
then compiling classes, & building proper directory structure & deploy as .ear - .sar again in JBoss directory.
Stop JBoss, run build file, start JBoss.
Its a good practice to have a build file to deploy project.
I'm trying to move our Google Web Toolkit (GWT) development from Eclipse to IntelliJ 9 Community edition. So far I've been able to run and debug client/server code successfully via the GWT Maven plugin and its embedded Jetty container.
However, I'm having trouble debugging client code when it is already running on a remote machine (and hence there's no need for the embedded Jetty container).
Has anyone been successful at achieving this? Any help would be appreciated!
UPDATE: I was finally able to accomplish this. Please see my own answer below...
I was finally able to accomplish this by using GWT's DevMode class, as described in the documentation.
In short -
Add your project to IntelliJ 9 Community edition
Add an Application run/debug configuration
Use com.google.gwt.dev.DevMode as your main class (make sure to include gwt-user and gwt-dev jars to the project classpath. See here)
Add the following program parameters:
-noserver -war "[full path to your exploded war]" -gen "[full path to generated files]" -logLevel INFO -port [remote server port] -startupUrl "[URL of the remote page]" [com.company.YourEntryPoint]
This way, the DevMode runner will not instantiate the built in container and will allow your remote server's JavaScript to be debugged in its original Java form.
Note that for builds that don't require debugging remote client code you may use Maven or Ant integration, which is much simpler. I don't have any experience with the webAppCreator generated build.xml, but with Maven you could simply run the gwt:run or gwt:debug goals with this parameter: -DrunTarget=
Hope it helps!
When running a GWT app deployed on a remote server, the client part of your app will have been translated into javascript so I do not think you will be able to debug this from IntelliJ. The server side part of your app will still be Java code. You should be able to start up this remote server with java debugging parameters (things like a transporttype and a port to listen to). From IntelliJ, you should be able to start up a remote debugging session using the same transporttype and port.
If you look into remote debugging, you should be able to find how to do this.