RE: DriverclassName is required (mysql)

2003-04-01 Thread Mark.Gargan
Hi Folks,
I was using the Tomcat within the Java WebServices Development
Pack from Sun. I promptly got rid of it cos I like my dos output. 

Now instead of getting the error that the driverClassName is required,
now Tomcat says that it cannot load JDBC class null. This would be fair
enough only I've set the driverClassName property in the server.xml that
describes the datasource to be the org.gjt.mm.mysql.Driver class. It
looks like the name of the parameter that tells the the connection
factory which datasource to use is different to 'driverClassName'. Could
this have changed?

Thanks,
Mark.



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 01 April 2003 16:51
To: [EMAIL PROTECTED]
Subject: DriverclassName is required (mysql)

Hi Folks,
I'm trying to install jUDDI in my tomcat installation.
The installation is from the java webservices pack from the sun site. 
I'm trying to setup mysql as the underlying database for the UDDI
Registry.
 
I've inserted the following context into the server.xml as instructed in
the JNDI howto Datasources guide.
 


   
 
   
 
   
  
 factory
 
 
org.apache.commons.dbcp.BasicDataSourceFactory
  
 

  
 maxActive
 
 100
  
 

  
 maxIdle
 
 30
  
 

 
  
 maxWait
 
 1
  
 


  
 username
 
 javauser
  
 
  
 password
 
 javadude
  
 


  
 driverClassName
 
 org.gjt.mm.mysql.Driver
  
 

  
 url
 
 
jdbc:mysql://localhost:3306/javatest?autoReconnect=true
  
   
 
 
Unfortunately when I go to call the test.jsp which in turn makes a call
to the init method in the foo class :-
 
public void init() {
try{
  Context ctx = new InitialContext();
  if(ctx == null ) 
  throw new Exception("Boom - No Context");
 
  DataSource ds = 
(DataSource)ctx.lookup(
   "java:comp/env/jdbc/TestDB");
 
  if (ds != null) {
Connection conn = ds.getConnection();
  
if(conn != null)  {
foo = "Got Connection "+conn.toString();
Statement stmt = conn.createStatement();
ResultSet rst = 
stmt.executeQuery(
  "select id, foo, bar from testdata");
if(rst.next()) {
   foo=rst.getString(2);
   bar=rst.getInt(3);
}
conn.close();
}
  }
}catch(Exception e) {
  e.printStackTrace();
}
}
 
it begins to resolve the DataSource and then throws the following
exception..
 
javax.naming.NamingException: DbcpDataSourceFactory:  driverClassName is
required
  at
org.apache.naming.factory.DbcpDataSourceFactory.getObjectInstance(DbcpDa
taSourceFactory.java:199)
  at
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFact
ory.java:177)
  at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:835)
  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 foo.DBTest.init(DBTest.java:26)
 
 
I can't really tell what the problem is as the driverClassName seems to
be defined in the xml.
The mysql-connector-java-2.0.14-bin.jar is placed in
${CATALINA.HOME}/common/lib so the classes are available? 
 
Anyone got any ideas? This is me falling

DriverclassName is required (mysql)

2003-04-01 Thread Mark.Gargan
Hi Folks,
I'm trying to install jUDDI in my tomcat installation.
The installation is from the java webservices pack from the sun site. 
I'm trying to setup mysql as the underlying database for the UDDI
Registry.
 
I've inserted the following context into the server.xml as instructed in
the JNDI howto Datasources guide.
 


   
 
   
 
   
  
 factory
 
 
org.apache.commons.dbcp.BasicDataSourceFactory
  
 

  
 maxActive
 
 100
  
 

  
 maxIdle
 
 30
  
 

 
  
 maxWait
 
 1
  
 


  
 username
 
 javauser
  
 
  
 password
 
 javadude
  
 


  
 driverClassName
 
 org.gjt.mm.mysql.Driver
  
 

  
 url
 
 
jdbc:mysql://localhost:3306/javatest?autoReconnect=true
  
   
 
 
Unfortunately when I go to call the test.jsp which in turn makes a call
to the init method in the foo class :-
 
public void init() {
try{
  Context ctx = new InitialContext();
  if(ctx == null ) 
  throw new Exception("Boom - No Context");
 
  DataSource ds = 
(DataSource)ctx.lookup(
   "java:comp/env/jdbc/TestDB");
 
  if (ds != null) {
Connection conn = ds.getConnection();
  
if(conn != null)  {
foo = "Got Connection "+conn.toString();
Statement stmt = conn.createStatement();
ResultSet rst = 
stmt.executeQuery(
  "select id, foo, bar from testdata");
if(rst.next()) {
   foo=rst.getString(2);
   bar=rst.getInt(3);
}
conn.close();
}
  }
}catch(Exception e) {
  e.printStackTrace();
}
}
 
it begins to resolve the DataSource and then throws the following
exception..
 
javax.naming.NamingException: DbcpDataSourceFactory:  driverClassName is
required
  at
org.apache.naming.factory.DbcpDataSourceFactory.getObjectInstance(DbcpDa
taSourceFactory.java:199)
  at
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFact
ory.java:177)
  at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:835)
  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 foo.DBTest.init(DBTest.java:26)
 
 
I can't really tell what the problem is as the driverClassName seems to
be defined in the xml.
The mysql-connector-java-2.0.14-bin.jar is placed in
${CATALINA.HOME}/common/lib so the classes are available? 
 
Anyone got any ideas? This is me falling at the first hurdle here.
Doesn't bode well for me at all. 
 
Thanks,
Mark.