Pete Freitag Pete Freitag

Web Services Problems with ColdFusion 8 on a Mac

Updated on November 17, 2023
By Pete Freitag
coldfusionjavaapple

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:

./CurrentJDK/Home/bin/java -version

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 WEB-INF/cfusion/lib folder.

Finally just start or restart ColdFusion, and you should be able to invoke web services.



coldfusion 8 mac apple web services soap java java 6 cf8

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:

FuseGuard Web App Firewall for ColdFusion

The FuseGuard Web Application Firewall for ColdFusion & CFML is a high performance, customizable engine that blocks various attacks against your ColdFusion applications.

CFBreak
The weekly newsletter for the CFML Community


Comments

WHen I tried this -I got an error when I used

sudo ln -s 1.6 CurrentJDK/

When I tried

sudo ln -s 1.6 CurrentJDK

it worked. But when I did java -version, I still got 1.5.x.
by Raymond Camden on 08/16/2007 at 3:29:06 PM UTC
Just to point out that

java -version

will show 1.6 after installing the developer preview but before changing the symbolic link. The DP changes the JRE - including the java binary - but doesn't change the JDK. JRun requests a JDK instance and gets the "old" 1.5 JDK (although Eclipse and other console Java apps will use 1.6 JDK).

A good way to check you got it right is to start ColdFusion from the console (e.g., ./jrun start cfusion) and JRun's console output will confirm the JDK version it picked up.

I'll also note that I did not need to remove tools.jar *after* fixing the JDK link (but I would have expected to need to remove it if I was running against Java 5).
by Sean Corfield on 08/16/2007 at 3:35:55 PM UTC
Ok, I honestly don't get your first paragraph there. DP?

But - I started CF, went to settings, and saw 1.6 there. So I'm assuming I'm good to go.
by Raymond Camden on 08/16/2007 at 3:46:21 PM UTC
@Sean - you're right doing the java -version is not a valid test to see if the JDK was changed, I will update my blog entry to use ./CurrentJDK/Home/bin/java -version instead

@Ray - DP stands for developer preview. Did you try running the web service example?
by Pete Freitag on 08/16/2007 at 3:55:17 PM UTC
Yep, works like a charm.
by Raymond Camden on 08/16/2007 at 4:19:10 PM UTC
Hmm...haven't been able to duplicate the problem. I am running the following:

OS X 10.4.10
Java 1.5.0_07
Apache 2.2.4
JBoss 4.2.1
ColdFusion 8

I used the same code as above and ran without error. Are you using Jrun?
by Robert Burns on 08/16/2007 at 6:41:47 PM UTC
Just to point out the obvious: Apple JDK 1.6 is not final and not on our supported system requirements list (Apple JDK 1.5 is).

Damon
by Damon Cooper on 08/16/2007 at 7:21:05 PM UTC
@Robert Yes, I'm using JRun

@Damon Good Point, but do you have any insight as to why I might have been getting that error (I'm not the only one search the web)
by Pete Freitag on 08/16/2007 at 7:55:09 PM UTC
I would bet it is more Jrun related than the JRE. Not to get off topic....but, what are the chances I can convince you other mac users to start using JBoss? No installs needed, just drag and drop! Need it on another machine...drag and drop. Works great!
by Robert Burns on 08/16/2007 at 8:18:41 PM UTC
@Robert, the CF8 install with JBoss is a lot more work than the CF8 install with JRun. JRun / CF8 work together to allow multiple instances / clustering, all auto-managed via the JRun / CF8 admin consoles. JRun allows you to have your webroot outside the JRun install tree (no one has ever been able to show me a way to make that work with JBoss).

For localhost development, I would never recommend the JBoss route - and I've worked with JBoss in production systems quite a bit.
by Sean Corfield on 08/16/2007 at 9:38:34 PM UTC
I blogged about this a while back.
http://coldfused.blogspot.com/2007/08/coldfusion-and-webservice-file-has.html

If you want to use JDK1.5, you would need to replace lib/tools.jar with 1.5's tools.jar.
by Rupesh kumar on 08/17/2007 at 1:04:23 AM UTC
I'll back up Robert on this one Sean. Jboss is incredibly easy to use for a development environment. Drop jboss somewhere, drop the cfusion.war in the deploy and you're done. If you want your root outside the jboss install tree edit the tomcat server.xml and add a mapping to your context root. I'm not doing this right now but someone else on my team is and it seems to work. You can also use mod_jk to connect to Apache (like Bob is doing) and then point multiple Virtual Apache servers inside the single war deploy so you don't have to run multiple wars.
by Adam Haskell on 08/17/2007 at 6:42:15 AM UTC
I was thinking a bit more about why some folks didn't have this problem running on other J2EE servers, and I think it is probably due to the classloaders (which is also why I had to delete tools.jar, and it worked fine). To fix this problem all I probably had to do was remove tools.jar, since I think they are part of the classpath by default on Mac (it's in classes.jar I think).

Anyways thanks for all the comments, I am using JRun in multi-server mode, and I am also connecting to Apache... I will have to give JBoss a try at some point as well.
by Pete Freitag on 08/17/2007 at 7:13:49 AM UTC
@Adam, I'm sorry dude but you cannot convince me that all that downloading, unzipping, copying / moving files and manually editing httpd.conf for mod_jk etc is easier than double-clicking the CF8 installer and having it do everything for you.

The multiserver instance management built into CF is great - something you lose with JBoss.
by Sean Corfield on 08/18/2007 at 1:45:33 PM UTC
@Mark, I dont understand why this made you go back to 7? Doesn't replacing tools.jar work for you? CF ships with tools.jar that is compatible with the JVM that we ship(1.6). And we clearly document that in case you use any other JVM, you should replace tools.jar with the appropriate version.

Regarding your suggestion of installing appropriate version of tools.jar, thats not possible at all. For standalone CF, there is no issue because it is a complete install where we install JVM as well. Issue comes with J2EE installation where installer simply creates an ear or war which needs to be deployed on the J2ee server. We wouldnt know which J2EE server you are going to install it on and what version of JVM that server will run on.

And there hasn't been any change in JVM version or tools.jar or webservices between public beta and final version.
by Rupesh on 08/22/2007 at 12:59:19 AM UTC
Pete, I just downgraded to Java 5 - see my blog post on the class loading issue - and I have no problem running that web service code.
by Sean Corfield on 12/06/2007 at 9:36:37 AM UTC
If you don't mind my bringing up a different web service issue, I installed CF8 on a 10.5.5 system, installed Dreamweaver, and am trying to execute the following:

cfobject webservice="http://codex.corp.adobe.com/codex/codex.wsdl" name="wsObj"


(brackets omitted so I could post) and get the error: "java.lang.UnsatisfiedLinkError: no ntvinv in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1753)". I'm running on a MacBook Pro, 2.6 GHz Intel Core 2 Duo.

I'm beginning to suspect that jrun (or some other related software) thinks it's running on a Windows machine, as the only web references I can find mention ntvinv.dll. Any idea what might be going on?
by Greg Hansen on 12/22/2008 at 10:59:23 PM UTC
Ok, I know this is about a year later for this post but I cannot get CF8 to register or use webservices. I've tried several different ones that I am able to display using a browser and a SOAP client so I know they are good. Any help would be appreciated. Below is my environment and settings

Thanks,

Mark
Server Product ColdFusion
Version 8,0,1,195765
Edition Developer
Serial Number Developer
Operating System Mac OS X
OS Version 10.5.7
JVM Details
Java Version 1.6.0_07
Java Vendor Apple Inc.
Java Vendor URL http://www.apple.com/
Java Home /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
Java File Encoding MacRoman
Java Default Locale en_US
File Separator /
Path Separator :
Line Separator Chr(10)
User Name Mark
User Home /Users/Mark
User Dir /Applications/ColdFusion8/runtime/bin
Java VM Specification Version 1.0
Java VM Specification Vendor Sun Microsystems Inc.
Java VM Specification Name Java Virtual Machine Specification
Java VM Version 1.6.0_07-b06-57
Java VM Vendor Apple Inc.
Java VM Name Java HotSpot(TM) 64-Bit Server VM
Java Specification Version 1.6
Java Specification Vendor Sun Microsystems Inc.
Java Specification Name Java Platform API Specification
Java Class Version 50.0
by Mark A Knox on 05/21/2009 at 7:04:40 PM UTC
I just has this problem.My environment such as JDK1.6,Tomcat5.0.28 and Myeclipse6.5. Could somebody help me? And my e-mail is [email protected] problem as:[org.apache.jasper.compiler.Compiler]-[ERROR] Javac exception
Error starting modern compiler
at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:69)
at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:942)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at com.thunisoft.summer.web.filter.UserAASFilter.doFilter(UserAASFilter.java:77)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at com.thunisoft.summer.web.filter.CharsetFilter.doFilter(CharsetFilter.java:48)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:61)
... 41 more
Caused by: java.lang.NoClassDefFoundError: javax/tools/StandardJavaFileManager
by yangkyy on 03/16/2010 at 9:41:44 PM UTC