6 Replies Latest reply on Mar 7, 2012 4:54 PM by gutierrez.ge

    WebService Client Fails to deploy - Metro + Spring - Classloading

    gutierrez.ge

      Hi guys,

       

      I have this webservice with Metro and Spring that consumes another WebService, but when deploying it into JBoss it fails.

       

      I'm using the following stack of technologies

       

      JBoss Server: jboss4.3CP09/jboss-as

      Frameworks: Spring 2.5.5 + Metro 2.1.7 (jaxws-rt)

       

      This is the error I've been gettin (I'm sumaryzing the most important lines):

       

      javax.xml.ws.WebServiceException: Unable to load Provider: Failed to load javax.xml.ws.spi.Provider: com.sun.xml.ws.spi.ProviderImpl

       

      Caused by: java.lang.IllegalStateException: Failed to load javax.xml.ws.spi.Provider: com.sun.xml.ws.spi.ProviderImpl

              at javax.xml.ws.spi.ProviderLoader.loadProvider(ProviderLoader.java:96)

              at javax.xml.ws.spi.Provider.provider(Provider.java:90)

              ... 171 more

       

      Caused by: java.lang.NoClassDefFoundError: Ljavax/xml/bind/JAXBContext;

       

      This is how I'm creating the client with Spring

       

      <bean id="pcWS" class="org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean">

              <property name="serviceInterface" value="${pc.interfaceName}" />

              <property name="endpointAddress" value="${pc.endpoint}" />

              <property name="wsdlDocumentUrl" value="${pc.wsdl}" />

              <property name="namespaceUri" value="${pc.namespace}" />

              <property name="serviceName" value="${pc.serviceName}" />

      </bean>

       

      It is worth mention that I ran into another issue with another set of applications using Spring and CXF hosted under the same jboss installation, where the solution was to remove jaxb-api.jar from ${jboss.lib.url}/lib/endorsed directory and that is working good.

       

      Thanks on advance your comments.