db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Streeting (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3380) derbyclient.jar is dependent on Java v6
Date Mon, 11 Feb 2008 19:01:41 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12567755#action_12567755

Steve Streeting commented on DERBY-3380:

Sorry for the delay, I expected to get an email ping on this!

I don't know why Eclipse decided to try to load these classes, I just use it, I'm not an Eclipse
dev ;)

All I did was try to define a database connection using the Generic JDBC connection and referenced
the Derby client jar. Should I be doing something else? My guess is that Eclipse goes looking
in the jar for all JDBC drivers, which is why it trips over this. Shouldn't the elements that
are compiled against a different Java version be separated into a different jar? It seems
odd to combine them in one given that some of the classes can't be loaded or even examined
by pre-Java 6 runtimes. Seems like a bit of a minefield for any app that might decide to try
to examine the jar.

Since I use Eclipse as my primary Java dev tool and I need to target OS X's default Java runtime
this meant Derby was not viable for me. I'd like to have the option of using it if possible,
and it seems to me it would be sensible to split the jar along major runtime version lines.

> 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:
>         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-[org/apache/derby/client/ClientPooledConnection40.class]
> 50.0  /Users/steve/devlibs/java/db-derby-[org/apache/derby/client/ClientXAConnection40.class]
> 50.0  /Users/steve/devlibs/java/db-derby-[org/apache/derby/client/am/CallableStatement40.class]
> 50.0  /Users/steve/devlibs/java/db-derby-[org/apache/derby/client/am/ColumnMetaData40.class]
> 50.0  /Users/steve/devlibs/java/db-derby-[org/apache/derby/client/am/FailedProperties40.class]
> 50.0  /Users/steve/devlibs/java/db-derby-[org/apache/derby/client/am/LogicalConnection40.class]
> 50.0  /Users/steve/devlibs/java/db-derby-[org/apache/derby/client/am/ParameterMetaData40.class]
> 50.0  /Users/steve/devlibs/java/db-derby-[org/apache/derby/client/am/PreparedStatement40.class]
> 50.0  /Users/steve/devlibs/java/db-derby-[org/apache/derby/client/am/SQLExceptionFactory40.class]
> 50.0  /Users/steve/devlibs/java/db-derby-[org/apache/derby/client/am/Statement40.class]
> 50.0  /Users/steve/devlibs/java/db-derby-[org/apache/derby/client/net/ClientJDBCObjectFactoryImpl40.class]
> 50.0  /Users/steve/devlibs/java/db-derby-[org/apache/derby/client/net/NetConnection40.class]
> 50.0  /Users/steve/devlibs/java/db-derby-[org/apache/derby/client/net/NetDatabaseMetaData40.class]
> 50.0  /Users/steve/devlibs/java/db-derby-[org/apache/derby/client/net/NetResultSet40.class]
> 50.0  /Users/steve/devlibs/java/db-derby-[org/apache/derby/jdbc/ClientConnectionPoolDataSource40.class]
> 50.0  /Users/steve/devlibs/java/db-derby-[org/apache/derby/jdbc/ClientDataSource40.class]
> 50.0  /Users/steve/devlibs/java/db-derby-[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.

View raw message