You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sasha Borodin <sa...@whoissasha.com> on 2005/04/01 21:57:45 UTC

Debugging tomcat startup

I'd like to solicit suggestions for debugging Tomcat startup - specifically
various class initializations.

I've written a custom Realm implementation; in it, I use some data access
classes which use iBatis; these classes work great when used in a web
application (all jars residing in the apps WEB-INF/lib); but I'm getting
errors when these classes are initialized from jars in the server/lib
directory at startup.

If you have suggestions for how to debug the startup, especially from an IDE
like Idea, please post.  Also, if there are guidelines for where to place
certain types of jars (common vs. server), please post a link.  Right now
I've got my jdbc jars in common/lib, and my custom Realm and data access
classes (including ibatis related jars) in server/lib.

Thanks for your help,

-Sasha Borodin



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Debugging tomcat startup

Posted by Larry Meadors <la...@gmail.com>.
Hey Sasha, I have been wanting to do an iBATIS realm for a while. Glad to 
see I am not alone. ;-)

You have a couple of options.

I use IDEA, and run tomcat externally. When I want to debug startup code, I 
set JPDA_OPTS (in setenv.sh/bat) to this:

JPDA_OPTS="-Xdebug 
-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"

Most of that is already there (in tomcat 5.0.27 line 141 of catalina.sh), 
and tells the JVM to start the debugger in server mode using sockets, to 
listen on address 8000, and to suspend immediately, until a debugger 
attaches.

Then, set your breakpoints, and start tomcat using this:

$CATALINA_HOME/bin/catalina.sh jpda start

Once it starts, you can attach, and debug everything starting at the 
beginning.

Java rocks! :-D

Larry

On Apr 1, 2005 12:57 PM, Sasha Borodin <sa...@whoissasha.com> wrote:
> 
> I'd like to solicit suggestions for debugging Tomcat startup - 
> specifically
> various class initializations.
> 
> I've written a custom Realm implementation; in it, I use some data access
> classes which use iBatis; these classes work great when used in a web
> application (all jars residing in the apps WEB-INF/lib); but I'm getting
> errors when these classes are initialized from jars in the server/lib
> directory at startup.
> 
> If you have suggestions for how to debug the startup, especially from an 
> IDE
> like Idea, please post. Also, if there are guidelines for where to place
> certain types of jars (common vs. server), please post a link. Right now
> I've got my jdbc jars in common/lib, and my custom Realm and data access
> classes (including ibatis related jars) in server/lib.
> 
> Thanks for your help,
> 
> -Sasha Borodin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
>

Re: Debugging tomcat startup

Posted by Larry Meadors <la...@gmail.com>.
Realm implementations should go into server/lib.

On Apr 2, 2005 12:16 AM, Anto Paul <an...@gmail.com> wrote:
> 
> On Apr 2, 2005 1:27 AM, Sasha Borodin <sa...@whoissasha.com> wrote:
> 
> What is the motive to place jars in server/lib. These jars are not
> visible to applications.
>

Re: Debugging tomcat startup

Posted by Anto Paul <an...@gmail.com>.
On Apr 2, 2005 1:27 AM, Sasha Borodin <sa...@whoissasha.com> wrote:
> I'd like to solicit suggestions for debugging Tomcat startup - specifically
> various class initializations.
> 
> I've written a custom Realm implementation; in it, I use some data access
> classes which use iBatis; these classes work great when used in a web
> application (all jars residing in the apps WEB-INF/lib); but I'm getting
> errors when these classes are initialized from jars in the server/lib
> directory at startup.
> 
> If you have suggestions for how to debug the startup, especially from an IDE
> like Idea, please post.  Also, if there are guidelines for where to place
> certain types of jars (common vs. server), please post a link.  Right now
> I've got my jdbc jars in common/lib, and my custom Realm and data access
> classes (including ibatis related jars) in server/lib.
> 
> Thanks for your help,
> 
> -Sasha Borodin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 

Read the classloader docs.
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/class-loader-howto.html

What is the motive to place jars in server/lib. These jars are not
visible to applications.

-- 
Anto Paul
Benchmark Softech
www.benchmarksoft.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org