2 Replies Latest reply on Dec 14, 2011 7:50 AM by Robert Stupp

    JBossWS/AS7 - WebService class loading / deployment modules

    Robert Stupp Newbie

      Hi,

       

      I am a bit confused about how webservice integration in AS7 depends on sub-deployment "containers".

       

      I have an EAR that contains a WAR to be deployed.

      - The EAR lib/ folder contains all stuff generated from a WSDL (using JAXWS-RI)

      - The WAR contains an annotated webservice class (class with a @WebService annotation) plus another webservice implementation for the WSDL mentioned above

      - The web.xml file (+webservices.xml +mappings.xml) mentions both webservices and both work fine.

       

      If I move the annotated webservice class and the other webservice implementation class files (JARs) from the WAR to EAR's lib directory, a lot of strange warnings like

      10:38:56,124 WARN  [org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder] (MSC service thread 1-1) Guess java type from package mapping: [xmlType={NAMESPACE}XSDObject javaType=com.mycompany.LocationSearchRequest]

      occur during startup and both webservices are not accessible:

       

      The annotated webservice says:

       

      10:43:28,830 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/demo].[SuperService]] (http--127.0.0.1-8080-1) Allocate exception for servlet SuperService: java.lang.ClassCastException: com.mycompany.MySuperWebservice cannot be cast to javax.servlet.Servlet
              at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1156) [jbossweb-7.0.4.Final.jar:]
              at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:952) [jbossweb-7.0.4.Final.jar:]
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:188) [jbossweb-7.0.4.Final.jar:]
      

       

      The webservice implementation says:

       

      10:43:32,204 ERROR [org.jboss.wsf.stack.jbws.RequestHandlerImpl] (http--127.0.0.1-8080-1) Error processing web service request: org.jboss.ws.WSException: org.jboss.xb.binding.JBossXBRuntimeException: Failed to find read method or field for property 'genericData' in class com.mycompany.gen.PingResponse
              at org.jboss.ws.WSException.rethrow(WSException.java:68)
              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:378)
              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:224)
              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:149)
              at org.jboss.ws.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:91)
              at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:162)
              at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140) [jbossws-spi-2.0.0.CR1.jar:]
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:]
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.4.Final.jar:]
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.4.Final.jar:]
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.4.Final.jar:]
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.4.Final.jar:]
              at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:151) [jboss-as-web-7.1.0.CR1-SNAPSHOT.jar:]
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.4.Final.jar:]
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.4.Final.jar:]
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.4.Final.jar:]
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.4.Final.jar:]
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.4.Final.jar:]
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.4.Final.jar:]
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.4.Final.jar:]
              at java.lang.Thread.run(Thread.java:662) [:1.6.0_27]
      Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Failed to find read method or field for property 'genericData' in class com.mycompany.gen.PingResponse
              at org.jboss.xb.binding.introspection.ClassInfo.getFieldInfo(ClassInfo.java:82)
              at org.jboss.xb.binding.introspection.FieldInfo.getFieldInfo(FieldInfo.java:155)
              at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.getJavaValue(MarshallerImpl.java:1267)
              at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.getChildren(MarshallerImpl.java:1257)
              at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.getElementValue(MarshallerImpl.java:1187)
              at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalParticle(MarshallerImpl.java:757)
              at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalModelGroupSequence(MarshallerImpl.java:970)
              at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalModelGroup(MarshallerImpl.java:910)
              at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalParticle(MarshallerImpl.java:656)
              at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalModelGroupSequence(MarshallerImpl.java:970)
              at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalModelGroup(MarshallerImpl.java:910)
              at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalParticle(MarshallerImpl.java:656)
              at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalComplexType(MarshallerImpl.java:619)
              at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalElementType(MarshallerImpl.java:430)
              at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalElement(MarshallerImpl.java:329)
              at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshalElementOccurence(MarshallerImpl.java:309)
              at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshallInternal(MarshallerImpl.java:200)
              at org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshal(MarshallerImpl.java:157)
              at org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBMarshallerImpl.marshal(JBossXBMarshallerImpl.java:147)
              at org.jboss.ws.core.jaxrpc.binding.JBossXBSerializer.serialize(JBossXBSerializer.java:105)
              at org.jboss.ws.core.binding.SerializerSupport.serialize(SerializerSupport.java:56)
              at org.jboss.ws.core.soap.ObjectContent.marshallObjectContents(ObjectContent.java:171)
              at org.jboss.ws.core.soap.ObjectContent.transitionTo(ObjectContent.java:78)
              at org.jboss.ws.core.soap.SOAPContentElement.transitionTo(SOAPContentElement.java:146)
              at org.jboss.ws.core.soap.SOAPContentElement.writeElement(SOAPContentElement.java:587)
              at org.jboss.ws.core.soap.SOAPElementImpl.writeElementContent(SOAPElementImpl.java:924)
              at org.jboss.ws.core.soap.SOAPElementImpl.writeElement(SOAPElementImpl.java:909)
              at org.jboss.ws.core.soap.SOAPElementImpl.writeElementContent(SOAPElementImpl.java:924)
              at org.jboss.ws.core.soap.SOAPElementImpl.writeElement(SOAPElementImpl.java:909)
              at org.jboss.ws.core.soap.SOAPElementImpl.writeElementContent(SOAPElementImpl.java:924)
              at org.jboss.ws.core.soap.SOAPElementImpl.writeElement(SOAPElementImpl.java:909)
              at org.jboss.ws.core.soap.SOAPElementWriter.writeElementInternal(SOAPElementWriter.java:150)
              at org.jboss.ws.core.soap.SOAPElementWriter.writeElement(SOAPElementWriter.java:131)
              at org.jboss.ws.core.soap.SOAPMessageImpl.writeTo(SOAPMessageImpl.java:429)
              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.sendResponse(RequestHandlerImpl.java:457)
              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:373)
              ... 19 more
      

       

      Is this a bug or is it not possible to place the webservice implementations outside the WAR, if referenced in web.xml ?

       

      Robert