Re: Apache CXF wsdl2java with gcc

Andrew Haley <[email protected]>
Newsgroups gmane.comp.gcc.java.devel
Message-ID <[email protected]>
David Michel wrote:

> There is an issue with gcc 4.2.4 while trying to use the CXF
> (http://cxf.apache.org/index.html) libraries and tools for
> web-services, specifically using the wsdl2java tool.
> 
> While with Sun's java, there is no problem:
> 
> $ export JAVA_HOME=/usr/lib/jvm/java-6-sun/
> $ ./wsdl2java
> Missing argument: wsdlurl
> 
> Usage : wsdl2java -fe <front-end-name>* -db <data-binding-name>* -wv
> <wsdl-version>* -p <[wsdl-namespace =]package-name>* -sn
> <service-name> -b <binding-file-name>* -catalog <catalog-file-name> -d
> <output-directory> -compile -classdir <compile-classes-directory>
> -impl -server -client -all -autoNameResolution
> -allowElementReferences<=true>
> -defaultValues<=class-name-for-DefaultValueProvider> -ant -nexclude
> <schema-namespace [= java-package-name]>* -exsh <(true, false)> -dns
> <Default value is true> -dex <(true, false)> -validate -keep
> -wsdlLocation <wsdlLocation> -xjc<xjc-arguments> -noAddressBinding -h
> -v -verbose -quiet -wsdlList <wsdlurl>
> 
> When using the gcc jvm, I get this:
> 
> $ JAVA_HOME=/usr/lib/jvm/java-gcj/
> $ ./wsdl2java
> Exception in thread "main" java.lang.Error:
> javax.xml.datatype.DatatypeConfigurationException:
> java.lang.ClassNotFoundException: gnu.xml.datatype.JAXPDatatypeFactory
>    at com.sun.xml.bind.DatatypeConverterImpl.<clinit>(DatatypeConverterImpl.java:833)

This really is weird.  Where is your DatatypeConverterImpl coming from?
java -verbose:class will tell you.  I think you've got some sort of mix
of classes from implementations.

>    at java.lang.Class.initializeClass(natClass.cc:780)
>    at com.sun.xml.bind.v2.runtime.JAXBContextImpl$3.run(JAXBContextImpl.java:287)
>    at com.sun.xml.bind.v2.runtime.JAXBContextImpl$3.run(JAXBContextImpl.java:286)
>    at java.security.AccessController.doPrivileged(AccessController.java:96)
>    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:285)
>    at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1136)
>    at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
>    at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)
>    at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:202)
>    at java.lang.reflect.Method.invoke(natMethod.cc:205)
>    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:133)

This is a private class that's part of Sun's JAXB.

It seems to me that you aren't really running gcj.  Simply changing
JAVA_HOME doesn't control which Java you're using.

Andrew.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.