Re: Tomcat DataSource config issue

Discussion in 'Java' started by Daniel Rohe, Dec 20, 2005.

  1. Daniel Rohe

    Daniel Rohe Guest

    MileHighCelt schrieb:
    > I have been searching and searching for the answer to this, and despite
    > seeing many similar questions, I have yet to find the answer. I have a
    > struts 1.1 application using Tomcat 4.x that I will eventually move to
    > Tomcat 5.0. I have the mysql-connector-java-3.1.10-bin.jar, the 4
    > commons jar files in /$CATALINA_HOME/common/lib.
    >
    > When I try to lookup the DataSource I get the following error:
    >
    >
    > org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver
    > of class '' for connect URL 'null', cause:
    > java.sql.SQLException: No suitable driver
    > at java.sql.DriverManager.getDriver(DriverManager.java:243)
    > ... etc...
    >
    > Here is the serverl.xml:
    > <Resource name="jdbc/jsidb" auth="Container"
    > type="javax.sql.DataSource"
    > maxActive="100" maxIdle="30" maxWait="10000"
    > username="user" password="password"
    > driverClassName="com.mysql.jdbc.Driver"
    >
    > url="jdbc:mysql://127.0.0.1:3306/jsi_db?autoReconnect=true"/>


    You know that resource configuration has changed in Tomcat 5.5 and this
    seems to be a configuration for Tomcat 5.5 and not for Tomcat 4.1 or
    5.0! Look at [1] for a Tomcat 4.1 DataSource configuration.

    [1]
    http://tomcat.apache.org/tomcat-4.1-doc/jndi-datasource-examples-howto.html

    Kind regards,
    Daniel
     
    Daniel Rohe, Dec 20, 2005
    #1
    1. Advertising

  2. Daniel Rohe

    MileHighCelt Guest

    Thank you, I hadn't realized there was a big difference. What I am
    wondering is that because I am deploying to Tomcat/webapps/ROOT is it
    perhaps the context being messed up? I didn't declare a <context>
    around my datasource in the server.xml because that was throwing
    errors. Do you think that could cause a problem?
     
    MileHighCelt, Dec 28, 2005
    #2
    1. Advertising

  3. Daniel Rohe

    MileHighCelt Guest

    Just a follow up for those that are searching for the answer to this.
    In my case, because I was deploying to the ROOT context, I didn't have
    a <context> declaration, which actually works fine until you need the
    JNDI lookup. So, I just created an appropriate <context>
    <resourceparams></resourceparams></context></host> that worked.

    Hope that helps.
     
    MileHighCelt, Jan 13, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ron de Waard
    Replies:
    2
    Views:
    12,679
    HansDampf
    Oct 5, 2007
  2. Replies:
    0
    Views:
    409
  3. elektrophyte
    Replies:
    3
    Views:
    4,997
    Daniel Rohe
    Jan 30, 2005
  4. =?Utf-8?B?R2VvZmZyZXkgQ2FsbGFnaGFu?=

    setting up a web.config file to point to an ODBC datasource

    =?Utf-8?B?R2VvZmZyZXkgQ2FsbGFnaGFu?=, Aug 9, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    417
    =?Utf-8?B?R2VvZmZyZXkgQ2FsbGFnaGFu?=
    Aug 9, 2006
  5. CSharpner
    Replies:
    0
    Views:
    1,141
    CSharpner
    Apr 9, 2007
Loading...

Share This Page