timbeadle
02/08/2023, 12:34 PMPROJECT_ROOT/lib and the following in my Application.cfc…
component {
this.javaSettings.loadPaths = [ "./lib/" ];
this.datasources["ds_name"] = {
class: 'net.ucanaccess.jdbc.UcanaccessDriver',
connectionString: 'jdbc:<ucanaccess://PATH/TO/DB.MDB>,
};
}
… I get a Lucee 5.3.10.120 Error (java.lang.NoClassDefFoundError) exception.
1. Has anyone successfully got Lucee working with UCanAccess and an Access file of that version (95 or 97)?
2. Otherwise, is there another driver I could use, or
3. Does anyone have an old Windows PC with Access 97 or 2000, who could import and convert the database 😉 ?
Thanks in advance for any tips or help 🙂Jim Frankowski
02/08/2023, 1:05 PMtimbeadle
02/08/2023, 1:38 PMtimbeadle
02/08/2023, 1:45 PMthisOldDave
02/08/2023, 2:11 PMjava.lang.NoClassDefFoundError tell you what it cant find? it could be a transient dependency rather the driver itselftimbeadle
02/08/2023, 2:12 PMlucee.runtime.exp.NativeException: com/healthmarketscience/jackcess/util/ErrorHandler
at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3137)
at java.base/java.lang.Class.getConstructor0(Class.java:3342)
at java.base/java.lang.Class.getConstructor(Class.java:2151)
at lucee.commons.lang.ClassUtil.newInstance(ClassUtil.java:967)
at lucee.runtime.db.DataSourceSupport._initializeDriver(DataSourceSupport.java:172)
at lucee.runtime.db.DataSourceSupport.initialize(DataSourceSupport.java:164)
at lucee.runtime.db.DataSourceSupport.getConnection(DataSourceSupport.java:103)
at lucee.runtime.db.DatasourceConnectionPool.loadDatasourceConnection(DatasourceConnectionPool.java:158)
at lucee.runtime.db.DatasourceConnectionPool.getDatasourceConnection(DatasourceConnectionPool.java:119)
at lucee.runtime.db.DatasourceManagerImpl.getConnection(DatasourceManagerImpl.java:82)
at lucee.runtime.tag.Query.executeDatasoure(Query.java:1120)
at lucee.runtime.tag.Query._doEndTag(Query.java:700)
at lucee.runtime.tag.Query.doEndTag(Query.java:566)
at lucee.runtime.functions.query.QueryExecute.call(QueryExecute.java:86)timbeadle
02/08/2023, 2:29 PMthisOldDave
02/08/2023, 2:32 PMbdw429s
02/08/2023, 4:27 PMmborn
02/08/2023, 4:30 PMmborn
02/08/2023, 4:30 PMmborn
02/08/2023, 4:30 PMbdw429s
02/08/2023, 4:31 PMmborn
02/08/2023, 4:31 PMbdw429s
02/08/2023, 4:31 PMtimbeadle
02/08/2023, 4:31 PMtimbeadle
02/08/2023, 4:32 PMmborn
02/08/2023, 4:32 PMmborn
02/08/2023, 4:34 PMmborn
02/08/2023, 4:35 PMCopy codecom/healthmarketscience/jackcess/util/ErrorHandler
timbeadle
02/08/2023, 4:35 PMtimbeadle
02/08/2023, 4:36 PMCaused by: java.lang.ClassNotFoundException: com.healthmarketscience.jackcess.util.ErrorHandler not found by ucanaccess.3.0.7 [50]mborn
02/08/2023, 4:37 PMmborn
02/08/2023, 4:41 PMbdw429s
02/08/2023, 4:50 PMbdw429s
02/08/2023, 4:50 PMmborn
02/08/2023, 4:51 PMbdw429s
02/08/2023, 4:54 PMmborn
02/08/2023, 4:54 PMtimbeadle
02/08/2023, 4:59 PMmborn
02/08/2023, 5:01 PMmborn
02/08/2023, 5:01 PMmborn
02/08/2023, 5:02 PM"/home/michael/.CommandBox/server/76C198B7CDF71CB53F5EB9AEE50F898B-ucanaccess/lucee-5.3.10.97/WEB-INF/lucee-server/context/lib/ucanaccess-4.0.4.jar is not a valid bundle!;org.osgi.framework.BundleException: /home/michael/.CommandBox/server/76C198B7CDF71CB53F5EB9AEE50F898B-ucanaccess/lucee-5.3.10.97/WEB-INF/lucee-server/context/lib/ucanaccess-4.0.4.jar is not a valid bundle!mborn
02/08/2023, 5:03 PMmborn
02/08/2023, 5:03 PMmborn
02/08/2023, 5:04 PMmborn
02/08/2023, 5:04 PMtimbeadle
02/08/2023, 5:04 PMbdw429s
02/08/2023, 5:05 PMmborn
02/08/2023, 5:06 PMmborn
02/08/2023, 5:07 PM.zip
2. Uncompress
3. Open META-INF/MANIFEST.MF
See all the Bundle-* properties in that file?
This means that the Jackcess jar is an OSGI bundle, which means it is loaded using a completely different Java class loader than the rest of the app. This means that when ucanaccess tries to reference jackcess, it cannot because the two are operating in completely different "contexts", if you will.mborn
02/08/2023, 5:07 PMmborn
02/08/2023, 5:08 PMmborn
02/08/2023, 5:08 PMmborn
02/08/2023, 5:14 PMBundle-Name, Bundle-SymbolicName, and Import-Package properties to the MANIFEST.MF file and re-zipping as a .jar file. But you'd have to manually add each dependency to the Import-Package line, and you may also need to manually create OSGI bundles for every other jar I mentioned on my blog post. (Though commons-logging, commons-lang, and hsqldb are already in Lucee, so 🤷)timbeadle
02/08/2023, 5:18 PMtimbeadle
02/14/2023, 10:13 AM