Archive for August, 2008

CF 8 Web Services Error “duplicate class definition”

Friday, August 22nd, 2008

Full error is: coldfusion.xml.rpc.CFCInvocationException: [java.lang.ClassNotFoundException : xmr.artxorms_webservice.class.xyn.XYNReportVO][java.lang.LinkageError : duplicate class definition: xmr/artxorms_webservice/class/xyn/XYNReportVO] Note, some paths have been altered to preserve anonymity of my client (not that they care, its just good practice).

I’ve had absolutely no luck finding anything useful about this error on the interwebs as it relates to ColdFusion web services. Anyone got a clue? I’ll update if I figure it out.

CLUES:

  • Clearing the template cache seems to clear this up temporarily but it comes back within a few hours of use.
  • Server was recently upgraded to 8,0,1,195765 a few days before this problem was noticed. Service had no known problems previously.
  • Java VM Version 1.5.0_07-b03
  • JRun 4.? afaik

Update/Possible Solution?

I am pretty sure that this issue has something to do with case sensitivity on custom return types through the webservice response. I found this article which seems to indicate that there were some changes in the way that ColdFusion 8.1 generates WSDL files as far as case goes. http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=7&threadid=1386433#5057074.

My latest guess is thus: Returning a complex data type through ColdFusion Webservice involves serializing a component into a SOAP format. Once an object is serialized it sticks around in a cache somewhere. Starting in CF8.1 if your reference gets changed before serializing the serializer will try again next go round only to find that the end result is already present. Rather than replacing the cached version as was probably intended, we get an error.

I’ve found a few places where my capitalization for component references were not consistent so I’m going through and making sure everything has the same case. The ones that are showing up as errors are the components that get serialized and returned through the web service response.

I’ve set up a brutal unit/stress tester for the web service. Assuming all goes well for the next 24-48 hours I may take this one to Adobe support.

IF you have anything helpful to add or you know that I’m way off, please share!!

Reset Your ColdFusion Server Password

Thursday, August 21st, 2008

To reset your password (MX6 MX7 or 8)

  • Open {CF install dir}\lib\neo-security.xml
  • Find this section:
  • Change value to false.
  • Restart the ColdFusion Server.
  • Start the administrator localhost/cfide/administrator/
  • Set your password

That’s it! Comment if you have any questions on the above procedure.

Compile CFM, CFC to classes for sourceless deployment

Wednesday, August 13th, 2008

Included in ColdFusion MX 7 and ColdFusion 8 cfcompile.bat command is found in {coldfusionroot}/bin/

Using the -deploy option causes the cfcompile utility to write the compiled class files to .cfm and .cfc files that match the original source rather than to the coldfusion class file cache. I found some additional information here:(http://www.webddj.com/read/48642.htm). I tried it out on a source directory on my laptop, it was easy.

cfcompile -deploy [webroot] [directory-to-compile] [output-directory]

One problem is that java .class files can be un-compiled! You cannot get the original ColdFusion source code back but you can get a Java servlet that does the same job. I took a look at what one of these decompiled servlets looks like in MX7 (http://www.nomachetejuggling.com/2006/12/07/coldfusions-compiler/). The resulting code is very bloated but still readable if you are extremely determined. An 8 line CF template results in hundreds of lines of Java.

I’ve seen
Even though the code can still be read, it seems a big improvement over releasing a version of source code encrypted by the previous CFEncrypt program that could be completely decrypted back to the original CFML code.