RE: [JBoss-user] development / deployment / debug
I have been debugging code for over twenty years and have always found logging output statements much more useful than interactive debuggers. I think that this is especially true in the EJB environment. What I would suggest is the following: 1. instrument your EJB with log statements with different priorty levels. Select these priority levels to correspond to EJB and third party logging priority levels (INFO, WARN, ERROR, DEBUG are common). 2. instrument you EJB with DEBUG statements that capture state transitions and variable values. 3. use the features of the logging package to "turn off" DEBUG logging in production. Leave the code in the EJB. 4. create your own logging wrapper class that wraps the EJB or third party logging. This makes it easy to change logging packages or shut off logging completely. For instance, the Java compiler will eliminate code that will not be executed. example: private static final boolean DEBUG_ON = false; ... myDebugLogger("entered myBusinessMethod: " + varA + ", " + varB); ... public myDebugLogger(String message) { if (DEBUG_ON) { // log the message using the EJB or third party logger } } The above code would handle debug statements in a production environment with little overhead. I'd suggest looking at the org.jboss.logger package. Also, take a look at the log4j project (http://jakarta.apache.org/log4j/docs/index.html). Theres a good article at the Java Developer's Journal site about log4j (Volume 5, Issue 11). -Original Message- From: Nathan Coast [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 11, 2001 4:34 PM To: [EMAIL PROTECTED] Subject: [JBoss-user] development / deployment / debug Hi, I'm starting developing / deploying with jboss and would like to pick the brains of more experienced jboss users about how to work more efficiently. Debug - I'm using jswat (open source debugger) connecting remotely to jboss to debug servlet / ejb code. This is proving too slow to be practical. I'm using embedded tomcat as the web container and I'm starting the jboss with these flags: java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n org.jboss.Main Is this the most optimal way to debug code? Would different configurations be faster (tomcat in different VM?). Is the debug slow because I'm using jswat - are there other free / open debug tools you'd reccomend? Deployment - This is a bit of a strange one, whenever I make any changes to code, rebuild and redeploy (ear file), the code changes only seem to take effect when I rebuild and redeploy a second time. Any possible reason for this happening or am I just imagining it / messing up deployment somehow? Is it possible to redeploy individual components of an application (ejb jar, war etc) so to not have to do the whole build / deploy process for the ear file? Thanks Nathan ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] development / deployment / debug
Thanks Scott, unfortunately - see below. Guess there's something wrong with my jre setup. Any ideas? according to the jdk1.3 tools docs the classic flag is fine. F:\jboss-2.1\binrun Unrecognized option: -classic Could not create the Java virtual machine. Press any key to continue . . . F:\jboss-2.1\binjava -version java version "1.3.0" Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C) Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode) Scott M Stark wrote: Debug - I'm using jswat (open source debugger) connecting remotely to jboss to debug servlet / ejb code. This is proving too slow to be practical. I'm using embedded tomcat as the web container and I'm starting the jboss with these flags: java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n org.jboss.Main Is this the most optimal way to debug code? Would different configurations be faster (tomcat in different VM?). Is the debug slow because I'm using jswat - are there other free / open debug tools you'd reccomend? Use: java -classic -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n org.jboss.Main to disable HotSpot and use the JIT instead. HotSpot is terribly slow when debugging for some reason. ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] development / deployment / debug
Resolution: change the jdk/jre/lib/jvm.cfg from -hotspot -server -classic to -classic -hotspot -server forces the classic jvm to be loaded first then start jboss with: java -Xbootclasspath:mypath\jdk1.3\lib\tools.jar;mypath\jdk1.3\jre\lib\rt.jar %JAXP% -classpath "%CLASSPATH%" -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n org.jboss.Main %1 %2 %3 %4 %5 %6 %7 %8 %9 And yes, after all this, the jswat does run faster. Nathan Coast wrote: Thanks Scott, unfortunately - see below. Guess there's something wrong with my jre setup. Any ideas? according to the jdk1.3 tools docs the classic flag is fine. F:\jboss-2.1\binrun Unrecognized option: -classic Could not create the Java virtual machine. Press any key to continue . . . F:\jboss-2.1\binjava -version java version "1.3.0" Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C) Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode) Scott M Stark wrote: Debug - I'm using jswat (open source debugger) connecting remotely to jboss to debug servlet / ejb code. This is proving too slow to be practical. I'm using embedded tomcat as the web container and I'm starting the jboss with these flags: java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n org.jboss.Main Is this the most optimal way to debug code? Would different configurations be faster (tomcat in different VM?). Is the debug slow because I'm using jswat - are there other free / open debug tools you'd reccomend? Use: java -classic -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n org.jboss.Main to disable HotSpot and use the JIT instead. HotSpot is terribly slow when debugging for some reason. ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user