Hoping someone can shed some light on this error we’re experiencing since we made a few changes to our application’s build process.
Firstly, the error…
Edit: the stack
- AdoptOpenJDK JRE 1.8_212_b04 64bit
- Apache Tomcat 9.0.20
- Lucee 126.96.36.199
The error mention is occurring when one of our classes attempts to convert a ResultSet to a QueryImpl object, but for some reason now that the packaging has changed, our class can no longer find the internal Lucee classes.
For context, our app has always loaded *.class files from a directory within our application folder. We use an old component called JavaLoader.cfc which I believe is still common today? Previously, we would set a class path to the directory of our classes when initialising JavaLoader.cfc like so…
classPaths = [ GetDirectoryFromPath(GetCurrentTemplatePath()) & "java/classes" ]; server.javaLoader = createObject("component", "javaloader.JavaLoader").init(loadPaths = classPaths, loadColdFusionClassPath = TRUE); server.javaLoader = createObject("component", "javaloader.JavaLoader").init(loadColdFusionClassPath = TRUE);
This runs at application startup, and worked well. Recently we decided it was time to package up these class files more nicely, and these class files now reside in WEB-INF/lib within a ‘server.jar’ file. We simplified the above code to the following, in case it’s relevant.
server.javaLoader = createObject("component", "javaloader.JavaLoader").init(loadColdFusionClassPath = TRUE);
No changes to the code have been made other than the above, and the packing of the class files into a jar. Since we’ve made the changes, the application works just fine, except when we attempt to invoke Lucee classes.
Is there a change we need to make to the jar in order for it to see the Lucee runtime classes? Another thread mentioned some manifest changes which made no difference (added “Requires-bundle: lucee.core”).
Would appreciate any ideas you may have!