tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kaarle Kaila <kaarle.ka...@iki.fi>
Subject NamingException in tomcat 4.1.18 LE
Date Sun, 16 Feb 2003 10:09:55 GMT
hi,

I just joined this list but have used tomcat a while now.

I used jakarta-tomcat-4.1.10 until now and changed my server to
jakarta-tomcat-4.1.18-LE-jdk14 and got it running almost OK.

in server.xml I have a Context element like this:

       <Context path="" docBase="/var/www/htdocs" debug="1" 
reloadable="true" >
            <Resource name="jdbc/KalleDB" auth="Container" 
type="javax.sql.DataSource"  description="Kalle database"/>
            <ResourceParams name="jdbc/KalleDB">
              <parameter>
               <name>driverClassName</name>
               <value>com.mysql.jdbc.Driver</value>
             </parameter>

             <parameter>
               <name>url</name>
               <value>jdbc:mysql://localhost/test?user=test</value>
             </parameter>

           </ResourceParams>
         </Context>

With tomcat-1.1.10 it works OK and in Java code I can use

Context initCtx = new InitialContext();
DataSource ds = (DataSource)initCtx.lookup("java:comp/env/jdbc/KalleDB");
Connection conn = ds.getConnection();
to get the connection.

I can use the code also if I get connection from DriverManager
Connection conn = 
DriverManager.getConnection("jdbc:mysql://localhost/test?user=test");


With 4.1.18-LE I get the exception below if I use the initCts.lookup
What is missing in my 4.1.18 or has something changed here?

regards
Kaarle
--------------

javax.naming.NamingException: Cannot create resource instance
         at 
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:189)
         at 
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:834)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
         at org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at fi.iki.kaila.util.SoccerUtil.makeConnection(Unknown Source)


---------------------------------------------
Kaarle Kaila
http://www.iki.fi/kaila
mailto:kaarle.kaila@iki.fi
tel: +358 50 3725844 


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


Mime
View raw message