Web Services Problems with ColdFusion 8 on a Mac
I just got a brand new Mac Pro yesterday - I spent most of yesterday installing stuff, but today I was trying to get a little work done... I ran into a problem when trying to invoke web services on CF8 - it threw the following error:
coldfusion.jsp.JavaCompiler$UnknownCompiler: Unable to run the internal Java compiler: java.lang.NoClassDefFoundError: javax/tools/StandardJavaFileManager.
I setup the following test code using Doug Hughes' Fortune web service, to make sure it wasn't just the service I was trying to call:
<cfset ws = CreateObject("webservice", "http://www.doughughes.net/WebServices/fortune/fortune.cfc?wsdl")> <cfset f = ws.getTopicsList()> <cfdump var="#f#">
After searching google, all I could find were a few other people with the same problem and no solution. I found that the StandardJavaFileManager class (the one it can't find) is part of Java 6 - I was running Java 1.5, and I know that on Windows CF8 ships with Java 1.6. I pinged Sean Corfield to see if he had experienced these problems. He said, no but he is already running Java 6 (which helped me confirm that was indeed the problem). He also helped me figure out step 3.
Step 1 - Download & Install Java 6 for Mac
I downloaded the Java SE 6.0 Release 1 Developer Preview 6 from Sept. 2006, as it was the most current release as of this writing. You can download it from the Apple Developers Connection (ADC) which is free but requires a login.
Step 2 - Make Java 1.6 the default JDK for your Mac
To do this run the following:
cd /System/Library/Frameworks/JavaVM.framework/Versions sudo rm CurrentJDK sudo ln -s 1.6 CurrentJDK
To make sure it's working run the following:
You should get something like this:
java version "1.6.0-dp" Java(TM) SE Runtime Environment (build 1.6.0-dp-b88-34)
Step 3 - Remove tools.jar
If you restart CF8 at this point your server will infact be running on Java 6, and this is good, but web services still throw an error, this time a different one. To fix you need to remove
tools.jar (make a backup of it and put it somewhere else, also you probably want to stop CF first). You can find it in CF8's
Finally just start or restart ColdFusion, and you should be able to invoke web services.
Like this? Follow me ↯Tweet Follow @pfreitag
Web Services Problems with ColdFusion 8 on a Mac was first published on August 16, 2007.
If you like reading about coldfusion 8, mac, apple, web services, soap, java, java 6, or cf8 then you might also like:
- ColdFusion SOAP Web Services and onRequestStart
- Working with /etc/hosts on Mac
- PostalMethods - Web Service for Snail Mail
- CFImage Presentation Outline
- Going from SOAP to REST Web Services
- CFImage Effects Library for ColdFusion 8
- Serializing CFC's in ColdFusion 8
- Refurbished MacBooks, iPods, iBooks, and More
The FuseGuard Web Application Firewall for ColdFusion & CFML is a high performance, customizable engine that blocks various attacks against your ColdFusion applications.