Hi Gana,

Have you checked file permissions on derby.jar to make sure it is readable by whomever user that is launching tomcat?

Also, you could test with putting the jars under tomcat/lib


On Mon, Sep 21, 2009 at 6:48 AM, gana prasad <gana.mnvs@gmail.com> wrote:
I am facing the problems while accessing the database jar file using derby
I am getting the Exception as below:

" org.apache.tomcat.dbcp.dbcp.SQLNestedException

: Cannot load JDBC driver class 'org.apache.derby.jdbc.EmbeddedDriver'

at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(


at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(

BasicDataSource.java:880)  "


My configuration as shown below:



Context crossContext="true">

       <Resource name="jdbc/derby" auth="Container"

        type="javax.sql.DataSource" driverClassName="org.apache.derby.jdbc.EmbeddedDriver"


        username="xxx" password="xxx" maxActive="20" maxIdle="10"





And in my code i am accessing the database like this:

                  Context initContext = new InitialContext();

                  Context envContext = (Context)initContext.lookup("java:/comp/env");

                  DataSource ds = (DataSource)envContext.lookup("jdbc/derby");

                  conn = ds.getConnection();

And i have placed the derby jar file in tomcat/common/lib  directory. And database.jar file in my local directory.


What could be the reason for this ? Is there any problem with my configuration.?


Please help me in this regard,


Thanks in Advance,