ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philippe Laflamme <philippe.lafla...@mail.mcgill.ca>
Subject OT: Tomcat debugging with Eclipse (Was Re: JDBCRealm using iBATIS?)
Date Mon, 04 Apr 2005 15:26:53 GMT
Brice Ruth wrote:
> Use Eclipse ... then you can use the Lomboz plug-in or the MyEclipse 
> plug-in (nominal fee) and you should be golden.

Use Eclipse yes, but Lomboz plug-in, no.

The last time I used it, it was such a pain to install, setup and 
maintain, that I simply gave up. Besides, it doesn't do anything that 
can't be done with a plain Eclipse setup (for debugging purposes)...

What you need to do is start your Tomcat VM with JPDA enabled (Java 
Platform Debugger Architecture). This is already available in the 
Catalina startup scripts: jpda start instead of start. I've created a 
modified version of the startup.bat script that I call debug.bat. It 
sets the port and type of JPDA to enable and calls catalia.bat with 
debugging enabled. I've attached a patch so you can see what I've 
modified...

In your Eclipse project, you setup a "Remote Java Application" debug 
target. Make it point to your Tomcat server and the JPDA port (8000 in 
my case). This is a major advantage over Lomboz: it allows you to debug 
a Tomcat instance that isn't running on localhost.

To start a debug session, start Tomcat with the proper script, start 
your debugging target in Eclipse, set a few breakpoints (in Tomcat 
source, iBatis source, your code, etc.) and voilĂ , you're ready to try 
to login... If you need to debug Tomcat's startup procedure, you can 
always suspend the VM before Tomcat's main method is called: look at the 
catalina script for the suspend=n flag and set it to suspend=y.

If you're not familiar with Eclipse, you'll to read on how to attach 
source code to runtime jars in a debugging target... Otherwise, you 
won't be able to debug as efficiently as you'll want.

Hope this helps,
Philippe

> On Apr 2, 2005 10:53 AM, *Sasha Borodin* <sasha@whoissasha.com 
> <mailto:sasha@whoissasha.com>> wrote:
> 
>     I'm trying to get iBatis classes to initialize in a modified
>     JDBCRealm... Right now I'm having issues.  There's a
>     ClassCastException thrown on Tomcat startup (when the realm classes
>     are initialized).  I've placed all 3 iBatis jars, and various
>     combinations of supporting jars in server/lib, so far with no luck.
>      Brandon mentioned debugging the tomcat startup in an IDE; I'm
>     trying to figure out how to do that right now.
> 
>     I'll post and let you know my results.  In the mean time, try it ;-)
>      I am trying to use a data source of type "DBCP" in my
>     sql-map-config.xml; it's the instantiation of this class that throws
>     errors right now.  Maybe try using another data source and let us
>     know how it works.
> 
>     Thanks,
> 
>     -Sasha Borodin
> 
> 
>     ------------------------------------------------------------------------
>     *From: *Larry Meadors <larry.meadors@gmail.com
>     <mailto:larry.meadors@gmail.com>>
>     *Reply-To: *<ibatis-user-java@incubator.apache.org
>     <mailto:ibatis-user-java@incubator.apache.org>>
>     *Date: *Sat, 2 Apr 2005 06:35:53 -0700
>     *To: *<ibatis-user-java@incubator.apache.org
>     <mailto:ibatis-user-java@incubator.apache.org>>, Tim Christopher
>     <tim.christopher@gmail.com <mailto:tim.christopher@gmail.com>>
>     *Subject: *Re: JDBCRealm using iBATIS?
> 
>     Sasha Borodin(maybe?) mentioned working on an iBATIS realm for
>     tomcat on the tomcat-users list. You may want to check that out.
> 
>     Larry
> 
>     On Mar 17, 2005 8:37 AM, *Tim Christopher*
>     <tim.christopher@gmail.com <mailto:tim.christopher@gmail.com>> wrote:
> 
>         Hi,
> 
>         Can anyone let me know if it is possible to use iBATIS for
>         implementing JDBCRealm, or do I have to access the database
>         directly?
> 
>         I've looked on Google and in the Developer Notes for iBATIS and have
>         found nothing on this topic.
> 
>         Any help would be much appreciated.
> 
>         Tim Christopher
> 
> 
> 
> 
> 
> -- 
> Brice Ruth
> Software Engineer, Madison WI


Mime
View raw message