You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Magyar Zoltán <zo...@freemail.hu> on 2019/06/25 13:19:01 UTC

ClassNotFoundException cxfrs + cxfws.

Hi, the scenario is a simple cxfrs endpoint from that passing message to a cxf ws.env: WildFly-Camel 4.9.0 the error message:java.lang.ClassNotFoundException: hu.fornax.olir3.dms.producer.UTPasswordCallback CxfEndpoint with password callback:     @Named("dmsProducerEndpoint")
    @Produces
    public CxfEndpoint createCxfProducerEndpoint() {
        CxfComponent cxfProducerComponent = new CxfComponent(this.camelContext);

        CxfEndpoint cxfProducerEndpoint = new CxfEndpoint(CXF_ENDPOINT_URI, cxfProducerComponent);
....
        Map<String, Object> outProps = new HashMap<String, Object>();
        outProps.put("action", "UsernameToken");
        outProps.put("passwordType", "PasswordText");
        outProps.put("mustUnderstand", "0");

        outProps.put("user", "zz-OLIR3-svc");
        outProps.put("passwordCallbackClass", "hu.fornax.olir3.dms.producer.UTPasswordCallback");

        WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
        cxfProducerEndpoint.getOutInterceptors().add(wssOut);

        return cxfProducerEndpoint;
    } the route is:         from("direct:dmsCall")
                .log(ESBLog.DMS + " sending DMS request body  ${headers}")
                .to(this.dmsProducerEndpoint)
                .log(ESBLog.DMS + " received DMS response body  ${headers}");

        from("cxfrs:http://localhost:8080/olir3-dms2/rest?resourceClasses=hu.fornax.olir3.dms.producer.GreetingServiceRS&loggingFeatureEnabled=true")
                .log(ESBLog.DMS + "incoming REST request: ${body} ${headers}")
                .bean("dmsRESTImpl");  The UTPasswordCallback class is in the war and checking with org.jboss.modules:add(level=TRACE)  loaded by classloader!- Removing cxfrs endpoint the class founded.- If I put a spring beans in the project that contains a cxfConsumer it works correctly but the ws consumer should be realize in an other service. The full source with deployed war pushed to Gitlab:https://gitlab.com/topicfun/mycxfrstest  How can I avoid the exception without ws consumer?I have read a lot about WildFly classloading but up to now I didn&#39;t find any information how I can investigate to solve similar problems? Thanks your help in advance!     

Re: ClassNotFoundException cxfrs + cxfws.

Posted by Zoltán Balogh <zo...@freemail.hu>.
Hi,

the scenario is a simple cxfrs endpoint from that passing message to a cxf ws.
env: WildFly-Camel 4.9.0

the error message:
java.lang.ClassNotFoundException:
hu.fornax.olir3.dms.producer.UTPasswordCallback

CxfEndpoint with password callback:

    @Named("dmsProducerEndpoint")
    @Produces
    public CxfEndpoint createCxfProducerEndpoint() {
        CxfComponent cxfProducerComponent = new CxfComponent(this.camelContext);

        CxfEndpoint cxfProducerEndpoint = new
CxfEndpoint(CXF_ENDPOINT_URI, cxfProducerComponent);
....
        Map<String, Object> outProps = new HashMap<String, Object>();
        outProps.put("action", "UsernameToken");
        outProps.put("passwordType", "PasswordText");
        outProps.put("mustUnderstand", "0");

        outProps.put("user", "zz-OLIR3-svc");
        outProps.put("passwordCallbackClass",
"hu.fornax.olir3.dms.producer.UTPasswordCallback");

        WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
        cxfProducerEndpoint.getOutInterceptors().add(wssOut);

        return cxfProducerEndpoint;
    }

the route is:

        from("direct:dmsCall")
                .log(ESBLog.DMS + " sending DMS request body  ${headers}")
                .to(this.dmsProducerEndpoint)
                .log(ESBLog.DMS + " received DMS response body  ${headers}");

        from("cxfrs:http://localhost:8080/olir3-dms2/rest?resourceClasses=hu.fornax.olir3.dms.producer.GreetingServiceRS&loggingFeatureEnabled=true")
                .log(ESBLog.DMS + "incoming REST request: ${body} ${headers}")
                .bean("dmsRESTImpl");


The UTPasswordCallback class is in the war and checking with
org.jboss.modules:add(level=TRACE)  loaded by classloader!
- Removing cxfrs endpoint the class founded.
- If I put a spring beans in the project that contains a cxfConsumer
it works correctly but the ws consumer should be realize in an other
service.

The full source with deployed war pushed to Gitlab:
https://gitlab.com/topicfun/mycxfrstest

How can I avoid the exception without ws consumer?
I have read a lot about WildFly classloading but up to now I didn't
find any information how I can investigate to solve similar problems?

Thanks your help in advance!