You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Prashanth Aditya Susarla <pr...@gmail.com> on 2008/10/03 15:06:45 UTC

'Driver not found' error while trying to run Derby on an Arcom Zeus box

Hello,

I am Prashanth Susarla and am (very) new to Derby.

A couple of days back I tried running Derby on an Arcom Zeus-based
box (http://www.arcom.com/pxa270-xscale-zeus.htm), which comes
bundled with a version of IBM's J9 JVM (please excuse me for not
snipping off the copyright text) -

<SNIP>
# j9 -jcl:max -version
java version "1.4.2 subset"
IBM J9 2.3 Linux arm-32  (JIT disabled)
J9VM - 20070723_00000_lHdFGR
JIT  - 20070220_1806_r8
GC   - 20070208_AA
JCL  - 20070313_1930,max

Licensed Materials - Property of IBM

J9 - VM for the Java(TM) platform, Version 2.3
(c) Copyright IBM Corp. 1991, 2007  All Rights Reserved
Target: 20070723_00000_lHdFGR (Linux 2.6.16.28-arcom2-1-zeus arm)
JIT  - 20070220_1806_r8

IBM is a registered trademark of IBM Corp.
Java and all Java-based marks and logos are trademarks or registered
trademarks of Sun Microsystems, Inc.
</SNIP>

I followed the documentation and steps outlined to install Derby on such
platforms, here -

http://wiki.apache.org/db-derby/JavaMESupport#j9

FWIW, the link on that page pointing to IBM's own test results of running
Derby on their J9 is broken.

The problem I face is that in spite of setting the CLASSPATH correctly
and using the reference implementation of the JSR169 spec I get an error
saying that the JDBC driver is not found.

I have database_enabler.jar with me, and additionally I compiled the
JSR169 (for CDC 1.0) sources
(http://java.sun.com/products/jdbc/download.html#cdcfp) into a jar
(that's the jsr169.jar you will see in the command snippets below).

http://wiki.apache.org/db-derby/JavaMESupport#requirements says that
the latest releases of Derby require CDC 1.1, but I thought I'll give the
CDC 1.0 sources a try.

I have only tried using the embedded JDBC driver, and not the client JDBC
driver. I think that the client-server model doesn't make sense (from a
resource usage standpoint) for the way I want to use Derby with my project.

First of all, I got hold of Derby 10.4.2.0 as that's the latest version. Then I
tried running sysinfo and ij, with the following results -

Derby 10.4 sysinfo with database_enabler.jar
============================================
<SNIP>
# j9 -jcl:max -Xbootclasspath/a:$DERBY_INSTALL/lib/database_enabler.jar
org.apache.derby.tools.sysinfo
------------------ Java Information ------------------
Java Version:    1.4.2 subset
Java Vendor:     IBM Corporation
Java home:       /opt/wece6.1
Java classpath:
/opt/Apache/db-derby-10.4.2.0-lib/lib/derby.jar:/opt/Apache/db-derby-10.4.2.0-lib/lib/derbytools.jar:.
OS name:         Linux
OS architecture: arm
OS version:      2.6.16.28-arcom2-1-zeus
Java user name:  root
Java user home:  /root
Java user dir:   /opt/Apache
java.specification.name: Java Platform API Specification
java.specification.version: 1.4
--------- Derby Information --------
JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
[/opt/Apache/db-derby-10.4.2.0-lib/lib/derby.jar] 10.4.2.0 - (689064)
[/opt/Apache/db-derby-10.4.2.0-lib/lib/derbytools.jar] 10.4.2.0 - (689064)
------------------------------------------------------
</SNIP>

Derby 10.4 ij with database_enabler.jar
=======================================
<SNIP>
# j9 -jcl:max -Xbootclasspath/a:$DERBY_INSTALL/lib/database_enabler.jar
org.apache.derby.tools.ij
ij> version 10.4
ij> connect 'jdbc:derby:MyDbTest;create=true';
ERROR (no SQLState): Driver not found: jdbc:derby:MyDbTest;create=true
</SNIP>

Derby 10.4 sysinfo with jsr169.jar
==================================
Same as above.

Derby 10.4 ij with jsr169.jar
=============================
<SNIP>
# j9 -jcl:max -Xbootclasspath/a:$DERBY_INSTALL/lib/jsr169.jar
org.apache.derby.tools.ij
ij> version 10.4
ij> connect 'jdbc:derby:MyDbTest;create=true';
JAVA ERROR: java.lang.NoClassDefFoundError: java.sql.Driver
</SNIP>

Derby 10.4 sysinfo with both jars
=================================
Same as above.

Derby 10.4 ij with both jars
============================
<SNIP>
# j9 -jcl:max -Xbootclasspath/a:$DERBY_INSTALL/lib/jsr169.jar:$DERBY_INSTALL/lib/database_enabler.jar
org.apache.derby.tools.ij
ij> version 10.4
ij> connect 'jdbc:derby:MyDbTest;create=true';
ERROR (no SQLState): Driver not found: jdbc:derby:MyDbTest;create=true
</SNIP>

As I wasn't able to create a DB with derby 10.4 using either jsr169.jar or
database_enabler.jar, I decided to try out derby 10.2 (from the requirements
section you can make out that derby 10.2 should work with JSR169
sources for CDC 1.0 -

Derby 10.2 sysinfo with database_enabler.jar
============================================
<SNIP>
# j9 -jcl:max -Xbootclasspath/a:$DERBY_INSTALL/lib/database_enabler.jar
org.apache.derby.tools.sysinfo
------------------ Java Information ------------------
Java Version:    1.4.2 subset
Java Vendor:     IBM Corporation
Java home:       /opt/wece6.1
Java classpath:
/opt/Apache/db-derby-10.2.2.0-lib/lib/derby.jar:/opt/Apache/db-derby-10.2.2.0-lib/lib/derbytools.jar:.
OS name:         Linux
OS architecture: arm
OS version:      2.6.16.28-arcom2-1-zeus
Java user name:  root
Java user home:  /root
Java user dir:   /opt/Apache
java.specification.name: Java Platform API Specification
java.specification.version: 1.4
--------- Derby Information --------
JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
[/opt/Apache/db-derby-10.2.2.0-lib/lib/derby.jar] 10.2.2.0 - (485682)
[/opt/Apache/db-derby-10.2.2.0-lib/lib/derbytools.jar] 10.2.2.0 - (485682)
------------------------------------------------------
</SNIP>

Derby 10.2 ij with database_enabler.jar
=======================================
<SNIP>
# j9 -jcl:max -Xbootclasspath/a:$DERBY_INSTALL/lib/database_enabler.jar
org.apache.derby.tools.ij
ij> version 10.2
ij> connect 'jdbc:derby:MyDbTest;create=true';
JAVA ERROR: java.lang.NoClassDefFoundError: java.sql.Savepoint
</SNIP>

Derby 10.2 sysinfo with jsr169.jar
==================================
Same as above.

Derby 10.2 ij with jsr169.jar
=============================
<SNIP>
# j9 -jcl:max -Xbootclasspath/a:$DERBY_INSTALL/lib/jsr169.jar
org.apache.derby.tools.ij
ij> version 10.2
ij> connect 'jdbc:derby:MyDbTest;create=true';
JAVA ERROR: java.lang.NoClassDefFoundError: java.sql.Driver
</SNIP>

Derby 10.2 sysinfo with both jars
=================================
Same as above.

Derby 10.2 ij with both jars
============================
<SNIP>
# j9 -jcl:max -Xbootclasspath/a:$DERBY_INSTALL/lib/jsr169.jar:$DERBY_INSTALL/lib/database_enabler.jar
org.apache.derby.tools.ij
ij> version 10.2
ij> connect 'jdbc:derby:MyDbTest;create=true';
ERROR (no SQLState): Driver not found: jdbc:derby:MyDbTest;create=true
</SNIP>

Here are the contents of 'derby.log' from two of the few situations
outlined above -

derby.log with 10.4.2.0 and database_enabler.jar
=========================================
<SNIP>
2000-04-10 23:39:09.590 GMT Thread[main,5,main] Class
org.apache.derby.jdbc.Driver30 java.lang.NoClassDefFoundError:
javax.naming.Referenceable, module ignored.
2000-04-10 23:39:09.600 GMT Thread[main,5,main]
2000-04-10 23:39:09.683 GMT Thread[main,5,main] Cleanup action starting
ERROR XBM02: Startup failed due to missing functionality for
org.apache.derby.jdbc.InternalDriver. Please ensure your classpath
includes the correct Derby software.
	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.missingImplementation(Unknown
Source)
	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown
Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startServices(Unknown
Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(Unknown
Source)
	at org.apache.derby.impl.services.monitor.FileMonitor.<init>(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Unknown Source)
	at org.apache.derby.iapi.jdbc.JDBCBoot.boot(Unknown Source)
	at org.apache.derby.jdbc.EmbeddedDriver.boot(Unknown Source)
	at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(Unknown Source)
	at java.lang.J9VMInternals.initializeImpl(Native Method)
	at java.lang.J9VMInternals.initialize(J9VMInternals.java:187)
	at java.lang.Class.forNameImpl(Native Method)
	at java.lang.Class.forName(Class.java:114)
	at org.apache.derby.impl.tools.ij.util.loadDriver(Unknown Source)
	at org.apache.derby.impl.tools.ij.util.loadDriverIfKnown(Unknown Source)
	at org.apache.derby.impl.tools.ij.ij.dynamicConnection(Unknown Source)
	at org.apache.derby.impl.tools.ij.ij.ConnectStatement(Unknown Source)
	at org.apache.derby.impl.tools.ij.ij.ijStatement(Unknown Source)
	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(Unknown Source)
	at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main.main(Unknown Source)
	at org.apache.derby.tools.ij.main(Unknown Source)
Cleanup action completed
2000-04-10 23:39:09.728 GMT Thread[main,5,main] 2000-04-10
23:39:09.724 GMT Thread[main,5,main] Startup failed due to missing
functionality for org.apache.derby.jdbc.InternalDriver. Please ensure
your classpath includes the correct Derby software.
ERROR XBM02: Startup failed due to missing functionality for
org.apache.derby.jdbc.InternalDriver. Please ensure your classpath
includes the correct Derby software.
	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.missingImplementation(Unknown
Source)
	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown
Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startServices(Unknown
Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(Unknown
Source)
	at org.apache.derby.impl.services.monitor.FileMonitor.<init>(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Unknown Source)
	at org.apache.derby.iapi.jdbc.JDBCBoot.boot(Unknown Source)
	at org.apache.derby.jdbc.EmbeddedDriver.boot(Unknown Source)
	at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(Unknown Source)
	at java.lang.J9VMInternals.initializeImpl(Native Method)
	at java.lang.J9VMInternals.initialize(J9VMInternals.java:187)
	at java.lang.Class.forNameImpl(Native Method)
	at java.lang.Class.forName(Class.java:114)
	at org.apache.derby.impl.tools.ij.util.loadDriver(Unknown Source)
	at org.apache.derby.impl.tools.ij.util.loadDriverIfKnown(Unknown Source)
	at org.apache.derby.impl.tools.ij.ij.dynamicConnection(Unknown Source)
	at org.apache.derby.impl.tools.ij.ij.ConnectStatement(Unknown Source)
	at org.apache.derby.impl.tools.ij.ij.ijStatement(Unknown Source)
	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(Unknown Source)
	at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main.main(Unknown Source)
	at org.apache.derby.tools.ij.main(Unknown Source)
</SNIP>

derby.log with 10.2.2.0 with both database_enabler.jar and jsr169.jar
==========================================================
<SNIP>
2000-04-11 00:51:08.216 GMT:
Shutting down instance c013800d-00de-7320-c6fa-000000846580
----------------------------------------------------------------
2000-04-11 00:51:08.291 GMT Thread[main,5,main] Cleanup action starting
ERROR XBM01: Startup failed due to an exception. See next exception
for details.
	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.exceptionStartingModule(Unknown
Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown
Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(Unknown
Source)
	at org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Unknown
Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
	at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Unknown Source)
	at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
	at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
	at java.sql.DriverManager.getConnection(DriverManager.java:124)
	at java.sql.DriverManager.getConnection(DriverManager.java:57)
	at org.apache.derby.impl.tools.ij.ij.dynamicConnection(Unknown Source)
	at org.apache.derby.impl.tools.ij.ij.ConnectStatement(Unknown Source)
	at org.apache.derby.impl.tools.ij.ij.ijStatement(Unknown Source)
	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(Unknown Source)
	at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
	at org.apache.derby.tools.ij.main(Unknown Source)
============= begin nested exception, level (1) ===========
java.lang.NoClassDefFoundError: java.nio.channels.ClosedChannelException
	at java.lang.J9VMInternals.verifyImpl(Native Method)
	at java.lang.J9VMInternals.verify(J9VMInternals.java:63)
	at java.lang.J9VMInternals.initialize(J9VMInternals.java:124)
	at org.apache.derby.impl.io.DirFile4.getRandomAccessFile(Unknown Source)
	at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.privGetJBMSLockOnDB(Unknown
Source)
	at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.run(Unknown Source)
	at java.security.AccessController.doPrivileged(AccessController.java:242)
	at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.getJBMSLockOnDB(Unknown
Source)
	at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.boot(Unknown
Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown
Source)
	at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown
Source)
	at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown
Source)
	at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown
Source)
	at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown
Source)
	at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown
Source)
	at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source)
	at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown
Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(Unknown
Source)
	at org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Unknown
Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
	at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Unknown Source)
	at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
	at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
	at java.sql.DriverManager.getConnection(DriverManager.java:124)
	at java.sql.DriverManager.getConnection(DriverManager.java:57)
	at org.apache.derby.impl.tools.ij.ij.dynamicConnection(Unknown Source)
	at org.apache.derby.impl.tools.ij.ij.ConnectStatement(Unknown Source)
	at org.apache.derby.impl.tools.ij.ij.ijStatement(Unknown Source)
	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(Unknown Source)
	at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
	at org.apache.derby.tools.ij.main(Unknown Source)
============= end nested exception, level (1) ===========
Cleanup action completed
</SNIP>

I think I'm missing a JSR169 (CDC 1.1) implementation that works with
IBM's custom J9 VM, and have found references being made to such a jar
at various forums online when I turned to Google for help. Unfortunately,
none of those posts mentions anything other than IBM's WCTME 5.7 as
a source for that jar, and WCTME is paid software for which I have no other
use and hence am uninterested in purchasing.

Does any one here have any idea -
a.) where I may find JSR169 implementation that meets my needs,
assuming that *is* my problem, and
b.) in case that is not my problem, where should I be looking instead?

Thanks a lot for your time (and patience, this was a really long mail!).

Best regards,
Prashanth

-- 
Radioactive cats have 18 half-lives.
                            -- Anonymous
http://padbyappu.blogspot.com
http://www.flickr.com/photos/spadix
http://notaweblog.blogspot.com

Re: 'Driver not found' error while trying to run Derby on an Arcom Zeus box

Posted by Prashanth Aditya Susarla <pr...@gmail.com>.
> I think I'm missing a JSR169 (CDC 1.1) implementation that works with
> IBM's custom J9 VM, and have found references being made to such a jar
> at various forums online when I turned to Google for help. Unfortunately,
> none of those posts mentions anything other than IBM's WCTME 5.7 as
> a source for that jar, and WCTME is paid software for which I have no other
> use and hence am uninterested in purchasing.

Problem solved! The command which causes everything to run perfectly is as
follows -

<SNIP>
# j9 -Djava.specification.name="J2ME" -Djava.specification.version=1.3
-jcl:max -Xbootclasspath/a:jsr169.jar:database_enabler.jar:derby.jar
</SNIP>

There were basically 2 problems here.

One was that the embedded (in derby.jar) driver was not being recognized despite
it being available in the classpath. The solution was to add derby.jar
also in the
bootclasspath.

Secondly, the J9 JVM that is in use in the Arcom Zeus box that I am
working on, is
recognized as a J2SE JVM. So I have to fool derby into thinking it is
running instead
on a J2ME spec JVM instead. This information was clear only after
looking at this
bit of code in JVMInfo.java (please excuse the formatting) -

<SNIP>
          try {
               javaSpec = System.getProperty("java.specification.name");
          } catch (SecurityException se) {
               // some vms do not know about this property so they
               // throw a security exception when access is restricted.
               javaSpec = null;
          }

          try {
               javaVersion =
System.getProperty("java.specification.version", "1.4");

          } catch (SecurityException se) {
               // some vms do not know about this property so they
               // throw a security exception when access is restricted.
               javaVersion = "1.4";
          }

          if (javaSpec != null &&
            (
             javaSpec.startsWith("J2ME") || // recognize IBM WCTME
             (
              (javaSpec.indexOf( "Profile" ) > -1) && // recognize phoneME
              (javaSpec.indexOf( "Specification" ) > -1)
             )
            )
          )
</SNIP>

So now I've got a working standalone ij. Now I've got to figure out how to call
derby from within my project code, because the project code doesn't require
the JVM to be invoked with these java specification name/version values. I'll
have to test that everything else (in my project) works with these
flags enabled.

Thanks a lot everybody for your time! I hope all of this helps someone else.

Best regards,
Prashanth

-- 
Radioactive cats have 18 half-lives.
                                 -- Anonymous
http://padbyappu.blogspot.com
http://www.flickr.com/photos/spadix
http://notaweblog.blogspot.com

Re: 'Driver not found' error while trying to run Derby on an Arcom Zeus box

Posted by Prashanth Aditya Susarla <pr...@gmail.com>.
Knut,

> I haven't tried this myself, but I think you may need to give this
> argument to j9 for ij to know how to create a connection (this is
> different in JSR-169 and in JDBC):
>
>  -Dij.dataSource=org.apache.derby.jdbc.EmbeddedSimpleDataSource
>
> And when you get to the ij prompt, skip the "jdbc:derby:" prefix.

Thanks for your reply.

I already tried this, to no avail. I should've added this in my original
mail. My bad. Thanks anyways!

Best regards,
Prashanth

-- 
Radioactive cats have 18 half-lives.
                                -- Anonymous
http://padbyappu.blogspot.com
http://www.flickr.com/photos/spadix
http://notaweblog.blogspot.com

Re: 'Driver not found' error while trying to run Derby on an Arcom Zeus box

Posted by Knut Anders Hatlen <Kn...@Sun.COM>.
Prashanth Aditya Susarla <pr...@gmail.com> writes:

> Derby 10.4 ij with jsr169.jar
> =============================
> <SNIP>
> # j9 -jcl:max -Xbootclasspath/a:$DERBY_INSTALL/lib/jsr169.jar
> org.apache.derby.tools.ij
> ij> version 10.4
> ij> connect 'jdbc:derby:MyDbTest;create=true';
> JAVA ERROR: java.lang.NoClassDefFoundError: java.sql.Driver
> </SNIP>

I haven't tried this myself, but I think you may need to give this
argument to j9 for ij to know how to create a connection (this is
different in JSR-169 and in JDBC):

  -Dij.dataSource=org.apache.derby.jdbc.EmbeddedSimpleDataSource

And when you get to the ij prompt, skip the "jdbc:derby:" prefix.

There is an example explaining this in the tools and utilities guide:
http://db.apache.org/derby/docs/10.4/tools/rtoolsijproprefdatasource.html

-- 
Knut Anders

Re: 'Driver not found' error while trying to run Derby on an Arcom Zeus box

Posted by Prashanth Aditya Susarla <pr...@gmail.com>.
Paul,

> Download Oracle Lite database from oracle and you will find a jdbcjsr169.jar
> in there. It worked for me.
>
> See link (which helped me also)
>
> http://blogs.sun.com/wittyman/entry/building_jdbc_for_cdc_foundation

Thanks a lot for your help!

(Also thanks to Glenn who pointed me to a (similar) thread you started the
other day - http://tinyurl.com/5y4cs7)

I will explore these options and share my findings with the list.

Best regards,
Prashanth

-- 
Radioactive cats have 18 half-lives.
                             -- Anonymous
http://padbyappu.blogspot.com
http://www.flickr.com/photos/spadix
http://notaweblog.blogspot.com

RE: 'Driver not found' error while trying to run Derby on an Arcom Zeus box

Posted by Paul French <pa...@kirona.com>.
Download Oracle Lite database from oracle and you will find a jdbcjsr169.jar
in there. It worked for me.

See link (which helped me also)

http://blogs.sun.com/wittyman/entry/building_jdbc_for_cdc_foundation


Cheers
Paul
 

-----Original Message-----
From: Prashanth Aditya Susarla [mailto:prashanth.susarla@gmail.com] 
Sent: 03 October 2008 14:07
To: derby-user@db.apache.org
Subject: 'Driver not found' error while trying to run Derby on an Arcom Zeus
box

Hello,

I am Prashanth Susarla and am (very) new to Derby.

A couple of days back I tried running Derby on an Arcom Zeus-based box
(http://www.arcom.com/pxa270-xscale-zeus.htm), which comes bundled with a
version of IBM's J9 JVM (please excuse me for not snipping off the copyright
text) -

<SNIP>
# j9 -jcl:max -version
java version "1.4.2 subset"
IBM J9 2.3 Linux arm-32  (JIT disabled)
J9VM - 20070723_00000_lHdFGR
JIT  - 20070220_1806_r8
GC   - 20070208_AA
JCL  - 20070313_1930,max

Licensed Materials - Property of IBM

J9 - VM for the Java(TM) platform, Version 2.3
(c) Copyright IBM Corp. 1991, 2007  All Rights Reserved
Target: 20070723_00000_lHdFGR (Linux 2.6.16.28-arcom2-1-zeus arm) JIT  -
20070220_1806_r8

IBM is a registered trademark of IBM Corp.
Java and all Java-based marks and logos are trademarks or registered
trademarks of Sun Microsystems, Inc.
</SNIP>

I followed the documentation and steps outlined to install Derby on such
platforms, here -

http://wiki.apache.org/db-derby/JavaMESupport#j9

FWIW, the link on that page pointing to IBM's own test results of running
Derby on their J9 is broken.

The problem I face is that in spite of setting the CLASSPATH correctly and
using the reference implementation of the JSR169 spec I get an error saying
that the JDBC driver is not found.

I have database_enabler.jar with me, and additionally I compiled the
JSR169 (for CDC 1.0) sources
(http://java.sun.com/products/jdbc/download.html#cdcfp) into a jar (that's
the jsr169.jar you will see in the command snippets below).

http://wiki.apache.org/db-derby/JavaMESupport#requirements says that the
latest releases of Derby require CDC 1.1, but I thought I'll give the CDC
1.0 sources a try.

I have only tried using the embedded JDBC driver, and not the client JDBC
driver. I think that the client-server model doesn't make sense (from a
resource usage standpoint) for the way I want to use Derby with my project.

First of all, I got hold of Derby 10.4.2.0 as that's the latest version.
Then I tried running sysinfo and ij, with the following results -

Derby 10.4 sysinfo with database_enabler.jar
============================================
<SNIP>
# j9 -jcl:max -Xbootclasspath/a:$DERBY_INSTALL/lib/database_enabler.jar
org.apache.derby.tools.sysinfo
------------------ Java Information ------------------
Java Version:    1.4.2 subset
Java Vendor:     IBM Corporation
Java home:       /opt/wece6.1
Java classpath:
/opt/Apache/db-derby-10.4.2.0-lib/lib/derby.jar:/opt/Apache/db-derby-10.4.2.
0-lib/lib/derbytools.jar:.
OS name:         Linux
OS architecture: arm
OS version:      2.6.16.28-arcom2-1-zeus
Java user name:  root
Java user home:  /root
Java user dir:   /opt/Apache
java.specification.name: Java Platform API Specification
java.specification.version: 1.4
--------- Derby Information --------
JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
[/opt/Apache/db-derby-10.4.2.0-lib/lib/derby.jar] 10.4.2.0 - (689064)
[/opt/Apache/db-derby-10.4.2.0-lib/lib/derbytools.jar] 10.4.2.0 - (689064)
------------------------------------------------------
</SNIP>

Derby 10.4 ij with database_enabler.jar
=======================================
<SNIP>
# j9 -jcl:max -Xbootclasspath/a:$DERBY_INSTALL/lib/database_enabler.jar
org.apache.derby.tools.ij
ij> version 10.4
ij> connect 'jdbc:derby:MyDbTest;create=true';
ERROR (no SQLState): Driver not found: jdbc:derby:MyDbTest;create=true
</SNIP>

Derby 10.4 sysinfo with jsr169.jar
==================================
Same as above.

Derby 10.4 ij with jsr169.jar
=============================
<SNIP>
# j9 -jcl:max -Xbootclasspath/a:$DERBY_INSTALL/lib/jsr169.jar
org.apache.derby.tools.ij
ij> version 10.4
ij> connect 'jdbc:derby:MyDbTest;create=true';
JAVA ERROR: java.lang.NoClassDefFoundError: java.sql.Driver </SNIP>

Derby 10.4 sysinfo with both jars
=================================
Same as above.

Derby 10.4 ij with both jars
============================
<SNIP>
# j9 -jcl:max
-Xbootclasspath/a:$DERBY_INSTALL/lib/jsr169.jar:$DERBY_INSTALL/lib/database_
enabler.jar
org.apache.derby.tools.ij
ij> version 10.4
ij> connect 'jdbc:derby:MyDbTest;create=true';
ERROR (no SQLState): Driver not found: jdbc:derby:MyDbTest;create=true
</SNIP>

As I wasn't able to create a DB with derby 10.4 using either jsr169.jar or
database_enabler.jar, I decided to try out derby 10.2 (from the requirements
section you can make out that derby 10.2 should work with JSR169 sources for
CDC 1.0 -

Derby 10.2 sysinfo with database_enabler.jar
============================================
<SNIP>
# j9 -jcl:max -Xbootclasspath/a:$DERBY_INSTALL/lib/database_enabler.jar
org.apache.derby.tools.sysinfo
------------------ Java Information ------------------
Java Version:    1.4.2 subset
Java Vendor:     IBM Corporation
Java home:       /opt/wece6.1
Java classpath:
/opt/Apache/db-derby-10.2.2.0-lib/lib/derby.jar:/opt/Apache/db-derby-10.2.2.
0-lib/lib/derbytools.jar:.
OS name:         Linux
OS architecture: arm
OS version:      2.6.16.28-arcom2-1-zeus
Java user name:  root
Java user home:  /root
Java user dir:   /opt/Apache
java.specification.name: Java Platform API Specification
java.specification.version: 1.4
--------- Derby Information --------
JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
[/opt/Apache/db-derby-10.2.2.0-lib/lib/derby.jar] 10.2.2.0 - (485682)
[/opt/Apache/db-derby-10.2.2.0-lib/lib/derbytools.jar] 10.2.2.0 - (485682)
------------------------------------------------------
</SNIP>

Derby 10.2 ij with database_enabler.jar
=======================================
<SNIP>
# j9 -jcl:max -Xbootclasspath/a:$DERBY_INSTALL/lib/database_enabler.jar
org.apache.derby.tools.ij
ij> version 10.2
ij> connect 'jdbc:derby:MyDbTest;create=true';
JAVA ERROR: java.lang.NoClassDefFoundError: java.sql.Savepoint </SNIP>

Derby 10.2 sysinfo with jsr169.jar
==================================
Same as above.

Derby 10.2 ij with jsr169.jar
=============================
<SNIP>
# j9 -jcl:max -Xbootclasspath/a:$DERBY_INSTALL/lib/jsr169.jar
org.apache.derby.tools.ij
ij> version 10.2
ij> connect 'jdbc:derby:MyDbTest;create=true';
JAVA ERROR: java.lang.NoClassDefFoundError: java.sql.Driver </SNIP>

Derby 10.2 sysinfo with both jars
=================================
Same as above.

Derby 10.2 ij with both jars
============================
<SNIP>
# j9 -jcl:max
-Xbootclasspath/a:$DERBY_INSTALL/lib/jsr169.jar:$DERBY_INSTALL/lib/database_
enabler.jar
org.apache.derby.tools.ij
ij> version 10.2
ij> connect 'jdbc:derby:MyDbTest;create=true';
ERROR (no SQLState): Driver not found: jdbc:derby:MyDbTest;create=true
</SNIP>

Here are the contents of 'derby.log' from two of the few situations outlined
above -

derby.log with 10.4.2.0 and database_enabler.jar
=========================================
<SNIP>
2000-04-10 23:39:09.590 GMT Thread[main,5,main] Class
org.apache.derby.jdbc.Driver30 java.lang.NoClassDefFoundError:
javax.naming.Referenceable, module ignored.
2000-04-10 23:39:09.600 GMT Thread[main,5,main] 2000-04-10 23:39:09.683 GMT
Thread[main,5,main] Cleanup action starting ERROR XBM02: Startup failed due
to missing functionality for org.apache.derby.jdbc.InternalDriver. Please
ensure your classpath includes the correct Derby software.
	at
org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at
org.apache.derby.iapi.services.monitor.Monitor.missingImplementation(Unknown
Source)
	at
org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at
org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown
Source)
	at
org.apache.derby.impl.services.monitor.BaseMonitor.startServices(Unknown
Source)
	at
org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(Unknown
Source)
	at org.apache.derby.impl.services.monitor.FileMonitor.<init>(Unknown
Source)
	at
org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Unknown Source)
	at org.apache.derby.iapi.jdbc.JDBCBoot.boot(Unknown Source)
	at org.apache.derby.jdbc.EmbeddedDriver.boot(Unknown Source)
	at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(Unknown Source)
	at java.lang.J9VMInternals.initializeImpl(Native Method)
	at java.lang.J9VMInternals.initialize(J9VMInternals.java:187)
	at java.lang.Class.forNameImpl(Native Method)
	at java.lang.Class.forName(Class.java:114)
	at org.apache.derby.impl.tools.ij.util.loadDriver(Unknown Source)
	at org.apache.derby.impl.tools.ij.util.loadDriverIfKnown(Unknown
Source)
	at org.apache.derby.impl.tools.ij.ij.dynamicConnection(Unknown
Source)
	at org.apache.derby.impl.tools.ij.ij.ConnectStatement(Unknown
Source)
	at org.apache.derby.impl.tools.ij.ij.ijStatement(Unknown Source)
	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(Unknown
Source)
	at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main.main(Unknown Source)
	at org.apache.derby.tools.ij.main(Unknown Source) Cleanup action
completed 2000-04-10 23:39:09.728 GMT Thread[main,5,main] 2000-04-10
23:39:09.724 GMT Thread[main,5,main] Startup failed due to missing
functionality for org.apache.derby.jdbc.InternalDriver. Please ensure your
classpath includes the correct Derby software.
ERROR XBM02: Startup failed due to missing functionality for
org.apache.derby.jdbc.InternalDriver. Please ensure your classpath includes
the correct Derby software.
	at
org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at
org.apache.derby.iapi.services.monitor.Monitor.missingImplementation(Unknown
Source)
	at
org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at
org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown
Source)
	at
org.apache.derby.impl.services.monitor.BaseMonitor.startServices(Unknown
Source)
	at
org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(Unknown
Source)
	at org.apache.derby.impl.services.monitor.FileMonitor.<init>(Unknown
Source)
	at
org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Unknown Source)
	at org.apache.derby.iapi.jdbc.JDBCBoot.boot(Unknown Source)
	at org.apache.derby.jdbc.EmbeddedDriver.boot(Unknown Source)
	at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(Unknown Source)
	at java.lang.J9VMInternals.initializeImpl(Native Method)
	at java.lang.J9VMInternals.initialize(J9VMInternals.java:187)
	at java.lang.Class.forNameImpl(Native Method)
	at java.lang.Class.forName(Class.java:114)
	at org.apache.derby.impl.tools.ij.util.loadDriver(Unknown Source)
	at org.apache.derby.impl.tools.ij.util.loadDriverIfKnown(Unknown
Source)
	at org.apache.derby.impl.tools.ij.ij.dynamicConnection(Unknown
Source)
	at org.apache.derby.impl.tools.ij.ij.ConnectStatement(Unknown
Source)
	at org.apache.derby.impl.tools.ij.ij.ijStatement(Unknown Source)
	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(Unknown
Source)
	at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main.main(Unknown Source)
	at org.apache.derby.tools.ij.main(Unknown Source) </SNIP>

derby.log with 10.2.2.0 with both database_enabler.jar and jsr169.jar
==========================================================
<SNIP>
2000-04-11 00:51:08.216 GMT:
Shutting down instance c013800d-00de-7320-c6fa-000000846580
----------------------------------------------------------------
2000-04-11 00:51:08.291 GMT Thread[main,5,main] Cleanup action starting
ERROR XBM01: Startup failed due to an exception. See next exception for
details.
	at
org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at
org.apache.derby.iapi.services.monitor.Monitor.exceptionStartingModule(Unkno
wn
Source)
	at
org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown
Source)
	at
org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(U
nknown
Source)
	at
org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Unkno
wn
Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown
Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
	at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Unknown
Source)
	at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
	at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
	at java.sql.DriverManager.getConnection(DriverManager.java:124)
	at java.sql.DriverManager.getConnection(DriverManager.java:57)
	at org.apache.derby.impl.tools.ij.ij.dynamicConnection(Unknown
Source)
	at org.apache.derby.impl.tools.ij.ij.ConnectStatement(Unknown
Source)
	at org.apache.derby.impl.tools.ij.ij.ijStatement(Unknown Source)
	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(Unknown
Source)
	at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
	at org.apache.derby.tools.ij.main(Unknown Source) =============
begin nested exception, level (1) ===========
java.lang.NoClassDefFoundError: java.nio.channels.ClosedChannelException
	at java.lang.J9VMInternals.verifyImpl(Native Method)
	at java.lang.J9VMInternals.verify(J9VMInternals.java:63)
	at java.lang.J9VMInternals.initialize(J9VMInternals.java:124)
	at org.apache.derby.impl.io.DirFile4.getRandomAccessFile(Unknown
Source)
	at
org.apache.derby.impl.store.raw.data.BaseDataFileFactory.privGetJBMSLockOnDB
(Unknown
Source)
	at
org.apache.derby.impl.store.raw.data.BaseDataFileFactory.run(Unknown Source)
	at
java.security.AccessController.doPrivileged(AccessController.java:242)
	at
org.apache.derby.impl.store.raw.data.BaseDataFileFactory.getJBMSLockOnDB(Unk
nown
Source)
	at
org.apache.derby.impl.store.raw.data.BaseDataFileFactory.boot(Unknown
Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown
Source)
	at
org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at
org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown
Source)
	at
org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown
Source)
	at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown
Source)
	at
org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at
org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown
Source)
	at
org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown
Source)
	at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown
Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown
Source)
	at
org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at
org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown
Source)
	at
org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown
Source)
	at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source)
	at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown
Source)
	at
org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at
org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown
Source)
	at
org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(U
nknown
Source)
	at
org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Unkno
wn
Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown
Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
	at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Unknown
Source)
	at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
	at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
	at java.sql.DriverManager.getConnection(DriverManager.java:124)
	at java.sql.DriverManager.getConnection(DriverManager.java:57)
	at org.apache.derby.impl.tools.ij.ij.dynamicConnection(Unknown
Source)
	at org.apache.derby.impl.tools.ij.ij.ConnectStatement(Unknown
Source)
	at org.apache.derby.impl.tools.ij.ij.ijStatement(Unknown Source)
	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(Unknown
Source)
	at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
	at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
	at org.apache.derby.tools.ij.main(Unknown Source) ============= end
nested exception, level (1) =========== Cleanup action completed </SNIP>

I think I'm missing a JSR169 (CDC 1.1) implementation that works with IBM's
custom J9 VM, and have found references being made to such a jar at various
forums online when I turned to Google for help. Unfortunately, none of those
posts mentions anything other than IBM's WCTME 5.7 as a source for that jar,
and WCTME is paid software for which I have no other use and hence am
uninterested in purchasing.

Does any one here have any idea -
a.) where I may find JSR169 implementation that meets my needs, assuming
that *is* my problem, and
b.) in case that is not my problem, where should I be looking instead?

Thanks a lot for your time (and patience, this was a really long mail!).

Best regards,
Prashanth

--
Radioactive cats have 18 half-lives.
                            -- Anonymous http://padbyappu.blogspot.com
http://www.flickr.com/photos/spadix
http://notaweblog.blogspot.com

__________ NOD32 3492 (20081003) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com