This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Web Services and the fly likes [java] java. lang.NoClassDefFoundError:  javax.xml.transform. Source Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "[java] java. lang.NoClassDefFoundError:  javax.xml.transform. Source" Watch "[java] java. lang.NoClassDefFoundError:  javax.xml.transform. Source" New topic

[java] java. lang.NoClassDefFoundError: javax.xml.transform. Source

Bunny Singh

Joined: Oct 28, 2002
Posts: 6
I m trying to run a JAXRPC example from the java webservices development kit. I have been able to deploy the server side and do everything but run the client. The moment I do ant run I get an error as given below. Also The "Source" is supposed to be in xalan.jar but I find it in jaxp-api.jar. This is vital for me .
Plz help what m I doing wrong. Thanx a Ton
C:\jwsdp-1.1\docs\tutorial\examples\jaxrpc\hello>ant run
Buildfile: build.xml
[echo] Running the hello.HelloClient program....
[java] java.lang.NoClassDefFoundError: javax.xml.transform.Source
[java] at com.sun.xml.rpc.encoding.soap.StandardSOAPTypeMappings.class$
[java] at com.sun.xml.rpc.encoding.soap.StandardSOAPTypeMappings.<init>
[java] at com.sun.xml.rpc.encoding.StandardTypeMappings.getSoap(Standar
[java] at com.sun.xml.rpc.client.BasicService.createSoapMappings(BasicS
[java] at com.sun.xml.rpc.client.BasicService.createStandardTypeMapping
[java] at hello.MyHello_SerializerRegistry.getRegistry(MyHello_Serializ
[java] at hello.MyHello_Impl.<init>(
[java] at hello.HelloClient.createProxy(Unknown Source)
[java] at hello.HelloClient.main(Unknown Source)
[java] Exception in thread "main"
[java] Java Result: 1
Total time: 1 second
Bunny Singh

Joined: Oct 28, 2002
Posts: 6
nebody at the ranch...??? :roll:
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13025
Classically speaking, you get that kind of error when there is some sort of clash of jar versions. The Java equivalent of "DLL hell."
Probably, somewhere else on your system is a jar of an earlier version that has com.sun.xml.* class files - for some reason the JVM is finding that jar before the one you want to use.
Bunny Singh

Joined: Oct 28, 2002
Posts: 6
Hi William,
I also had some kind of idea of this problem. I searched for all the jar files and then tried locating the file "javax.xml.transform.Source". I could locate only in a jar called XML4J.jar inside lotus notes. However there is no other jar file containing the above mentioned class file. I m still getting the same problem. Plz throw some light
Amol Desai
Ranch Hand

Joined: Jan 29, 2003
Posts: 82
Try setting the jaxrpc-api.jar to your classpath
in your build.xml file
In your build.xml say the target is run, then add classpath to your java element
<target name="run">
<java classpath="c:/jwsdp1.2/jaxrpc-1.3\lib\jaxrpc-api.jar:${build.classpath}"
classname="..." >
San-Yih Pan
Ranch Hand

Joined: Nov 04, 2004
Posts: 30

I encountered the similar error message in Unix. The machine only has but no jaxrpc-api.jar. How to fix it?

[java] Exception in thread "main" java.lang.NoClassDefFoundError: javax.xml.transform.Source
[java] at org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory.class$(
[java] at org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory.getSerializerClass(
[java] at org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory.<init>(
[java] at org.apache.axis.encoding.DefaultTypeMappingImpl.initMappings(
[java] at org.apache.axis.encoding.DefaultTypeMappingImpl.<init>(
[java] at org.apache.axis.encoding.DefaultTypeMappingImpl.getSingletonDelegate(
[java] at org.apache.axis.encoding.TypeMappingRegistryImpl.<init>(
[java] at org.apache.axis.encoding.TypeMappingRegistryImpl.<init>(
[java] at org.apache.axis.wsdl.toJava.Emitter.<init>(
[java] at org.apache.axis.wsdl.WSDL2Java.createParser(
[java] at org.apache.axis.wsdl.gen.WSDL2.<init>(
[java] at org.apache.axis.wsdl.WSDL2Java.<init>(
[java] at org.apache.axis.wsdl.WSDL2Java.main(
[java] Java Result: 1
[java] Exception in thread "main" java.lang.NoClassDefFoundError: javax.xml.transform.Source
[java] at org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory.class$(
I agree. Here's the link:
subject: [java] java. lang.NoClassDefFoundError: javax.xml.transform. Source
It's not a secret anymore!