Daniel John Debrunner wrote:
Mike Jarmy wrote:
OK, I actually have Derby working on J9/JclMax now. The problem was
that J9/JclMax was telling Derby that its java.version was "1.4.2
subset", which (although technically true) was confusing Derby into
trying to load classes that use java 1.4 packages such as java.nio.
So what I did as a quick-and-dirty way to get it working was comment
out the static block in org.apache.derby.iapi.services.info.JVMInfo
and replace it with the following code:
JDK_ID = J2SE_13;
J2ME = false; // JclMax is a superset of J2ME
JAVA_SQL_TYPES_BOOLEAN = java.sql.Types.BIT ;
Everything seems to work fine now. It would be nice if there was a
more graceful way to handle this though. If anyone has suggestions
for how I ought to modify JVMInfo to properly handle this situation,
I'd be glad to contribute the code back to the project. Although
JclMax is not an official Java profile, it is an IBM product, just not
a 'coffee-cup-branded' one.
I think this could be handled by modifying the modules.properties,
that file defines which modules are available and their requirements for
running, it's basically Derby's IoC framework.
There are these lines in the file for the raw storage layer:
derby.module.rawStore.data.genericJ4=org.apache.derby.impl.store.raw.data.BaseDataFileFactoryJ4
derby.env.jdk.rawStore.data.genericJ4=4
# Generic version using older IO interfaces
derby.module.rawStore.data.genericJ1=org.apache.derby.impl.store.raw.data.BaseDataFileFactory
derby.env.jdk.rawStore.data.genericJ1=1
One could modify the first to also indicate that the module requires
certain classes to run, something like adding one line to the "J4" version:
derby.module.rawStore.data.genericJ4=org.apache.derby.impl.store.raw.data.BaseDataFileFactoryJ4
derby.env.jdk.rawStore.data.genericJ4=4
## ADD THIS FOLLOWING LINE
derby.env.classes.rawStore.data.genericJ4=java.nio.channels.FileChannel
I haven't tried this and maybe there are other entries that would need
changes, but it's a starting point for you. It would be great if you
could contribute a working patch back.
This one would need similar treatment:
# store data using a StorageFactory
# Enhanced version using NIO API; requires Java 1.4
derby.module.rawStore.data.genericJ4=org.apache.derby.impl.store.raw.data.BaseDataFileFactoryJ4
derby.env.jdk.rawStore.data.genericJ4=4
Actually for BaseDataFileFactoryJ4 I'm not sure if the the above is
correct, I haven't looked to see why it requires JDK 1.4, at first I
missed the storage factory being in modules.properties.
Hopefully this is enough for you to follow.
Dan.