db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rebels_mascot <bpberming...@gmail.com>
Subject Re: Derby, Java RMI, Tomcat 5 and an annoying classpath
Date Fri, 07 Mar 2008 16:24:48 GMT

Thanks for the replies lads, they were spot on. Unfortunately I only saw them
after painstakingly messing around with the classpath and eventually getting
it when I ran into the problem with the embedded driver which was quickly
sorted thanks to ye :handshake:



rebels_mascot wrote:
> 
> Hi,
> 
> I'm having issues with a classpath. I've made an rmi chat app running on
> tomcat 5. I started using Derby recently but I'm having problems with
> where to place the derby.jar or how to specify the classpath for it.
> 
> I've tried:
> 
> CLASSPATH=.;%DERBY_HOME%\lib\derby.jar
> 
> I also tried putting the derby.jar file in the bin directory of my
> project, i.e. where my class files are, and in commons/lib in tomcat and
> chat/lib (my own folder) but again no luck. I've also tried other options
> of the classpath but nothing.
> 
> The java code for the Class.for... is:
> 
> public static Connection getConnection()
>     {
>         dbURL =
> "jdbc:derby://localhost:1527/dsChatTestDB;create=true;user=admin;password=admin";
>  
>         try
>         {
>            
> Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();*
>  
>             // Get a connection
>             conn = DriverManager.getConnection(dbURL);
>         }
>         catch(ClassNotFoundException cNFEx)
>         { 
>           .....
> 
> 
> I tried out a test app (non rmi or tomcat) in eclipse using the same
> connection strings above and they work fine.
> 
> Can anyone help on where to put the jar file or what classpath to specify.
> Tis wrecking my head :D
> 
> Thanks,
> Brian
> 
> 

-- 
View this message in context: http://www.nabble.com/Derby%2C-Java-RMI%2C-Tomcat-5-and-an-annoying-classpath-tp15891201p15899183.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Mime
View raw message