You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by martin11 <ma...@gmail.com> on 2013/05/11 00:49:54 UTC

CXF stop working after upgrade to 2.11

Hello,

after upgrade Camel from 2.10.4 to 2.11.0 I got an exception:
Caused by: java.lang.ClassNotFoundException:
org.apache.cxf.common.util.PropertyUtils
	at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
~[na:1.6.0_26]
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)


>From maven dependency:tree I see that camel 2.11 use CXF in version 2.7.4.
So then I upgrade cxf-rt-transports-http-jetty from version 2.6.6 to 2.7.4
and Tomcat started without errors but
when I call my web service I got another exception:
java.lang.NoClassDefFoundError: javax/servlet/AsyncContext
	at
org.eclipse.jetty.server.AbstractHttpConnection.<init>(AbstractHttpConnection.java:157)
~[jetty-server-8.1.7.v20120910.jar:8.1.7.v20120910]
	at
org.eclipse.jetty.server.AsyncHttpConnection.<init>(AsyncHttpConnection.java:50)
~[jetty-server-8.1.7.v20120910.jar:8.1.7.v20120910]

What has been changed in CXF, HTTP, SERVLET or any other component that my
CXF web-service does not work anymore?

<properties>
    <cxf.version>2.6.6</cxf.version>
    <camel.version>2.11.0</camel.version>
</properties>
<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-core</artifactId>
    <version>${camel.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-http</artifactId>
    <version>${camel.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-servlet</artifactId>
    <version>${camel.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-cxf</artifactId>
    <version>${camel.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-transports-http-jetty</artifactId>
    <version>${cxf.version}</version>
</dependency>

Thanks for any advice or suggestions.

--
Martin



--
View this message in context: http://camel.465427.n5.nabble.com/CXF-stop-working-after-upgrade-to-2-11-tp5732307.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CXF stop working after upgrade to 2.11

Posted by martin11 <ma...@gmail.com>.
Hi Claus, 

thanks for good hint. I changed dependencies:

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-cxf</artifactId>
    <version>${camel.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-transports-http</artifactId>
    <version>${cxf.version}</version>
</dependency>

and I got new exception:

Caused by: java.io.IOException: Cannot find any registered
HttpDestinationFactory from the Bus.
	at
org.apache.cxf.transport.http.HTTPTransportFactory.getDestination(HTTPTransportFactory.java:295)
	at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:142)

Finaly I found a solution. Maybe will be useful to somebody:

At first, I missed CXF servlet configuration in web.xml:

<servlet>
    <servlet-name>CXFServlet</servlet-name>
   
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>CXFServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
</servlet-mapping>

And the next point is to configure cxfEndpoint:
I thought that the address is in format "http://localhost:8080/roleservice".
But is not, just have to use "/roleservice" because of tomcat http transport
and not jetty..

<cxf:cxfEndpoint id="serviceEndpoint"
                 address="roleservice"
                 serviceClass="com.test.schemas.role.RoleEndpoint"
                 wsdlURL="service/ws-role.wsdl"
                 endpointName="s:RoleService"
                 serviceName="s:RoleEndpointService"
                 xmlns:s="http://www.test.com/schemas/Role"/>



--
View this message in context: http://camel.465427.n5.nabble.com/CXF-stop-working-after-upgrade-to-2-11-tp5732307p5732352.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CXF stop working after upgrade to 2.11

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

If you run the app in Tomcat, then you should use the CXF servlet transport

    <artifactId>cxf-rt-transports-http-servlet</artifactId>

And NOT the jetty

    <artifactId>cxf-rt-transports-http-jetty</artifactId>

You can find more details about the CXF servlet transport at the CXF web site.


On Sat, May 11, 2013 at 12:49 AM, martin11 <ma...@gmail.com> wrote:
> Hello,
>
> after upgrade Camel from 2.10.4 to 2.11.0 I got an exception:
> Caused by: java.lang.ClassNotFoundException:
> org.apache.cxf.common.util.PropertyUtils
>         at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> ~[na:1.6.0_26]
>         at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
>
>
> From maven dependency:tree I see that camel 2.11 use CXF in version 2.7.4.
> So then I upgrade cxf-rt-transports-http-jetty from version 2.6.6 to 2.7.4
> and Tomcat started without errors but
> when I call my web service I got another exception:
> java.lang.NoClassDefFoundError: javax/servlet/AsyncContext
>         at
> org.eclipse.jetty.server.AbstractHttpConnection.<init>(AbstractHttpConnection.java:157)
> ~[jetty-server-8.1.7.v20120910.jar:8.1.7.v20120910]
>         at
> org.eclipse.jetty.server.AsyncHttpConnection.<init>(AsyncHttpConnection.java:50)
> ~[jetty-server-8.1.7.v20120910.jar:8.1.7.v20120910]
>
> What has been changed in CXF, HTTP, SERVLET or any other component that my
> CXF web-service does not work anymore?
>
> <properties>
>     <cxf.version>2.6.6</cxf.version>
>     <camel.version>2.11.0</camel.version>
> </properties>
> <dependency>
>     <groupId>org.apache.camel</groupId>
>     <artifactId>camel-core</artifactId>
>     <version>${camel.version}</version>
> </dependency>
> <dependency>
>     <groupId>org.apache.camel</groupId>
>     <artifactId>camel-http</artifactId>
>     <version>${camel.version}</version>
> </dependency>
> <dependency>
>     <groupId>org.apache.camel</groupId>
>     <artifactId>camel-servlet</artifactId>
>     <version>${camel.version}</version>
> </dependency>
> <dependency>
>     <groupId>org.apache.camel</groupId>
>     <artifactId>camel-cxf</artifactId>
>     <version>${camel.version}</version>
> </dependency>
> <dependency>
>     <groupId>org.apache.cxf</groupId>
>     <artifactId>cxf-rt-transports-http-jetty</artifactId>
>     <version>${cxf.version}</version>
> </dependency>
>
> Thanks for any advice or suggestions.
>
> --
> Martin
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/CXF-stop-working-after-upgrade-to-2-11-tp5732307.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen