Announcement Announcement Module
Collapse
No announcement yet.
problems in deploying war in weblogic? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • problems in deploying war in weblogic?

    Hi Friends

    I am still facing some problems in deploying the war created using spring-ws and maven2 in weblogic.

    According to my earlier thread I created a weblogic.xml file to direct the weblogic to take jars from web-inf\lib.

    Weblogic.xml is as follows:-

    <!DOCTYPE weblogic-web-app PUBLIC "-//BEA
    Systems, Inc.//DTD Web Application 7.0//EN"
    "http://www.bea.com/servers/wls700/dtd/weblogic700-web-jar.dtd">
    <weblogic-web-app>
    <container-descriptor>
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-descriptor>
    </weblogic-web-app>



    But when I try to access the web service using the client in "samples\echo\client\saaj\src\org\springframework\ ws\samples\echo\client\saaj" I get the following error.

    I get this error when I try to access the web service for the first time

    TABLE border=0 width=100% cellpadding=10><TR><TD VALIGN=top WIDTH=100% BGCOLOR=white><FONT FACE="Courier New"><pre>java.lang.NoSuchMethodError: java.util.Collections.emptyList()Ljava/util/List;
    at com.sun.xml.messaging.saaj.soap.MessageImpl.<clini t>(MessageImpl.java:755)
    at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessage Factory1_1Impl.createMessage(SOAPMessageFactory1_1 Impl.java:62)


    My Views on this error: The method Collections.emptyList() is from java 5.0 onwards , so that might be the reason for that, but how to avoid that, as I need saaj-impl.jar for other classes.

    And for the second time onwards I get this error:--

    <TABLE border=0 width=100% cellpadding=10><TR><TD VALIGN=top WIDTH=100% BGCOLOR=white><FONT FACE="Courier New"><pre>java.lang.NoClassDefFoundError
    at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessage Factory1_1Impl.createMessage(SOAPMessageFactory1_1 Impl.java:62)
    at org.springframework.ws.soap.saaj.SaajSoapMessageCo ntextFactory.createContext(SaajSoapMessageContextF actory.java:115)



    My Views on this error: It says the class SOAPMessageFactory1_1Impl in not found but its there in the web-inf\lib\saaj-impl.jar . I guess this is because weblogic is not looking for the jars in my war file. But why? I have already given the weblogic.xml

    I am really confused with all this. It’s my 3rd on this problem.

    Has anyone deployed war in weblogic 8.1?

    Can some one provide me in case I need to put some other jars and there location too.

    I am using the following jars (activation-1.1.jar,commons-collections-3.1.jar;commons-logging-1.1.jar;log4j-1.2.13.jar
    mail-1.4.jar;saaj-api-1.3.jar;saaj-impl-1.3.jar;spring-aop-1.2.8.jar;spring-beans-1.2.8.jar;spring-context-1.2.8.jar;spring-core-1.2.8.jar;spring-web-1.2.8.jar;spring-webmvc-1.2.8.jar;spring-ws-core-1.0-m2.jar;spring-xml-1.0-m2.jar;stax-api-1.0.jar).
    These jars are put by mavne2 in the web-inf\lib.

    I have used other client too like soapui1.5 but i get same error as i told u above , for the first time i get a diffferent error and from second time onwards i get a different errors . Same error as above .


    Regards
    Kris
    Last edited by kris_red; Oct 13th, 2006, 02:27 AM.

  • #2
    Hi,

    I can imagine that you are getting frustrated about this. But you're almost there! I actually got the Echo sample to work under Weblogic 8.1 SP 6.

    Indeed, the SAAJ version (1.3) used in the pom is Java 5 only. Fortunately, Spring-WS also supports SAAJ version 1.2, which is Java 1.4. The bad news is that this version is not distributed via Maven, so you have to download it manually. It is part of JWDSP 1.6, which you can download here.

    So what you need to do create a new war, which contains the following jars in WEB-INF/lib:
    • spring-oxm.jar
    • spring-ws-core.jar
    • spring-xml.jar
    • commons-logging-1.1.jar
    • log4j-1.2.13.jar
    • spring-aop-1.2.8.jar
    • spring-beans-1.2.8.jar
    • spring-context-1.2.8.jar
    • spring-core-1.2.8.jar
    • spring-web-1.2.8.jar
    • spring-webmvc-1.2.8.jar
    • xalan-2.7.0.jar
    • xercesImpl-2.8.0.jar
    • xml-apis-1.3.03.jar
    • saaj-api.jar *
    • saaj-impl.jar *
    • activation.jar *
    • mail.jar *
    • FastInfoset.jar *

    The last five jars (marked with the asterix) are from JWDSP 1.6, from varying directories. If you want, I can send you a complete war file that contains all the files necessary.

    Next, and this is quite important, you need to change the startup script for Weblogic (startWebLogic.sh or startWebLogic.bat) to set a system property. You need to set the JAVA_OPTIONS property, so that it contains the following:

    Code:
    JAVA_OPTIONS="-Djavax.xml.soap.MessageFactory=com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl"
    You can put this variable right after JAVA_HOME.

    When I took the above steps, the echo sample worked.

    There is an alternative way to make it work, which uses Axis2 Axiom instead of SAAJ, but since you've already went down the SAAJ road, I thought it was best to finish it this way.

    Let me know how it works for you.

    Comment


    • #3
      Hi ,

      Can u please send me the echo.war file and the client code u r using to access and the jars for it.
      And can u please tell me which java version are u using in the client.

      My email id is sanreddy at deloitte dot com.

      I am still getting some errors.

      I inculded the following jars and included the JAVA_OPTIONS as stated by u .

      activation.jar *
      commons-collections-3.1.jar
      commons-logging-1.1.jar
      FastInfoset.jar *
      log4j-1.2.13.jar
      mail.jar *
      saaj-api.jar *
      saaj-impl.jar *
      spring-aop-1.2.8.jar
      spring-beans-1.2.8.jar
      spring-context-1.2.8.jar
      spring-core-1.2.8.jar
      spring-oxm-1.0-m2.jar (from mvn repo)
      spring-web-1.2.8.jar
      spring-webmvc-1.2.8.jar
      spring-ws-core-1.0-m2.jar
      spring-xml-1.0-m2.jar
      stax-api-1.0.jar
      xalan.jar (2.7.0) (added)
      xercesImpl-2.8.0.jar (added)
      xml-apis-1.3.03.jar(added)

      * --> added from JWDSP.

      (I also tried to add this line in client
      System.setProperty("javax.xml.soap.MessageFactory" ,"com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessa geFactory1_1Impl") But of now use.

      But now i am getting a different error.

      Error in soap1.5 ui-->
      org.springframework.ws.soap.SoapMessageCreationExc eption: Could not create message from TransportRequest: Unable to internalize message; nested exception is com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
      at org.springframework.ws.soap.saaj.SaajSoapMessageCo ntextFactory.createContext(SaajSoapMessageContextF actory.java:119)
      at org.springframework.ws.transport.http.MessageEndpo intHandlerAdapter.handlePost(MessageEndpointHandle rAdapter.java:89)
      at org.springframework.ws.transport.http.MessageEndpo intHandlerAdapter.handle(MessageEndpointHandlerAda pter.java:68)
      at org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:723)
      at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:663)
      at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:394)
      at org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:358)
      at javax.servlet.http.HttpServlet.service(HttpServlet .java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
      at weblogic.servlet.internal.ServletStubImpl$ServletI nvocationAction.run(ServletStubImpl.java:1077)
      at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:465)
      at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:348)
      at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(WebAppServletContext.java :7047)
      at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:121)
      at weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppServletContext.java:3902)
      at weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestImpl.java:2773)
      at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:224)
      at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:183)
      Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
      at com.sun.xml.messaging.saaj.soap.MessageImpl.<init> (MessageImpl.java:302)
      at com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1I mpl.<init>(Message1_1Impl.java:47)
      at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessage Factory1_1Impl.createMessage(SOAPMessageFactory1_1 Impl.java:38)
      at org.springframework.ws.soap.saaj.SaajSoapMessageCo ntextFactory.createContext(SaajSoapMessageContextF actory.java:115)
      ... 18 more
      Caused by: java.lang.NoClassDefFoundError: com/sun/org/apache/xerces/internal/dom/DocumentImpl
      at java.lang.ClassLoader.defineClass0(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java :539)
      at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:123)
      at weblogic.utils.classloaders.GenericClassLoader.fin dLocalClass(GenericClassLoader.java:480)
      at weblogic.utils.classloaders.GenericClassLoader.fin dClass(GenericClassLoader.java:182)
      at weblogic.utils.classloaders.ChangeAwareClassLoader .findClass(ChangeAwareClassLoader.java:61)
      at weblogic.utils.classloaders.ChangeAwareClassLoader .loadClass(ChangeAwareClassLoader.java:46)
      at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:302)
      at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.<init >(SOAPPartImpl.java:63)
      at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1 Impl.<init>(SOAPPart1_1Impl.java:29)
      at com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1I mpl.getSOAPPart(Message1_1Impl.java:52)
      at com.sun.xml.messaging.saaj.soap.MessageImpl.<init> (MessageImpl.java:232)
      ... 21 more


      Error from SAAJ Client

      Oct 16, 2006 4:12:43 PM com.sun.xml.messaging.saaj.soap.MessageImpl identifyContentType
      SEVERE: SAAJ0537: Invalid Content-Type. Could be an error message instead of a SOAP message
      Oct 16, 2006 4:12:43 PM com.sun.xml.messaging.saaj.soap.MessageImpl <init>
      SEVERE: SAAJ0535: Unable to internalize message
      Exception in thread "main" com.sun.xml.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
      at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConn ection.call(HttpSOAPConnection.java:127)
      at org.springframework.ws.samples.echo.client.saaj.Ec hoClient.callWebService(EchoClient.java:75)
      at org.springframework.ws.samples.echo.client.saaj.Ec hoClient.main(EchoClient.java:102)
      Caused by: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConn ection.call(HttpSOAPConnection.java:121)
      ... 2 more
      Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
      at com.sun.xml.messaging.saaj.soap.MessageImpl.<init> (MessageImpl.java:302)
      at com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1I mpl.<init>(Message1_1Impl.java:47)
      at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessage Factory1_1Impl.createMessage(SOAPMessageFactory1_1 Impl.java:38)
      at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConn ection.post(HttpSOAPConnection.java:354)
      at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConn ection$PriviledgedPost.run(HttpSOAPConnection.java :150)
      ... 4 more
      Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:text/html. Is this an error message instead of a SOAP response?
      at com.sun.xml.messaging.saaj.soap.MessageImpl.identi fyContentType(MessageImpl.java:398)
      at com.sun.xml.messaging.saaj.soap.MessageImpl.<init> (MessageImpl.java:189)
      ... 8 more

      CAUSE:

      I just want to access this web service using a client, it doest matter if it uses axiom or saaj

      Thanks a lot for u r time and patience.

      Regards
      Kris
      Last edited by kris_red; Oct 16th, 2006, 08:54 AM.

      Comment


      • #4
        Unfortunately, I'm not at the machine that has the jar right now. I will send it to you on Wednesday.

        Also, I think I've found a way to support SAAJ 1.1 (i.e. WebLogic 8.1) natively, without the abovementioned hassle. I'm working on it right now, so hopefully I will have something that works this weekend.

        Cheers,

        Comment


        • #5
          Originally posted by poutsma View Post
          Also, I think I've found a way to support SAAJ 1.1 (i.e. WebLogic 8.1) natively, without the abovementioned hassle. I'm working on it right now, so hopefully I will have something that works this weekend.
          Unfortunately, the idea I had didn't work with WebLogic's implementation of SAAJ 1.1.

          Comment


          • #6
            Echo on Java 1.4

            My problem is probably related to the previous discussion.

            I'm using Java 1.4 and trying to get the echo example up and running. I have diligently copied all the jars from the list above. It has been a frustrating day. At the moment I am getting the following error on the server side :

            NoClassDefFoundError: com/sun/org/apache/xerces/internal/dom/DocumentImpl

            which I assume means I need to change the version of xerxesImpl.jar ?

            But, do I also need to change the version in tomcat ../common/endorsed ?

            Do I also need to change the MessageFactory option as for WebLogic ?

            Thanks for any help

            Martin

            Comment


            • #7
              SAAJ 1.3, which is the default version in Spring-WS, is Java 5 only. To use SAAJ under Java 1.4, you will need to downgrade to version 1.2 of SAAJ.

              To do this, change the following section in samples/pom.xml file to:

              Code:
                      <dependency>
                          <groupId>javax.xml.soap</groupId>
                          <artifactId>saaj-api</artifactId>
                          <scope>runtime</scope>
                          <version>1.2</version>
                      </dependency>
                      <dependency>
                          <groupId>javax.mail</groupId>
                          <artifactId>mail</artifactId>
                          <scope>runtime</scope>
                      </dependency>
                      <dependency>
                          <groupId>javax.activation</groupId>
                          <artifactId>activation</artifactId>
                          <scope>runtime</scope>
                      </dependency>
                      <dependency>
                          <groupId>com.sun.xml.messaging.saaj</groupId>
                          <artifactId>saaj-impl</artifactId>
                          <scope>runtime</scope>
                          <version>1.2</version>
                      </dependency>
              Note the explicit 1.2 version numbers for the two dependencies. If you do a "mvn package" in samples/echo, and deploy the resulting target/echo.war, things should work (though see the warning below).

              As an alternative to using SAAJ (which can be a pain to setup, though on most app servers it works out of the box) you can use Axiom. To use Axiom, change the following in samples/echo/pom.xml:

              Code:
               <dependencies>
                      <!-- Spring-WS dependencies -->
                      <dependency>
                          <groupId>org.springframework.ws</groupId>
                          <artifactId>spring-ws-core</artifactId>
                      </dependency>
                      <dependency>
                          <artifactId>axiom-impl</artifactId>
                          <groupId>org.apache.ws.commons.axiom</groupId>
                      </dependency>
                      <dependency>
                          <groupId>org.codehaus.woodstox</groupId>
                          <artifactId>wstx-asl</artifactId>
                      </dependency>
                  </dependencies>
              and you also have to add the following to src/main/webapp/WEB-INF/spring-ws-servlet.xml:

              Code:
                  <bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory"/>
              Finally, a bit of a warning about XML parsing on JDK 1.4: it's a mess. Some namespace-specific functionality simply doesn't work. Unfortunately there is nothing I can do about it, because you cannot use the classpath to override the default (Crimson) XML parser, nor the old version of Xalan that is bundled with JDK 1.4. See this FAQ entry on the Xalan site, and also this entry on the Xerces site. The only thing that works is to add newer versions of Xerces and Xalan in the lib/endorsed directory of your JDK, as explained in those FAQs.

              Hope this helps,

              Comment


              • #8
                Thanks for the detailed response

                Hi - thanks for the detailed response.

                All this just confirms my feeling that Java 1.4 is not the optimum platform for new web services development. All the code works beautifully at home on Java5, but at work progress is painfully slow using Java1.4. The good news is that following my painful experience I have now managed to convince the department to upgrade to Java5. So I think for my own sanity I will put this project on hold for a week or so and pick it up again after the upgrade.

                ======
                Martin

                Comment


                • #9
                  The WAR file

                  Dear Arjen,
                  Is it possible to get that war file that you were talking about in your post. I just cant seem to get the necessary jars to work with Oracle AS 10.1.2.3

                  The Oracle AS is giving me a really hard time and I so badly want the SpringWS to work in it.

                  Regards,
                  Franklin

                  Comment


                  • #10
                    I am a student and firts time here but its really good man.

                    Comment

                    Working...
                    X