You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Tim Christopher <ti...@gmail.com> on 2005/03/17 16:37:03 UTC

JDBCRealm using iBATIS?

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

Re: OT: Tomcat debugging with Eclipse (Was Re: JDBCRealm using iBATIS?)

Posted by Philippe Laflamme <ph...@mail.mcgill.ca>.
My patch didn't get through... Here it is:

------------- COPY FROM HERE ----------------------
--- startup.bat	2004-10-05 13:27:48.000000000 -0400
+++ debug.bat	2004-12-08 13:46:03.606902000 -0500
@@ -39,6 +39,9 @@
  goto setArgs
  :doneSetArgs

-call "%EXECUTABLE%" start %CMD_LINE_ARGS%
+set JPDA_ADDRESS=8000
+set JPDA_TRANSPORT=dt_socket
+
+call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%

  :end
------------- TO HERE ----------------------



Philippe Laflamme wrote:
> 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 
>> <ma...@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
>>     <ma...@gmail.com>>
>>     *Reply-To: *<ibatis-user-java@incubator.apache.org
>>     <ma...@incubator.apache.org>>
>>     *Date: *Sat, 2 Apr 2005 06:35:53 -0700
>>     *To: *<ibatis-user-java@incubator.apache.org
>>     <ma...@incubator.apache.org>>, Tim Christopher
>>     <tim.christopher@gmail.com <ma...@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 <ma...@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
> 
> 


Re: OT: Tomcat debugging with Eclipse (Was Re: JDBCRealm using iBATIS?)

Posted by NetSQL <ma...@friendVU.com>.
XML Buddy is all you need.
.V

Brandon Goodin wrote:

>My Eclipse rocks!!! But, if you have Intellij I can't imagine that
>they wouldn't have that ability.
>
>Brandon
>  
>


Re: OT: Tomcat debugging with Eclipse (Was Re: JDBCRealm using iBATIS?)

Posted by Lars Fischer <la...@gmail.com>.
IDEA has even more, you can configure this behaviour in the IDE or use the 
method described above.

On Apr 5, 2005 5:48 AM, Brandon Goodin <br...@gmail.com> wrote:
> 
> My Eclipse rocks!!! But, if you have Intellij I can't imagine that
> they wouldn't have that ability.
> 
> Brandon
> 
> On Apr 4, 2005 9:47 PM, Brice Ruth <bd...@gmail.com> wrote:
> > Ah, I guess my Lomboz experience is lacking. I assumed it would be much 
> like
> > MyEclipse, which launches Tomcat (or any other app server) into debug 
> mode
> > automatically.
> >
> >
> > On Apr 4, 2005 10:26 AM, Philippe Laflamme
> > <ph...@mail.mcgill.ca> wrote:
> > >
> > > 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
> > > > <ma...@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
> > > > <ma...@gmail.com>>
> > > > *Reply-To: *<ibatis-user-java@incubator.apache.org
> > > > <ma...@incubator.apache.org>>
> > > > *Date: *Sat, 2 Apr 2005 06:35:53 -0700
> > > > *To: *<ibatis-user-java@incubator.apache.org
> > > > <ma...@incubator.apache.org>>,
> > Tim Christopher
> > > > <tim.christopher@gmail.com <ma...@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 <ma...@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
> > >
> > >
> > > --- startup.bat 2004-10-05 13:27:48.000000000 -0400
> > > +++ debug.bat 2004-12-08 13:46:03.606902000 -0500
> > > @@ -39,6 +39,9 @@
> > > goto setArgs
> > > :doneSetArgs
> > >
> > > -call "%EXECUTABLE%" start %CMD_LINE_ARGS%
> > > +set JPDA_ADDRESS=8000
> > > +set JPDA_TRANSPORT=dt_socket
> > > +
> > > +call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%
> > >
> > > :end
> > >
> > >
> > >
> >
> >
> >
> > --
> >
> > Brice Ruth
> > Software Engineer, Madison WI
>

Re: OT: Tomcat debugging with Eclipse (Was Re: JDBCRealm using iBATIS?)

Posted by Brice Ruth <bd...@gmail.com>.
Yeah, one nice thing I've found come in handy w/ MyEclipse is the ability to 
set breakpoints directly in JSP files ... and then have the IDE map that 
into the compiled JSP files, behind-the-scenes.
 MyEclipse isn't everything and the kitchen sink, but it gets the job done 
well ... at a price that's reasonable ($29.95/yr).


On Apr 4, 2005 10:48 PM, Brandon Goodin <br...@gmail.com> wrote: 
> 
> My Eclipse rocks!!! But, if you have Intellij I can't imagine that
> they wouldn't have that ability.
> 
> Brandon
> 
> On Apr 4, 2005 9:47 PM, Brice Ruth <bd...@gmail.com> wrote:
> > Ah, I guess my Lomboz experience is lacking. I assumed it would be much 
> like
> > MyEclipse, which launches Tomcat (or any other app server) into debug 
> mode
> > automatically.
> >
> >
> > On Apr 4, 2005 10:26 AM, Philippe Laflamme
> > <ph...@mail.mcgill.ca> wrote:
> > >
> > > 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
> > > > <ma...@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
> > > > <ma...@gmail.com>>
> > > > *Reply-To: *<ibatis-user-java@incubator.apache.org
> > > > <ma...@incubator.apache.org>>
> > > > *Date: *Sat, 2 Apr 2005 06:35:53 -0700
> > > > *To: *<ibatis-user-java@incubator.apache.org
> > > > <ma...@incubator.apache.org>>,
> > Tim Christopher
> > > > <tim.christopher@gmail.com <ma...@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 <ma...@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
> > >
> > >
> > > --- startup.bat 2004-10-05 13:27:48.000000000 -0400
> > > +++ debug.bat 2004-12-08 13:46:03.606902000 -0500
> > > @@ -39,6 +39,9 @@
> > > goto setArgs
> > > :doneSetArgs
> > >
> > > -call "%EXECUTABLE%" start %CMD_LINE_ARGS%
> > > +set JPDA_ADDRESS=8000
> > > +set JPDA_TRANSPORT=dt_socket
> > > +
> > > +call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%
> > >
> > > :end
> > >
> > >
> > >
> >
> >
> >
> > --
> >
> > Brice Ruth
> > Software Engineer, Madison WI
> 



-- 
Brice Ruth
Software Engineer, Madison WI

Re: OT: Tomcat debugging with Eclipse (Was Re: JDBCRealm using iBATIS?)

Posted by Brandon Goodin <br...@gmail.com>.
My Eclipse rocks!!! But, if you have Intellij I can't imagine that
they wouldn't have that ability.

Brandon

On Apr 4, 2005 9:47 PM, Brice Ruth <bd...@gmail.com> wrote:
> Ah, I guess my Lomboz experience is lacking. I assumed it would be much like
> MyEclipse, which launches Tomcat (or any other app server) into debug mode
> automatically.
> 
>  
> On Apr 4, 2005 10:26 AM, Philippe Laflamme
> <ph...@mail.mcgill.ca> wrote: 
> > 
> > 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
> > > <ma...@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
> > >     <ma...@gmail.com>>
> > >     *Reply-To: *<ibatis-user-java@incubator.apache.org
> > >     <ma...@incubator.apache.org>>
> > >     *Date: *Sat, 2 Apr 2005 06:35:53 -0700
> > >     *To: *<ibatis-user-java@incubator.apache.org
> > >     <ma...@incubator.apache.org>>,
> Tim Christopher
> > >     <tim.christopher@gmail.com <ma...@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 <ma...@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
> > 
> > 
> > --- startup.bat 2004-10-05 13:27:48.000000000 -0400
> > +++ debug.bat   2004-12-08 13:46:03.606902000 -0500
> > @@ -39,6 +39,9 @@
> > goto setArgs
> > :doneSetArgs
> > 
> > -call "%EXECUTABLE%" start %CMD_LINE_ARGS%
> > +set JPDA_ADDRESS=8000
> > +set JPDA_TRANSPORT=dt_socket
> > +
> > +call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%
> > 
> > :end
> > 
> > 
> > 
> 
> 
> 
> -- 
> 
> Brice Ruth
> Software Engineer, Madison WI

Re: OT: Tomcat debugging with Eclipse (Was Re: JDBCRealm using iBATIS?)

Posted by Brice Ruth <bd...@gmail.com>.
Ah, I guess my Lomboz experience is lacking. I assumed it would be much like 
MyEclipse, which launches Tomcat (or any other app server) into debug mode 
automatically.

On Apr 4, 2005 10:26 AM, Philippe Laflamme <ph...@mail.mcgill.ca> 
wrote: 
> 
> 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
> > <ma...@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
> > <ma...@gmail.com>>
> > *Reply-To: *<ibatis-user-java@incubator.apache.org
> > <ma...@incubator.apache.org>>
> > *Date: *Sat, 2 Apr 2005 06:35:53 -0700
> > *To: *<ibatis-user-java@incubator.apache.org
> > <ma...@incubator.apache.org>>, Tim Christopher
> > <tim.christopher@gmail.com <ma...@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 <ma...@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
> 
> 
> --- startup.bat 2004-10-05 13:27:48.000000000 -0400
> +++ debug.bat 2004-12-08 13:46:03.606902000 -0500
> @@ -39,6 +39,9 @@
> goto setArgs
> :doneSetArgs
> 
> -call "%EXECUTABLE%" start %CMD_LINE_ARGS%
> +set JPDA_ADDRESS=8000
> +set JPDA_TRANSPORT=dt_socket
> +
> +call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%
> 
> :end
> 
> 
> 


-- 
Brice Ruth
Software Engineer, Madison WI

OT: Tomcat debugging with Eclipse (Was Re: JDBCRealm using iBATIS?)

Posted by Philippe Laflamme <ph...@mail.mcgill.ca>.
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 
> <ma...@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
>     <ma...@gmail.com>>
>     *Reply-To: *<ibatis-user-java@incubator.apache.org
>     <ma...@incubator.apache.org>>
>     *Date: *Sat, 2 Apr 2005 06:35:53 -0700
>     *To: *<ibatis-user-java@incubator.apache.org
>     <ma...@incubator.apache.org>>, Tim Christopher
>     <tim.christopher@gmail.com <ma...@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 <ma...@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


Re: JDBCRealm using iBATIS?

Posted by Brice Ruth <bd...@gmail.com>.
Use Eclipse ... then you can use the Lomboz plug-in or the MyEclipse plug-in 
(nominal fee) and you should be golden.

On Apr 2, 2005 10:53 AM, Sasha Borodin <sa...@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 <la...@gmail.com>
> *Reply-To: *<ib...@incubator.apache.org>
> *Date: *Sat, 2 Apr 2005 06:35:53 -0700
> *To: *<ib...@incubator.apache.org>, Tim Christopher <
> 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* <ti...@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

Re: JDBCRealm using iBATIS?

Posted by Sasha Borodin <sa...@whoissasha.com>.
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 <la...@gmail.com>
Reply-To: <ib...@incubator.apache.org>
Date: Sat, 2 Apr 2005 06:35:53 -0700
To: <ib...@incubator.apache.org>, Tim Christopher
<ti...@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 <ti...@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
> 



Re: JDBCRealm using iBATIS?

Posted by Larry Meadors <la...@gmail.com>.
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 <ti...@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
>

Re: JDBCRealm using iBATIS?

Posted by Brice Ruth <bd...@gmail.com>.
Just a thought, use JNDI ... you setup your DataSource once, use it in
your Realm and in iBATIS. That's what we do ...

BR


On Thu, 17 Mar 2005 15:37:03 +0000, Tim Christopher
<ti...@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
>

Re: JDBCRealm using iBATIS?

Posted by Brandon Goodin <br...@gmail.com>.
i don't see why you would need to use ibatis for that. If you wanted
to you could write a Realm implementation that took advantage of
ibatis... but, why?

Brandon


On Thu, 17 Mar 2005 15:37:03 +0000, Tim Christopher
<ti...@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
>