You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Bryan Pendleton (JIRA)" <ji...@apache.org> on 2008/02/02 16:24:08 UTC
[jira] Commented: (DERBY-3380) derbyclient.jar is dependent on Java
v6
[ https://issues.apache.org/jira/browse/DERBY-3380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12565076#action_12565076 ]
Bryan Pendleton commented on DERBY-3380:
----------------------------------------
Yes, several of the class files were indeed built against Java 6; specifically,
the classes which support the JDBC version 4 API, which is part of Java 6.
But Derby is very careful to dynamically load those classes *only* when it
is being used in a Java 6 environment.
According to the stack trace above, it was *Eclipse* that attempted to load
these classes, not Derby. Specifically, it was something in Eclipse called
org.eclipse.datatools.connectivity.ui.DriverClassBrowsePropertyDescriptor$1.run(DriverClassBrowsePropertyDescriptor.java:135)
Do you know why Eclipse is trying to load the classes from the jar?
Perhaps you can configure Eclipse to load only the JDBC 3 version of the
driver classes from the jar, which indeed require only JDK 1.4 to function.
> derbyclient.jar is dependent on Java v6
> ---------------------------------------
>
> Key: DERBY-3380
> URL: https://issues.apache.org/jira/browse/DERBY-3380
> Project: Derby
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 10.3.2.1
> Environment: Mac OS X 10.4, up to date with latest Apple Java updates
> Reporter: Steve Streeting
> Priority: Blocker
>
> I've been using Derby on Windows without any problems. I can use the embedded database on OS X 10.4, and fire up the server ok, but when I tried to add a client JDBC connection in Eclipse 3.3 on Mac OS X, referencing derbyclient.jar I got an exception:
> java.lang.reflect.InvocationTargetException
> at org.eclipse.datatools.connectivity.ui.DriverClassBrowsePropertyDescriptor$1.run(DriverClassBrowsePropertyDescriptor.java:138)
> at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
> Caused by: java.lang.Exception: java.lang.Exception: java.lang.UnsupportedClassVersionError: Bad version number in .class file
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
> at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
> at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
> at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:579)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at org.eclipse.datatools.connectivity.internal.DriverUtil.getDriverClassesFromJar2(DriverUtil.java:121)
> at org.eclipse.datatools.connectivity.internal.DriverUtil.getDriverClassesFromJar(DriverUtil.java:84)
> at org.eclipse.datatools.connectivity.ui.DriverClassBrowsePropertyDescriptor$1.run(DriverClassBrowsePropertyDescriptor.java:135)
> ... 1 more
> I used the 'BCVer' tool to dump the versions of the class files in derbyclient.jar, and I found that several have a bytecode version of '50.0', which is Java 6. Therefore it would appear that the class files in this archive were built against the Java 6 SDK and not Java 1.4 as is claimed. Here are the class files affected as dumped by bcver:
> 50.0 /Users/steve/devlibs/java/db-derby-10.3.2.1-bin/lib/derbyclient.jar[org/apache/derby/client/ClientPooledConnection40.class]
> 50.0 /Users/steve/devlibs/java/db-derby-10.3.2.1-bin/lib/derbyclient.jar[org/apache/derby/client/ClientXAConnection40.class]
> 50.0 /Users/steve/devlibs/java/db-derby-10.3.2.1-bin/lib/derbyclient.jar[org/apache/derby/client/am/CallableStatement40.class]
> 50.0 /Users/steve/devlibs/java/db-derby-10.3.2.1-bin/lib/derbyclient.jar[org/apache/derby/client/am/ColumnMetaData40.class]
> 50.0 /Users/steve/devlibs/java/db-derby-10.3.2.1-bin/lib/derbyclient.jar[org/apache/derby/client/am/FailedProperties40.class]
> 50.0 /Users/steve/devlibs/java/db-derby-10.3.2.1-bin/lib/derbyclient.jar[org/apache/derby/client/am/LogicalConnection40.class]
> 50.0 /Users/steve/devlibs/java/db-derby-10.3.2.1-bin/lib/derbyclient.jar[org/apache/derby/client/am/ParameterMetaData40.class]
> 50.0 /Users/steve/devlibs/java/db-derby-10.3.2.1-bin/lib/derbyclient.jar[org/apache/derby/client/am/PreparedStatement40.class]
> 50.0 /Users/steve/devlibs/java/db-derby-10.3.2.1-bin/lib/derbyclient.jar[org/apache/derby/client/am/SQLExceptionFactory40.class]
> 50.0 /Users/steve/devlibs/java/db-derby-10.3.2.1-bin/lib/derbyclient.jar[org/apache/derby/client/am/Statement40.class]
> 50.0 /Users/steve/devlibs/java/db-derby-10.3.2.1-bin/lib/derbyclient.jar[org/apache/derby/client/net/ClientJDBCObjectFactoryImpl40.class]
> 50.0 /Users/steve/devlibs/java/db-derby-10.3.2.1-bin/lib/derbyclient.jar[org/apache/derby/client/net/NetConnection40.class]
> 50.0 /Users/steve/devlibs/java/db-derby-10.3.2.1-bin/lib/derbyclient.jar[org/apache/derby/client/net/NetDatabaseMetaData40.class]
> 50.0 /Users/steve/devlibs/java/db-derby-10.3.2.1-bin/lib/derbyclient.jar[org/apache/derby/client/net/NetResultSet40.class]
> 50.0 /Users/steve/devlibs/java/db-derby-10.3.2.1-bin/lib/derbyclient.jar[org/apache/derby/jdbc/ClientConnectionPoolDataSource40.class]
> 50.0 /Users/steve/devlibs/java/db-derby-10.3.2.1-bin/lib/derbyclient.jar[org/apache/derby/jdbc/ClientDataSource40.class]
> 50.0 /Users/steve/devlibs/java/db-derby-10.3.2.1-bin/lib/derbyclient.jar[org/apache/derby/jdbc/ClientXADataSource40.class]
> I got the exception in Eclipse by creating a Generic JDBC connection referencing derbyclient.jar, and clicking on the button next to 'Driver Class'.
> Please can you advise. For the moment I'm having to switch to using HSQL on Mac OS X.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.