1 Reply Latest reply on Feb 28, 2013 9:35 AM by James Carter

    NoClassDefFoundError SAMLCallback (AS711 / CXF411)

    James Carter Newbie

      Hi,

       

      I'm trying to call a web service that requires SAML (Sender Vouches) using the JAX-WS API's - JBoss-WS (CXF 4.1.1) under JBoss AS 7.1.1. However I'm getting a NoClassDefFoundError, which I originally thought may have been due to my web app, but I've created a very simple ear and the same exception still shows.

       

      16:40:28,496 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/wssbroker].[com.acmecorp.ps.wss.WSSBroker]] (http-localhost-127.0.0.1-8080-1) Servlet.service() for servlet com.acmecorp.ps.wss.WSSBroker threw exception: java.lang.NoClassDefFoundError: org/apache/ws/security/saml/ext/SAMLCallback

          at com.acmecorp.ps.plugin.wss.handler.SamlCallbackHandler2.handle(SamlCallbackHandler2.java:32) [classes:]

          at org.apache.ws.security.saml.ext.AssertionWrapper.<init>(AssertionWrapper.java:225)

          at org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilder.addSamlToken(AbstractBindingBuilder.java:930)

          at org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilder.handleSupportingTokens(AbstractBindingBuilder.java:580)

          at org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilder.handleSupportingTokens(AbstractBindingBuilder.java:465)

          at org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilder.addSupportingTokens(AbstractBindingBuilder.java:2105)

          at org.apache.cxf.ws.security.wss4j.policyhandlers.AsymmetricBindingHandler.doSignBeforeEncrypt(AsymmetricBindingHandler.java:144)

          at org.apache.cxf.ws.security.wss4j.policyhandlers.AsymmetricBindingHandler.handleBinding(AsymmetricBindingHandler.java:98)

          at org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$PolicyBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.java:165)

          at org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$PolicyBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.java:89)

          at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)

          at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)

          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)

          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)

          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)

          at org.apache.cxf.endpoint.ClientImpl.invokeWrapped(ClientImpl.java:354)

          at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:385)

          at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:243)

          at com.acmecorp.ps.wss.WSSBroker.doGet(WSSBroker.java:125) [classes:]

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]

          at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]

          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]

      The relevant lines of my callback handler are:

       

      if (callbacks[i] instanceof SAMLCallback) {

                      SAMLCallback callback = (SAMLCallback) callbacks[i];

      Is there something I need to configure to expose these class for direct use? All the other JAX-WS API calls have delgated to their appropriate classes, but if I try to cast to the actual CXF implementations I get the same kind of error. For example this will error:

       

      Dispatch<Source> dispatch = (org.apache.cxf.jaxws.DispatchImpl<Source>) service.createDispatch(portName, Source.class, Service.Mode.PAYLOAD);

      Even though dispatch.getClass() = org.apache.cxf.jaxws.DispatchImpl

       

      I'm sure I'm just missing something obvious. Could someone point me in the right direction? Thank you!