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

Reply via email to