You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by asookazian <as...@gmail.com> on 2015/03/17 00:01:59 UTC

ClassNotFoundException: javax.ws.rs.client.ClientException

I am writing a RESTful client which runs on Apache Karaf 3.0.2 (as does the
JAX-RS REST service class).

I am getting the following exception:

Caused by: java.lang.ClassNotFoundException:
javax.ws.rs.client.ClientException
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
	... 3 more

when this line of code executes:

WebClient wc = WebClient.create("http://" + server + ":" + port +
"/foo/bar");

I am running my test in Eclipse.

I have looked but can't determine which JAR has this class
(javax.ws.rs.client.ClientException).

Please advise how to resolve.  thx.

Currently I have the following cxf dependencies in my pom.xml:

<dependency>
	      <groupId>org.apache.cxf</groupId>
	      <artifactId>cxf-rt-frontend-jaxrs</artifactId>
	      <version>2.7.13</version>
	    </dependency>
	    
	    <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
        </dependency>
        
        <dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-bundle-jaxrs</artifactId>
			<version>2.7.13</version>
		</dependency>
		
		<dependency>
		    <groupId>org.apache.cxf</groupId>
		    <artifactId>cxf-rt-frontend-jaxws</artifactId>
		    <version>2.7.13</version>
		</dependency>

		<dependency>
		    <groupId>org.apache.cxf</groupId>
		    <artifactId>cxf-rt-transports-http</artifactId>
		    <version>2.7.13</version>
		</dependency>



--
View this message in context: http://cxf.547215.n5.nabble.com/ClassNotFoundException-javax-ws-rs-client-ClientException-tp5755147.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: ClassNotFoundException: javax.ws.rs.client.ClientException

Posted by asookazian <as...@gmail.com>.
I just deployed the bundle to karaf and ran my ant target to invoke the
RESTful client method and everything was successful.  I guess the issue only
reproduces while running a test client in Eclipse.



--
View this message in context: http://cxf.547215.n5.nabble.com/ClassNotFoundException-javax-ws-rs-client-ClientException-tp5755147p5755151.html
Sent from the cxf-user mailing list archive at Nabble.com.