I've been banging my head on this for a while, can't seem to find any decent answers or explanations for these errors. I am using a 3rd party JAR "PropHandler.jar" I am trying to call the getMessageList method, it accepts 3 args and requires a config file.
<cfset configFile = 'C:\data\getMsgListCONFIG.xml'>
<cfset Obj = createObject("java","client.PropHandler") />
<cfdump var="#Obj#">
All good here, my dump returns a list of methods. Now, I need to get my config file to the method and pass in my args, no love here, I have tried this:
<cfset x = Obj.getMessageList.init(configFile)>
And
<cfset x = Obj.getMessageList().init(configFile)>
And
<cfset x = Obj.getMessageList('identifier', 'greaterthan', '2012-05-18T12:00:00-04:00').init(configFile)>
And even tried initializing via the creation of the object:
<cfset Obj = createObject("java","client.PropHandler").getMessageList('identifier', 'greaterthan', '2012-05-18T12:00:00-04:00').init(configFile)>
All Return the same 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 : client.PropertyHandler
When I don't send the 3 args I get a method not found error, if I don't send the init I get the same error.
So, I do not have a lot of experience with JAVA and I do not understand the error message. I can use the JAR fine when calling from a command line, or even when executing with a BAT file, but when I do that I can't get the XML SOAP array returned to me...
From the Java Doc:
PropertyHandler
public PropertyHandler(java.lang.String propFile) throws java.lang.Exception
Uses a Property File to set up all program variables. This Property File refers to a second Property File that identifies user Id and security file data.
Parameters:
propFile
- XML file of PropertiesThrows:
java.lang.Exception
getMessageList
public services.[...].GetResponseTypeDef getMessageList(java.lang.String par1, java.lang.String comp_Op1, java.lang.String parValue1 )
Overrides X_Properties to returns a list of metadata about each message that meets the query defined by the function parameters.
Parameters:
par1
- One of Parameter enumcomp_Op1
- One of CompOp enumparValue1
- a value for comparisonReturns:
metadata message list meeting query criteria Returns null if an exception is encountered instead of throwing an exception.