Call .jar from ColdFusion

I have a .jar file that I placed in the directory D: \ Coldfusion8 \ wwwroot \ web-inf \ lib \. File: abcdef.jar

This is my first time, but not sure if the path should be in my createObject ().

<cfset abcObj = createObject("java","com.abcdef") /> <cfset result = acbObj.doStuff("123456") /> 

But when I run it, I get

 Object Instantiation Exception. Class not found: com.vp4jo_b 

What am I missing along the way?

+6
java instantiation coldfusion
source share
2 answers

Have you restarted the Coldfusion service?

Even when bans are loaded in the class path only when the server starts.

Information has moved from comments:

  • Ensure that the file is in the path to the system class or in one of the configured paths of the ColdFusion class.
  • As for the class name parameter CreateObject() : the class name begins in the bank. Open it as a .zip file and look at its structure. The dotted path mimics the structure of folders, so if the Server is still complaining, you should skip something in the dotted path.
+3
source share

Do you consider using JavaLoader ?

+5
source share

All Articles