1 Reply Latest reply on Oct 6, 2004 3:33 AM by thomas.diesler

    Help!! Problem with Web Service Developer Pack and JBoss

    gubenc

      Hi all,

      I would like to use the SUN Web Service developer pack v1.4 under
      JBoss 3.2.3 and JDK 1.4. I have a quite mistical class loading problem. I would be
      very happy if someone could help me. I describe the trieals i have made
      so far ant the error messages in detail.

      First of all WSDP 1.4 runs quite well in JBoss for basic funcions. I encountered an
      error first when I tried to use a Logger to log the SOAP messages.

      I got the following exception in the error log:

      [org.apache.axis.encoding.SerializationContextImpl] Start element [http://schemas.xmlsoap.org/soap/envelope/]:Envelo[org.apache.axis.i18n.ProjectResourceBundle] org.apache.axis.i18n.resource::handleGetObject(headers00)
      [org.apache.axis.message.SOAPHeader] 0 headers
      [org.apache.axis.i18n.ProjectResourceBundle]
      org.apache.axis.i18n.resource::handleGetObject(startElem00)[org.apache.axis.encoding.SerializationContextImpl] Start element [http://schemas.xmlsoap.org/soap/envelope/]:Body
      [org.apache.axis.utils.NSStack] NSPush (32)
      [org.apache.axis.i18n.ProjectResourceBundle] org.apache.axis.i18n.resource::handleGetObject(endElem00)
      [org.apache.axis.encoding.SerializationContextImpl] End element soapenv:Body
      [org.apache.axis.utils.NSStack] NSPop (32)
      [org.apache.axis.i18n.ProjectResourceBundle] org.apache.axis.i18n.resource::handleGetObject(endElem00)
      [org.apache.axis.encoding.SerializationContextImpl] End element soapenv:Envelope
      [org.apache.axis.i18n.ProjectResourceBundle] org.apache.axis.i18n.resource::handleGetObject(empty00)
      [org.apache.axis.utils.NSStack] NSPop (empty)
      <?xml version="1.0" encoding="UTF-8"?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body/>
      </soapenv:Envelope>
      com.sun.xml.rpc.server.http.JAXRPCServletDelegate doPost
      SEVERE: caught throwable
      java.lang.NoSuchMethodError: javax.xml.soap.SOAPHeader.examineMustUnderstandHeaderElements(Ljava/lang/String;)Ljava/util/Iterator;
      at com.sun.xml.rpc.client.HandlerChainImpl.checkMustUnderstand(HandlerChainImpl.java:242)
      at com.sun.xml.rpc.server.StreamingHandler.callRequestHandlers(StreamingHandler.java:901)
      at com.sun.xml.rpc.server.StreamingHandler.preHandlingHook(StreamingHandler.java:831)
      at com.sun.xml.rpc.server.StreamingHandler.handle(StreamingHandler.java:102)
      at com.sun.xml.rpc.server.http.JAXRPCServletDelegate.doPost(JAXRPCServletDelegate.java:443)
      at com.sun.xml.rpc.server.http.JAXRPCServlet.doPost(JAXRPCServlet.java:86)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.Applicatio

      I think this means that the javax.xml.soap.MessageFactory class
      use not the sun implementation I packaged with in the WEB-INF/lib
      directory but the one in apache axis, which comes with JBoss. So I first
      tried to reconfigure the factory explicitely. I decompiled the
      javax.xml.soap.MessageFactory class and the FactoryFinter class.
      The code to search for the factory implementation looks like this:

      ClassLoader classloader;
      try
      {
      classloader = Thread.currentThread().getContextClassLoader();
      }
      catch(Exception exception)
      {
      throw new SOAPException(exception.toString(), exception);
      }
      String s2 = System.getProperty(s);
      if(s2 != null)
      return newInstance(s2, classloader);
      break MISSING_BLOCK_LABEL_46;
      Object obj;
      obj;
      String s5;
      obj = System.getProperty("java.home");
      String s3 = obj + File.separator + "lib" + File.separator + "jaxm.properties";
      File file = new File(s3);
      if(!file.exists())
      break MISSING_BLOCK_LABEL_154;
      Properties properties = new Properties();
      properties.load(new FileInputStream(file));
      s5 = properties.getProperty(s);
      return newInstance(s5, classloader);
      obj;
      obj = "META-INF/services/" + s;
      String s4;
      java.io.InputStream inputstream = null;
      if(classloader == null)
      inputstream = ClassLoader.getSystemResourceAsStream(((String) (obj)));
      else
      inputstream = classloader.getResourceAsStream(((String) (obj)));
      if(inputstream == null)
      break MISSING_BLOCK_LABEL_264;
      BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(inputstream, "UTF-8"));
      s4 = bufferedreader.readLine();
      bufferedreader.close();
      if(s4 != null && !"".equals(s4))
      return newInstance(s4, classloader);
      break MISSING_BLOCK_LABEL_264;
      Exception exception1;
      exception1;
      if(s1 == null)
      throw new SOAPException("Provider for " + s + " cannot be found", null);
      else
      return newInstance(s1, classloader);

      I tried to place a file named javax.xml.soap.MessageFactory into my META-INF/services directory
      of the war file with the name of the SUN implementation
      (this can be found in the MessageFactory class in the SUN jar file 'saaj-api.jar').
      In this configuration I get the following exception:

      ava.lang.NoClassDefFoundError: com/sun/xml/messaging/saaj/soap/SOAPDocumentImpl
      at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.(SOAPPartImpl.java:52)
      at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.(SOAPPart1_1Impl.java:24)
      at com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl.getSOAPPart(Message1_1Impl.java:48)
      at com.sun.xml.rpc.soap.message.SOAPMessageContext.writeSimpleErrorResponse(SOAPMessageContex

      This is very strange. There are no axis messages in the log
      and It seems that I managed to get JBoss to use the SUN factory
      but the SUN implementation canntot load a class.
      SOAPPartImpl and SOAPDocumentImpl are in the same package the first
      could be loaded and the second could not.

      I got the same result when I removed the JBoss.net module from
      the deploy directory and restarted JBoss.

      I also tried to put the jar files not to my war file but simple copy all of them to the
      deploy directory. This rial resulted the following exception when I deployed the application:

      java.lang.ClassNotFoundException: com.sun.xml.rpc.server.http.JAXRPCContextListener
      at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3238)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3613)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:821)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
      at org.jboss.web.tomcat.tc4.EmbeddedTomcatService.createWebContext(EmbeddedTomcatService.java:549)
      at org.jboss.web.tomcat.tc4.EmbeddedTomcatService.performDeploy(EmbeddedTomcatService.java:309)
      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:428)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
      at org.jboss.deployment.MainDeployer.start(MainDeploy

      It seems that this way no jar is visible from the web application.

      I tried to put all jars to the lib/ext of the JVM that runs JBoss as well.
      The web application cannot see any of the jar files
      and I got the same error message as in the previous case.

      Could anyone use WSDP 1.4 successfully with JBoss?
      Do you have any ideas how can I get JBoss to use the MessageFactory
      implmenentation I package with my web application.

      Regards,
      Gabor Herman
      Software Developer
      FlexiTon Kft.