I want to use cbjavaloader, I put the SAP Java connector (sapjco3.jar) in the lib directory but i getting the this error;
Type: javaloader.ClassNotFoundException Messages: The requested class could not be found. The requested class ‘JCo’ could not be found in the loaded jars/directories.
my JavaLoader settings is;
javaloader = {
// The array paths to load
loadPaths = [’#controller.getAppRootPath()#/lib/sapjco3.jar’],
// Load ColdFusion classes with loader
loadColdFusionClassPath = false,
// Attach a custom class loader as a parent
parentClassLoader = “”,
// Directories that contain Java source code that are to be dynamically compiled
sourceDirectories = [],
// the directory to build the .jar file for dynamic compilation in, defaults to ./tmp
compileDirectory = [’#controller.getAppRootPath()#/modules/cbjavaloader/models/javaloader/tmp’],
// Whether or not the source is trusted, i.e. it is going to change? Defaults to false, so changes will be recompiled and loaded
trustedSource = false
};
To be clear, Ancient Programmer’s suggestion is not to fix javaloader, but to not require java laoder at all by just using the built in CF engine’s ability to load jars. I’ve had to use that jar in the past and it was quite horrible but we got it working using this.javaSettings. I do recall having some issues on our Linux servers related to some C library that the jar tries to load.
I put the helloworld.jar from coldbox javaloader sample application to C:\ColdFusion2016\cfusion\lib directory.
I get the success result when I run the following code;
Class Name HelloWorld
Methods
Method Return Type
hello() java.lang.String
When I put the helloworld.jar to my coldbox application lib folder, i get the same error
The requested class could not be found. The requested class ‘HelloWorld’ could not be found in the loaded jars/directories.
Thanks your support
Mahmut
6 Ağustos 2018 Pazartesi 20:46:51 UTC+3 tarihinde Brad Wood yazdı:
That’s not enough information for me to help you. Have you confirmed the this.java settings are present. Also note, depending on your engine, I’ve seen CF be picking about leading slashes and the direction of slashes in your javasettings. Might want to review those as well.