Copy link to clipboard
Copied
I am trying to call a java service from ColdFusion MX 8.0.1 using the following code.
I am the developer of the Java service, not a coldfusion programmer.
<cfscript>
ws = CreateObject("WebService", "http://myserver.us/webservices/WebInterface?WSDL");
vali = CreateObject("Java","vo.myapplication.ContactVO");
vali.setId(1234);
vali.setSecondaryID(45855);
wsResponse = ws.updateContact(vali);
</cfscript>
The call fails with "Object Instantiation Exception - Class not found: vo.myapplication.ContactVO", so i know CF is unable to load my class.
My question is why?
My stubs have been generated into
C:\jrun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\cfusion\stubs\WS-254617805
and i can see ContactVO in there, in the correct package.
I can make it work if i add the absolute path of the sub directory to
Server Settings > Java and JVM > ColdFusion Class Path
Can anyone tell me why Coldfusion 8.0.1 is not dynamically loading the VO class, so that i can perform a CreateObject?
Thanks in advance!
Copy link to clipboard
Copied
Another way to dynamically load a custom class like /vo/myapplication/ContactVO.class, besides specifying its path in the classpath, is to place it in the directory {CF_wwwroot}/WEB_INF/classes/. Mind you, I'm on the Coldfusion single-server version, on Windows.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more