You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Lenden <ro...@gmail.com> on 2012/11/14 16:15:52 UTC

Class loader issue with WebService Client

Hi everyone,
when I run my WS Client Test, i've this error message:

Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/ws/commons/schema/utils/NamespacePrefixList
	at
org.apache.cxf.jaxws.JaxWsClientFactoryBean.<init>(JaxWsClientFactoryBean.java:38)
	at
org.apache.cxf.jaxws.JaxWsProxyFactoryBean.<init>(JaxWsProxyFactoryBean.java:68)
        ........

Caused by: java.lang.ClassNotFoundException:
org.apache.ws.commons.schema.utils.NamespacePrefixList
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

        at this line:
        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); 



--
View this message in context: http://cxf.547215.n5.nabble.com/Class-loader-issue-with-WebService-Client-tp5718443.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Class loader issue with WebService Client

Posted by Lenden <ro...@gmail.com>.
@GlenMazza  Thank you for your advices.
@DanielKulp Actually, i'm using 2.5.3 version since the beginning



--
View this message in context: http://cxf.547215.n5.nabble.com/Class-loader-issue-with-WebService-Client-tp5718443p5718486.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Class loader issue with WebService Client

Posted by Daniel Kulp <dk...@apache.org>.
You likely have an old version of XmlSchema on the classpath.   Recent versions of CXF all require a 2.0 version.   It looks like you may have a 1.x version on the classpath.

Dan



On Nov 14, 2012, at 10:15 AM, Lenden <ro...@gmail.com> wrote:

> Hi everyone,
> when I run my WS Client Test, i've this error message:
> 
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/ws/commons/schema/utils/NamespacePrefixList
> 	at
> org.apache.cxf.jaxws.JaxWsClientFactoryBean.<init>(JaxWsClientFactoryBean.java:38)
> 	at
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean.<init>(JaxWsProxyFactoryBean.java:68)
>        ........
> 
> Caused by: java.lang.ClassNotFoundException:
> org.apache.ws.commons.schema.utils.NamespacePrefixList
> 	at java.net.URLClassLoader$1.run(Unknown Source)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at java.net.URLClassLoader.findClass(Unknown Source)
> 	at java.lang.ClassLoader.loadClass(Unknown Source)
> 	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> 
>        at this line:
>        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); 
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Class-loader-issue-with-WebService-Client-tp5718443.html
> Sent from the cxf-user mailing list archive at Nabble.com.

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: Class loader issue with WebService Client

Posted by Glen Mazza <gm...@talend.com>.
If you wish to use Ant (we recommend Maven, as all of our samples save 
one use it exclusively), we have an "antbuild" sample in the CXF 
distribution you should first confirm works on your end, then extend it 
to your own work.  If your preference for Ant is primarily because you 
don't know Maven yet, I'd first take a short amount of time to learn it 
( http://www.jroller.com/gmazza/entry/web_service_tutorial or any of the 
other CXF examples), it's a very useful tool that will also speed up 
your web services work.

Glen

On 11/14/2012 10:45 AM, Lenden wrote:
> Well I've a folder with a wsdl file and some XSD files, and I build my
> project with ant, where I'm calling CFX's tool : wsdl2java
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Class-loader-issue-with-WebService-Client-tp5718443p5718446.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Glen Mazza
Talend Community Coders - coders.talend.com
blog: www.jroller.com/gmazza


Re: Class loader issue with WebService Client

Posted by Lenden <ro...@gmail.com>.
Well I've a folder with a wsdl file and some XSD files, and I build my
project with ant, where I'm calling CFX's tool : wsdl2java



--
View this message in context: http://cxf.547215.n5.nabble.com/Class-loader-issue-with-WebService-Client-tp5718443p5718446.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Class loader issue with WebService Client

Posted by Glen Mazza <gm...@talend.com>.
Obviously a necessary class is missing, meaning there is a classpath 
problem.  But absent any information how you've built your project 
(Eclipse? Maven? Ant?) I don't think I can provide more help.  Have you 
gotten any of CXF's bundled samples to work?  My SOAP client tutorial 
can provide another working example: 
http://www.jroller.com/gmazza/entry/soap_client_tutorial

Glen

On 11/14/2012 10:15 AM, Lenden wrote:
> Hi everyone,
> when I run my WS Client Test, i've this error message:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/ws/commons/schema/utils/NamespacePrefixList
> 	at
> org.apache.cxf.jaxws.JaxWsClientFactoryBean.<init>(JaxWsClientFactoryBean.java:38)
> 	at
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean.<init>(JaxWsProxyFactoryBean.java:68)
>          ........
>
> Caused by: java.lang.ClassNotFoundException:
> org.apache.ws.commons.schema.utils.NamespacePrefixList
> 	at java.net.URLClassLoader$1.run(Unknown Source)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at java.net.URLClassLoader.findClass(Unknown Source)
> 	at java.lang.ClassLoader.loadClass(Unknown Source)
> 	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>
>          at this line:
>          JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Class-loader-issue-with-WebService-Client-tp5718443.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Glen Mazza
Talend Community Coders - coders.talend.com
blog: www.jroller.com/gmazza