Details
Description
When starting ij with the following command:
ij -jcl:foun11 -Xbootclasspath/a:<path_to_jdbc.jar> org.apache.derby.tools.ij -p derby.properties
and derby.properties contains the following:
-----------------
ij.database=jdbc:derby:bladb;create=true
ij.protocol=jdbc:derby:
ij.showNoConnectionsAtStart=true
ij.showNoCountForSelect=true
- DataSource properties, only used if ij.dataSource is set
ij.dataSource.databaseName=bladb
ij.dataSource.createDatabase=create
ij.dataSource=org.apache.derby.jdbc.EmbeddedSimpleDataSource
------------------
ij does not start and instead gives the following stack trace:
Exception in thread "main" java.lang.NoClassDefFoundError: java.sql.Driver
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:226)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:10
9)
at java.net.URLClassLoader.findClassImpl(URLClassLoader.java:1029)
at java.net.URLClassLoader$4.run(URLClassLoader.java:549)
at java.security.AccessController.doPrivileged(AccessController.java:213
)
at java.net.URLClassLoader.findClass(URLClassLoader.java:547)
at com.ibm.oti.vm.URLSystemClassLoader.findClass(URLSystemClassLoader.ja
va:27)
at java.lang.ClassLoader.loadClass(ClassLoader.java:606)
at com.ibm.oti.vm.URLSystemClassLoader.loadClass(URLSystemClassLoader.ja
va:60)
at java.lang.ClassLoader.loadClass(ClassLoader.java:563)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:114)
at org.apache.derby.impl.tools.ij.util.loadDriver(util.java:849)
at org.apache.derby.impl.tools.ij.util.loadDriverIfKnown(util.java:833)
at org.apache.derby.impl.tools.ij.util.startJBMS(util.java:476)
at org.apache.derby.impl.tools.ij.util.startJBMS(util.java:585)
at org.apache.derby.impl.tools.ij.ConnectionEnv.init(ConnectionEnv.java:
64)
at org.apache.derby.impl.tools.ij.utilMain.initFromEnvironment(utilMain.
java:179)
at org.apache.derby.impl.tools.ij.Main.<init>(Main.java:230)
at org.apache.derby.impl.tools.ij.Main.getMain(Main.java:193)
at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:178)
at org.apache.derby.impl.tools.ij.Main.main(Main.java:73)
at org.apache.derby.tools.ij.main(ij.java:67)
The properties file is an example of the 'old test harness' properties files. The test harness would get sql scripts tested with J2ME by stripping away the ij.protocol and ij.database specifications.
In another bug - DERBY-1218 - it was suggested ij.protocol be blanked out (in tools/ij/util.java?) with J2ME.
Another approach would be to check for ij.protocol or ij.database setting when we have a datasource and we're using J2ME.
Attachments
Attachments
Issue Links
- is related to
-
DERBY-1218 ij should detect J2ME environments and automatically use DataSources
- Closed