Debugging FuseESB application in Eclipse - eclipse

Fuse ESB uses karaf server with OSGi.
for the code if anybody has steps to get the debugger for the application it will help.
I am currently using Eclipse Indigo.
As OSGi is used we are using Maven to build the same.
Which plugin will help for Karaf with OSGi

Java allows you to remote debug any JVM running.
So if you start the ESB with a debug argument, then it will run in debug mode listening on port 5005.
davsclaus:/opt/fuse-esb-7.0.1.fuse-084$ bin/fuseesb debug
Listening for transport dt_socket at address: 5005
Then you can do remote debugging from Eclipse using that port number. This is standard Java remote debugging, and Eclipse has a wizard for that already. Its the debug wizard which has a remote debug functionality.

You just need to put the following line in the Fuse ESB startup script (e.g. fuseesb.bat or karaf.bat):
set KARAF_DEBUG=true
After that Fuse ESB will start in debug mode using 5005 port.

1) just run $fuse debug (jboss fuse 6.1.0 version) debug port is 5005,
2) in eclipse or jboss dev studio do following
i) run
ii) debug configuration
iii) remote java application -> create new
iv) host: localhost, port : 5005
v) click on debug
3) put breakpoints in java classes

Related

How to debug Spring if project deployed from console to Tomcat server?

I have issue to deploy Spring project directly from Eclipse. It doesn't work if I try run to server option from Eclipse. But same project works fine if I deploy from console to local Tomcat. I would like to debug it by setting break point and also want to see debug output to console as I used many log as logger.info("Listing Walks"); Where is this log if I deploy from console?
on the console in your tomcat folder do
set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket
bin/catalina.bat jpda start
This starts tomcat in debug mode
Then in in eclipse you can create a remote debug profile to attach to the tomcat process on port 8000

Opening multiple servers on the same port

I am really new to web development. I have installed tomcat v7.0 and jboss v4.2 on my windows7 64bit OS. The editor is Eclipse Juno. I start the Tomcat ( within eclipse ), and type the address
http://localhost:8080
It opens me the tomcat welcome page ( the one with the cat ) -- > In IE, Google Chrome.
But the same address opens the Jboss welcome page , when opened in Firefox.
Remember that Jboss is stopped during this whole time.Only tomcat is running
On the same TCP port only one server can listen. Could you write a bit more on your setup? Do you run both tomcat and jboss separately, or you deploy jboss into tomcat? From what you wrote I assume the latter.
Also, are you sure these two pages are on the same url?

Connecting Eclipse to Weblogic server hosted on UNIX machine

I have weblogic installed on a UNIX machine and my source code is in SVN.
I am trying to use the source code in Eclipse and want to know how I can integrate/connect the weblogic server hosted on UNIX machine so that I can develop/modify my application on Windows machine.
Try using remote debugging. There is a question on StackOverflow about it here: Weblogic remote debugging using eclipse.
This is more detail from Oracle:
In the startWebLogic.cmd script, specify the JAVA OPTIONS with:
set JAVA_OPTIONS=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n
The -XDebug parameter enables debugging. The -Xnoagent parameter disables the default sun.tools.debug debug agent. The -Xrunjdwp parameter loads the JPDA reference implementation of JDWP. Debugging is enabled on port 4000. The JDWP protocol is the protocol used to debug with a remote debugger.
Source: Remote Debugging on WebLogic Server
And how to set up the configuration in Eclipse:
Next, configure a debug configuration for the Eclipse project. Select the Debug option in the Debug option list. The Debug frame gets displayed. In the Debug frame select the Remote Java Application node. Right-click on the node and select New. In the Debug configuration frame specify a name for the Debug configuration. Select the project that is to be debugged. Select the EclipseWebLogic project previously created in the Eclipse IDE. Select the default value for Connection Type. In the Connection Properties, specify localhost as the Host and specify the Port as the port that was specified in the startWebLogic batch script of the WebLogic server, [4000]. Click on the Apply button. A remote Java application debug configuration gets added.
Source: Configuring Eclipse for Remote Debugging a WebLogic Java Application

How to debug remote Glassfish web app from Eclipse?

The web app I'm trying to debug only exhibits a bug on a particular Glassfish server, so I want to debug the web app remotely. But the web app was developed in Eclipse for Java SE and I can't see how to do that.
I have:
Installed Eclipse 3.7 for Java EE
Installed the Glassfish adapter
Configured the server for secure login and JPDA debugging
Added the server as a server in Eclipse
However, I do not see "Run on server" or "Debug on server" in the Run menu of Eclipse. If do Debug as, I can create a new Glassfish configuration but I can't select a server, so I can't configure the configuration.
For Glassfish 3:
First enable debugging in the Glassfish administration console
(Application Server -> JVM Settings -> General -> Debug Options)
which require restarting the domain. Make a note of the port number.
Then you can attach to the Glassfish debug port like any other debug session, with a "Remote Java Application" in the debug configurations.

Setting debug configuration for maven+jetty+eclipse

I have created a web app using maven in eclipse. I am using jetty for running the app.
I am able to run the app using the maven jetty plugin. But I am facing difficulty while debugging the app -
The steps that i have followed to setup debug settings are from the below link
http://www.clickonchris.com/2010/05/configuring-jetty-maven-and-eclipse-together-with-hot-deploy/
I can run the app at port 8080 and it keeps on Listening for transport dt_socket at address: 4000. For debugging i have given port 4000. But when i start the debugger in eclipse it gives me a window with following error -
"Failed to connect to remote VM. Connection refused.
Connection refused: connect"
Can some one help me out in resolving this issue for debugging the app.
Thanks!!!
Set MAVEN_OPTS using -
export MAVEN_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
Then start jetty using -
mvn jetty:run
Start remote debugging from your fav IDE on port 8000
Here's a quick workaround. I was battling with this problem also and after a while I achieved a lazy solution.
I use Eclipse Indigo with m2eclipse. I created a new Run Configuration: Right-Clicked the project in Project Explorer -> Run As... -> maven build. Then I defined the necessary maven commands/goals to run the project with jetty straight from Eclipse.
Finally I just ran the newly created configuration in Debug mode and got debug working. This probably messes up something else(?) but works as a quick workaround.
As suggested by h3xstream in one of the comments, you can run using mvnDebug jetty:run.
As mentioned by Pascal Thivent in this answer, since Maven 2.0.8 one can use mvnDebug in the following way:
mvnDebug jetty:run
This will start maven in debugger mode on port 8000.