Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-2815

ij doesn't start with J2ME / JSR169 / weme6.1 because attempting to find java.sql.Driver if ij.protocol property is specified

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.3.1.4
    • 10.4.1.3
    • Tools
    • None
    • windows XP, weme6.1 jvm (J2ME 1.1)

    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

      1. 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

        1. DERBY-2815.diff1
          2 kB
          Myrna van Lunteren
        2. DERBY-2815.diff2
          1 kB
          Myrna van Lunteren

        Issue Links

          Activity

            People

              myrna Myrna van Lunteren
              myrna Myrna van Lunteren
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: