Skip to main content
August 16, 2007
Answered

CF8 Java object init error

  • August 16, 2007
  • 12 replies
  • 1345 views
I am having a little trouble with a java object that used to work fine on CF7 but now doesn't work on CF8. I have submitted a request to our address correction software vendor (QAS) that they provide me with a version that is compatible with CF8 but was hoping perhaps someone could shed a little light on why it might be failing.

I'm not much of a Java developer and I've never seen the source for the QAS jar files, but my best guess is that it may have something to do with this statement I found on the colfusion 8 documentation:

"The init method is not a method of the object, but a ColdFusion identifier that calls the new function on the class constructor. So, if a Java object has an init method, a name conflict exists and you cannot call the object's init method."

Here is the error I get:
Object Instantiation Exception.
An exception occurred when instantiating a Java object. The class must not be an interface or an abstract class. Error: ''.

The error occurred in C:\ColdFusion8\CustomTags\QAS.cfm: line 111
Called from C:\Inetpub\seesroot\seesweb\fc.cfm: line 148


109 : <!--- Create the QuickAddress Object and set the engine and picklist type --->
110 : <cfset searchService = createObject('Java','com.qas.proweb.QuickAddress')>
111 : <cfset searchService.init(sWSDL)>
112 : <cfset searchService.setEngineType(searchService.VERIFICATION)>
113 : <cfset searchService.setFlatten(true)>


The sWSDL variable is set earlier in that QAS custom tag and contains a url to a local WSDL file:

16 : <cfscript>
17 : sWSDL = " http://localhost:2021/proweb.wsdl";


They have a .net implementation and I tried using that insted but I get the exact same error.

Thanks for any help you can offer.
    This topic has been closed for replies.
    Correct answer cf_dev2
    > but my best guess is that it may have something to do with this statement
    > I found on the colfusion 8 documentation

    I'm not using CF 8 but I don't think that's the cause. MX7 had the same restriction and the jar worked.

    Disclaimer - 100% speculation here but I would suspect a version conflict with one of the QAS jar's dependencies. For example I think QAS uses apache axis and so does CF. Perhaps CF is using a different or later version of the axis jar that's not compatible with the QAS jar. It may not be the axis.jar at fault but I suspect some type of .jar conflict is causing the error.

    Hopefully someone using CF8 can provide you with a more solid answer.



    12 replies

    Participant
    September 10, 2007
    Thanks for the response. You were on the money. With a point in the right direction from Adobe, we found the problem. We had to copy in the altercast_sdk.jar and the xerces.jar file into the coldfusion WEB-INF\lib folder. Working again. Thanks!
    Inspiring
    September 7, 2007
    I doubt I can be of much help as I'm not using CF 8 or Adobe's Graphic Server and google didn't turn up much on "com.adobe.altercast.sdk.AlterCast". It might be a similar problem. But "Class not found" could also suggest a missing jar. Does the jar containing "com.adobe.altercast.sdk.AlterCast" reside in the CF classpath?

    Participant
    September 6, 2007
    I suspect that we are having the same problem with another Adobe product...the Graphics Server. Since upgrading to CF 8, all of our apps that interact with the Adobe Graphics Server are throwing the familiar:

    Object Instantiation Exception.
    Class not found: com.adobe.altercast.sdk.AlterCast

    I know very little about Java, but am I wrong in assuming that this is could be the same type of error that I am experiencing?
    Inspiring
    August 17, 2007
    Good to hear.
    August 17, 2007
    I got a new version of their jar files that are compatible with CF8's axis.jar and now it works great again. Thank you for your help.
    Inspiring
    August 16, 2007
    If I were using QAS I might experiment with the class loader http://www.compoundtheory.com/?action=displayPost&ID=114 just out of curiosity. But if QAS has a version that's compatible with CF8, that might be the easiest course of action ;-)

    > And I think I'll pass
    Ha. No, I meant using createObject() to try creating a few of the QAS objects. But no worries.


    August 16, 2007
    And I think I’ll pass on trying to program updated jar files... my java skills are rudimentary at best.
    August 16, 2007
    That's kind of what I was starting to think my self aftter reading that "caused by" section of the stack trace. I compared the files and I can see that the axis.jar in CF8 is a different version than CF7 as the file sizes are different. I am pretty sure that QAS has versions of their .jar files that are compatible with the newer version of axis. They are just taking a lot of time in responding to me because their programmers are in the UK. I guess I will wait a day or so for their response.
    Inspiring
    August 16, 2007
    Until you get a better answer, if you feel adventurous you could try creating a few of the lower level QAS objects to see which one fails. It might give you a more detailed error message or at least a clearer indication of the error cause.
    cf_dev2Correct answer
    Inspiring
    August 16, 2007
    > but my best guess is that it may have something to do with this statement
    > I found on the colfusion 8 documentation

    I'm not using CF 8 but I don't think that's the cause. MX7 had the same restriction and the jar worked.

    Disclaimer - 100% speculation here but I would suspect a version conflict with one of the QAS jar's dependencies. For example I think QAS uses apache axis and so does CF. Perhaps CF is using a different or later version of the axis jar that's not compatible with the QAS jar. It may not be the axis.jar at fault but I suspect some type of .jar conflict is causing the error.

    Hopefully someone using CF8 can provide you with a more solid answer.