How to access method in java object from CF?
Hi, I used cfobject to create java object as follow:
<cfobject
type="Java" class="com.as.web.Search" name="myObj" action="create">
<cfdump
var="#myObj#">
Here is the output:
I'm having a hard time accessing these method from coldfusion. If I do:
<cfset x = myObj.getAddress()>
<cfdump var="#x#"> I got this error:
Object Instantiation Exception.
An exception occurred while instantiating a Java object. The class must not be an interface or an abstract class. If the class has a constructor that accepts an argument, you must call the constructor explicitly using the init(args) method. Error : com.as.web.Search
If I do:
<cfset y = "1st street skillman NJ 08558">
<cfset x = myObj.getAddress( #y#)>
<cfdump var="#x#"> I got an error :
The getAddress method was not found.
Either there are no methods with the specified method name and argument types, or the getAddress method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that matched the provided arguments. If this is a Java object and you verified that the method exists, you may need to use the javacast function to reduce ambiguity.
I have no experience working with java object and don't understand what this mean and what should I do, please help?
