Im using Coldfusion 9 with Multiserver/J2EE on JRun 4 Configuration in a development engine.
I try to apply sample below into my coldfusion engine however it not work.
Sample : How do you use java files in Coldfusion
Perhaps anyone here can help me to resolve this issue?
Here is what i did :
1) Write a simple Hello.java file, compile into Hello.class file.
public class Hello
{
public String testJava()
{
return "Hello Java!!";
}
}
2) Write a cfm file : jHello.cfm to call the java object.
<cfscript>
helloWorld = CreateObject("java","Hello");
helloTest = helloWorld.testJava();
</cfscript>
3) Save the .class file into class path :
4) Restart coldfusion 9 Server
5) However, it return Error below when run JHello.cfm file :
Object Instantiation Exception.
Class not found: Hello
The error occurred in C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/accuity_dev/JHello.cfm: line 2
1 : <cfscript>
2 : helloWorld = CreateObject("java","Hello");
3 : helloTest = helloWorld.testJava();
4 : </cfscript>
Appreciate your time, hope can get back from any expert here.