Announcement Announcement Module
Collapse
No announcement yet.
Basic example for spring-ws ? with nice documentation ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Basic example for spring-ws ? with nice documentation ?

    Hi Guys

    Can u please provide me with some good links for creating a helloWorld program in Spring-ws with good documentation.

    I have done some examples in axis2 and xFire.

    I just want compare axis2, xFire and Spring-ws and there features.


    Regards
    kris
    Last edited by kris_red; Oct 16th, 2006, 08:50 AM.

  • #2
    The echo application, which comes as part of the distribution, is quite simple.

    Comment


    • #3
      Yeah .it seems to be but i have never worked on MAVEN, i guess that is required to build it.

      Comment


      • #4
        Ok, you basically want to do a mvn package to create a war, as documented in the readme.txt.

        Comment


        • #5
          Hi

          It was quite easy to work with maven but i was facing a problem with a line of code in pom.xml of the echo sample program.

          I had to replace

          <artifactId>spring-ws-samples</artifactId>
          to
          <artifactId>spring-ws</artifactId>

          and everything worked fine and i could create a war successfully.

          I am using maven2.0.4 and spring-ws-1.0-m2.

          Am i doing something wrong?

          Regards
          kris

          I changed that beacuse there was no correspodning path for "http://repo1.maven.org/maven2/org/springframework/ws/spring-ws-samp
          les/1.0-m2/spring-ws-samples-1.0-m2.pom"
          which is mentioned in the error.


          The error looks like this when i dont change the <artifactid>


          C:\spring-ws-1.0-m2\samples\echo>mvn compile
          [INFO] Scanning for projects...
          Downloading: http://repo1.maven.org/maven2/org/sp...spring-ws-samp
          les/1.0-m2/spring-ws-samples-1.0-m2.pom
          [WARNING] Unable to get resource from repository central (http://repo1.maven.org
          /maven2)
          [INFO] ------------------------------------------------------------------------
          [ERROR] FATAL ERROR
          [INFO] ------------------------------------------------------------------------
          [INFO] Failed to resolve artifact.

          GroupId: org.springframework.ws
          ArtifactId: spring-ws-samples
          Version: 1.0-m2

          Reason: Unable to download the artifact from any repository

          org.springframework.ws:spring-ws-samplesom:1.0-m2

          from the specified remote repositories:
          central (http://repo1.maven.org/maven2)


          [INFO] ------------------------------------------------------------------------
          [INFO] Trace
          org.apache.maven.reactor.MavenExecutionException: Cannot find parent: org.spring
          framework.ws:spring-ws-samples for project: null:echo:war:null
          at org.apache.maven.DefaultMaven.getProjects(DefaultM aven.java:365)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMav en.java:278)
          at org.apache.maven.DefaultMaven.execute(DefaultMaven .java:115)
          at org.apache.maven.cli.MavenCli.main(MavenCli.java:2 56)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.
          Last edited by kris_red; Oct 10th, 2006, 11:57 PM.

          Comment


          • #6
            My instructions weren't complete, sorry about that. In the spring-ws-samples directory, you have to do a mvn install. This installs the samples pom into your local repository (the samples pom is the dependency mvn was complaining about), and also builds the individual samples (echo and airline).

            You might get some failures in the unit tests of the Airline sample, since it needs a database to run. Read the readme.txt in the airline directory to set up this database.

            Comment


            • #7
              Hi poutsma

              Sorry for all the confusion.

              1)
              But I don’t see a directory called spring-ws-samples in the spring-ws-1.0-m2 distribution.

              If u r talking about spring-ws-1.0-m2/samples , there is no pom.xml in there to run > mvn install .

              Can u just tell me where to run the mvn install to avoid the error I was facing (earlier post)?

              And when I chang the code
              from
              <artifactId>spring-ws-samples</artifactId>
              to
              <artifactId>spring-ws</artifactId>

              I am able to create echo-1.0-m2.war inside the target directory.After the above mentioned change in pom.xml.

              Am I doing anything seriously wrong?

              2)
              But now I am facing one more problem. I am able to deploy that war file in web logic 8.1 and but not in apache-tomcat-5.5.16? Do I have to do something more in tomcat?

              3)When i try to access the URL "http://localhost:7001/echo-1.0-m2/services" for the deployed web service i get this error
              At first i was getting this error but after putting these two jars (saaj-impl.jar and saaj-api.jar) in the "samples\echo\target\echo-1.0-m2\WEB-INF\lib". I could solve the error 1 but got error 2 now

              Error 1:-

              org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'messageEndpointHandlerAdapter' defined in ServletContext resource [/WEB-INF/springws-servlet.xml]: Cannot create inner bean 'org.springframework.ws.soap.saaj.SaajSoapMessageC ontextFactory#1457837' while setting bean property 'messageContextFactory'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.ws.soap.saaj.SaajSoapMessageC ontextFactory#1457837' defined in ServletContext resource [/WEB-INF/springws-servlet.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: SaajSoapMessageContextFactory requires SAAJ 1.2, which was notfound on the classpath
              org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.ws.soap.saaj.SaajSoapMessageC ontextFactory#1457837' defined in ServletContext resource [/WEB-INF/springws-servlet.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: SaajSoapMessageContextFactory requires SAAJ 1.2, which was notfound on the classpath
              java.lang.IllegalStateException: SaajSoapMessageContextFactory requires SAAJ 1.2, which was notfound on the classpath
              at org.springframework.ws.soap.saaj.SaajSoapMessageCo ntextFactory.afterPropertiesSet(SaajSoapMessageCon textFactory.java:91)
              at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1091)


              Error 2:-
              org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'messageEndpointHandlerAdapter' defined in ServletContext resource [/WEB-INF/springws-servlet.xml]: Cannot create inner bean 'org.springframework.ws.soap.saaj.SaajSoapMessageC ontextFactory#119ce0a' while setting bean property 'messageContextFactory'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.ws.soap.saaj.SaajSoapMessageC ontextFactory#119ce0a' defined in ServletContext resource [/WEB-INF/springws-servlet.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: javax.xml.soap.MessageFactory.newInstance(Ljava/lang/StringLjavax/xml/soap/MessageFactory;
              org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.ws.soap.saaj.SaajSoapMessageC ontextFactory#119ce0a' defined in ServletContext resource [/WEB-INF/springws-servlet.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: javax.xml.soap.MessageFactory.newInstance(Ljava/lang/StringLjavax/xml/soap/MessageFactory;
              java.lang.NoSuchMethodError: javax.xml.soap.MessageFactory.newInstance(Ljava/lang/StringLjavax/xml/soap/MessageFactory;
              at org.springframework.ws.soap.saaj.SaajSoapMessageCo ntextFactory.afterPropertiesSet(SaajSoapMessageCon textFactory.java:82)
              at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1091)
              at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:396)
              at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveInnerBeanDefinition(Bea nDefinitionValueResolver.java:151)
              at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:97)
              at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:1046)
              at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:857)
              at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:378)
              at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:233)
              at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:145)

              NO clue whats going on ?

              4)
              And how to test the deployed web service . Do i just have to run the EchoClient.java present in
              \\spring-ws-1.0-m2\samples\echo\client\saaj\src\org\springframewor k\ws\samples\echo\client\saaj ? or do i have to do anything else.
              Plannig to for these minor changes in the code in EchoClient.java ( String url = "http://localhost:7001/echo-1.0-m2/services"and wsdl to point to the right location <wsdlsoap:address location="http://localhost:7001/echo-1.0-m2/services"/>

              Regards
              Kris
              Last edited by kris_red; Oct 11th, 2006, 12:02 AM.

              Comment


              • #8
                Originally posted by kris_red View Post
                1)
                But I don’t see a directory called spring-ws-samples in the spring-ws-1.0-m2 distribution.

                If u r talking about spring-ws-1.0-m2/samples , there is no pom.xml in there to run > mvn install .

                Can u just tell me where to run the mvn install to avoid the error I was facing (earlier post)?

                And when I chang the code
                from
                <artifactId>spring-ws-samples</artifactId>
                to
                <artifactId>spring-ws</artifactId>

                I am able to create echo-1.0-m2.war inside the target directory.After the above mentioned change in pom.xml.

                Am I doing anything seriously wrong?
                No, you're doing nothing wrong, your solution is a good. Alternatively, you could have downloaded this pom, and put it in samples/. But if you got it to work, that's ok.

                Originally posted by kris_red View Post
                2)
                But now I am facing one more problem. I am able to deploy that war file in web logic 8.1 and but not in apache-tomcat-5.5.16? Do I have to do something more in tomcat?
                Not really. In fact, things should work easier in Tomcat than in Weblogic. (See below). What error are you getting in Tomcat?


                Originally posted by kris_red View Post
                3)When i try to access the URL "http://localhost:7001/echo-1.0-m2/services" for the deployed web service i get this error
                At first i was getting this error but after putting these two jars (saaj-impl.jar and saaj-api.jar) in the "samples\echo\target\echo-1.0-m2\WEB-INF\lib". I could solve the error 1 but got error 2 now

                Error 1:-

                org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'messageEndpointHandlerAdapter' defined in ServletContext resource [/WEB-INF/springws-servlet.xml]: Cannot create inner bean 'org.springframework.ws.soap.saaj.SaajSoapMessageC ontextFactory#1457837' while setting bean property 'messageContextFactory'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.ws.soap.saaj.SaajSoapMessageC ontextFactory#1457837' defined in ServletContext resource [/WEB-INF/springws-servlet.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: SaajSoapMessageContextFactory requires SAAJ 1.2, which was notfound on the classpath
                org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.ws.soap.saaj.SaajSoapMessageC ontextFactory#1457837' defined in ServletContext resource [/WEB-INF/springws-servlet.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: SaajSoapMessageContextFactory requires SAAJ 1.2, which was notfound on the classpath
                java.lang.IllegalStateException: SaajSoapMessageContextFactory requires SAAJ 1.2, which was notfound on the classpath
                at org.springframework.ws.soap.saaj.SaajSoapMessageCo ntextFactory.afterPropertiesSet(SaajSoapMessageCon textFactory.java:91)
                at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1091)


                Error 2:-
                org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'messageEndpointHandlerAdapter' defined in ServletContext resource [/WEB-INF/springws-servlet.xml]: Cannot create inner bean 'org.springframework.ws.soap.saaj.SaajSoapMessageC ontextFactory#119ce0a' while setting bean property 'messageContextFactory'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.ws.soap.saaj.SaajSoapMessageC ontextFactory#119ce0a' defined in ServletContext resource [/WEB-INF/springws-servlet.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: javax.xml.soap.MessageFactory.newInstance(Ljava/lang/StringLjavax/xml/soap/MessageFactory;
                org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.ws.soap.saaj.SaajSoapMessageC ontextFactory#119ce0a' defined in ServletContext resource [/WEB-INF/springws-servlet.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: javax.xml.soap.MessageFactory.newInstance(Ljava/lang/StringLjavax/xml/soap/MessageFactory;
                java.lang.NoSuchMethodError: javax.xml.soap.MessageFactory.newInstance(Ljava/lang/StringLjavax/xml/soap/MessageFactory;
                at org.springframework.ws.soap.saaj.SaajSoapMessageCo ntextFactory.afterPropertiesSet(SaajSoapMessageCon textFactory.java:82)
                at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1091)
                at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:396)
                at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveInnerBeanDefinition(Bea nDefinitionValueResolver.java:151)
                at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:97)
                at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:1046)
                at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:857)
                at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:378)
                at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:233)
                at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:145)

                NO clue whats going on ?
                Weblogic 8.1 does not implement J2EE 1.4, which contains SAAJ. (Weblogic 9 says it implements J2EE 1.4, but throws UnsupportedOperationExceptions in certain methods). So what you need to do is to instruct Weblogic to use the jars in WEB-INF/lib instead of the SAAJ implementation provided by the container.

                More information on how to do this in this thread.
                Originally posted by kris_red View Post
                4)
                And how to test the deployed web service . Do i just have to run the EchoClient.java present in
                \\spring-ws-1.0-m2\samples\echo\client\saaj\src\org\springframewor k\ws\samples\echo\client\saaj ? or do i have to do anything else.
                Plannig to for these minor changes in the code in EchoClient.java ( String url = "http://localhost:7001/echo-1.0-m2/services"and wsdl to point to the right location <wsdlsoap:address location="http://localhost:7001/echo-1.0-m2/services"/>
                You can run that client to test the web service, yes. You can give it an argument url that points to the correct location, because that can vary.

                Let me know how it goes.
                Last edited by Arjen Poutsma; Oct 11th, 2006, 05:18 PM.

                Comment


                • #9
                  Hello Poutsma

                  I could deploy the echo.war in tomcat and also could use the client to access it.

                  Earlier after deploying the web service in tomcat I was using the wsdl file provided in the “\spring-ws-1.0-m2\samples\echo\src\main\webapp “ but the wsdl is not well formatted, so I was unable to access the deployed web service using Altova XML spy.
                  There is some conflict in these lines in the echo.wsdl
                  <xsd:import namespace="http://www.springframework.org/spring-ws/samples/echo/schemas"
                  schemaLocation="echo.xsd"/>


                  But now the problem is with the weblogic, I have copied these jars in the \\spring-ws-1.0-m2\samples\echo\target\echo-1.0-m2\WEB-INF\lib and created a war with the same and deployed.

                  xalan.jar (xalan-j_2_7_0)
                  xercesImpl-2.8.0.jar
                  xml-apis-1.3.03.jar
                  stax-api-1.0.jar

                  I have also put a weblogic.xml file inside WEB-INF\. As stated in the thread.

                  As u have written in the thread I was trying to replace the MessageFactory (line 55 Client.java) to AxiomSoapMessageFactory

                  But I am unable to find the AxiomSoapMessageFactory.lcass can u please point me to the exact location where I can download this jar. I couldn’t find the jar.

                  Do I have to do anything else to make the client access the webservice deployed in weblogic?

                  I am still getting this error when I run the client without the change AxiomSoapMessageFactory.

                  Oct 12, 2006 2:03:41 PM com.sun.xml.messaging.saaj.soap.MessageImpl saveChanges
                  SEVERE: SAAJ0540: Error during saving a multipart message
                  Exception in thread "main" com.sun.xml.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Error during saving a multipart message
                  at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConn ection.call(HttpSOAPConnection.java:127)

                  And thanks a lot for all your replies for my queries(some times i ask very silly questions )?

                  Regards
                  Kris
                  Last edited by kris_red; Oct 12th, 2006, 04:58 AM.

                  Comment


                  • #10
                    Originally posted by kris_red View Post
                    There is some conflict in these lines in the echo.wsdl
                    <xsd:import namespace="http://www.springframework.org/spring-ws/samples/echo/schemas"
                    schemaLocation="echo.xsd"/>
                    Is it a conflict, or is it an error that it cannot locate the referenced echo.xsd? The echo.xsd needs to be found in the same directory, and it can be that your tool does not pick it up.

                    Originally posted by kris_red View Post
                    But now the problem is with the weblogic, I have copied these jars in the \\spring-ws-1.0-m2\samples\echo\target\echo-1.0-m2\WEB-INF\lib and created a war with the same and deployed.

                    xalan.jar (xalan-j_2_7_0)
                    xercesImpl-2.8.0.jar
                    xml-apis-1.3.03.jar
                    stax-api-1.0.jar

                    I have also put a weblogic.xml file inside WEB-INF\. As stated in the thread.

                    As u have written in the thread I was trying to replace the MessageFactory (line 55 Client.java) to AxiomSoapMessageFactory

                    But I am unable to find the AxiomSoapMessageFactory.lcass can u please point me to the exact location where I can download this jar. I couldn’t find the jar.
                    The client uses plain SAAJ (not any Spring-WS functionality), the libs of which are located in the client/saaj/lib directory. Doing a simple "ant run" in the client/saaj directory should build and run the client. It's just a simple Java app.
                    The AxiomSoapMessageContextFactory is in the core spring ws jar, and cannot be used in the client.

                    Originally posted by kris_red View Post
                    Do I have to do anything else to make the client access the webservice deployed in weblogic?

                    I am still getting this error when I run the client without the change AxiomSoapMessageFactory.

                    Oct 12, 2006 2:03:41 PM com.sun.xml.messaging.saaj.soap.MessageImpl saveChanges
                    SEVERE: SAAJ0540: Error during saving a multipart message
                    Exception in thread "main" com.sun.xml.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Error during saving a multipart message
                    at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConn ection.call(HttpSOAPConnection.java:127)
                    The sample should just run, especially if you use the supplied build file & the sample deployed correctly. You could also try using a different client like SoapUI http://www.soapui.org/ and see whether that works.

                    Originally posted by kris_red View Post
                    And thanks a lot for all your replies for my queries(some times i ask very silly questions )?
                    That's OK, that's why we're here for.

                    Comment


                    • #11
                      Hi again

                      I am able to deploy (echo.war) and also run the client present in samples\echo\client\saaj\ for tomcat. Its quite simple.

                      But for weblogic I am doing these steps are written in this thread here adding these jars (Xerces 2.8.0, Xalan 2.7.0 ,xml-apis 1.3.0.3 and stax-api.jar)in \samples\echo\target\echo-1.0-m2\WEB-INF\lib and then creating a war with jar utility.

                      And finally deploying the war in weblogic which was fine but when I use the same client with little changes for weblogic i.e. the change in port number etc. I get the following error when running the saaj\client (compilation was fine)

                      Error:

                      Oct 12, 2006 4:27:32 PM com.sun.xml.messaging.saaj.soap.MessageImpl identifyContentType
                      SEVERE: SAAJ0537: Invalid Content-Type. Could be an error message instead of a SOAP message
                      Exception in thread "main" com.sun.xml.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: 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.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)


                      2)
                      And when I use the soapui1.5 client I get these errors:



                      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)
                      at


                      3)
                      Do I have to do anything more for weblogic. Can u also paste the whole weblogic.xml file, as i think there might be some error with my weblogic.xml

                      <weblogic-web-app>
                      <container-descriptor>
                      <prefer-web-inf-classes>true</prefer-web-inf-classes>
                      </container-descriptor>
                      </weblogic-web-app>

                      One of the error I get while deploying the war in weblogic Is regarding the weblogic.xml

                      Error is:

                      <Oct 12, 2006 4:30:08 PM IST> <Warning> <HTTP> <BEA-101248> <[null]: Deployment descriptor "weblogic.xml" is malformed. Check against the DTD: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'weblogic-web-app'. (line 2, column 19).>

                      Regards
                      Kris

                      Comment


                      • #12
                        Originally posted by kris_red View Post
                        But for weblogic I am doing these steps are written in this thread here adding these jars (Xerces 2.8.0, Xalan 2.7.0 ,xml-apis 1.3.0.3 and stax-api.jar)in \samples\echo\target\echo-1.0-m2\WEB-INF\lib and then creating a war with jar utility.
                        You also have to include the saaj-api and saaj-impl. The jar built by maven should include all jars necessary.

                        Originally posted by kris_red View Post
                        And finally deploying the war in weblogic which was fine but when I use the same client with little changes for weblogic i.e. the change in port number etc. I get the following error when running the saaj\client (compilation was fine)

                        Error:

                        Oct 12, 2006 4:27:32 PM com.sun.xml.messaging.saaj.soap.MessageImpl identifyContentType
                        SEVERE: SAAJ0537: Invalid Content-Type. Could be an error message instead of a SOAP message
                        Exception in thread "main" com.sun.xml.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: 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.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)
                        You get this because the return message is not a valid SOAP message, but an HTML error page.


                        Originally posted by kris_red View Post
                        2)
                        And when I use the soapui1.5 client I get these errors:



                        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)
                        at
                        Exactly. This is the HTML error page I was talking about above. The error is related to the fact that Weblogic picks up the wrong implementation of SAAJ (i.e. the older 1.1 version provided by Weblogic instead of SAAJ 1.2 or higher, which Spring-WS needs). This is due to the fact that Weblogic needs to be instructed to prefer the jars in WEB-INF/lib instead of the jars of the container itself, which is what you do in weblogic.xml.

                        Originally posted by kris_red View Post
                        3)
                        Do I have to do anything more for weblogic. Can u also paste the whole weblogic.xml file, as i think there might be some error with my weblogic.xml

                        <weblogic-web-app>
                        <container-descriptor>
                        <prefer-web-inf-classes>true</prefer-web-inf-classes>
                        </container-descriptor>
                        </weblogic-web-app>

                        One of the error I get while deploying the war in weblogic Is regarding the weblogic.xml

                        Error is:

                        <Oct 12, 2006 4:30:08 PM IST> <Warning> <HTTP> <BEA-101248> <[null]: Deployment descriptor "weblogic.xml" is malformed. Check against the DTD: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'weblogic-web-app'. (line 2, column 19).>
                        I'm not a Weblogic expert, but the format for this file might vary from release to release. You can lookup the reference using Google. For instance, the docs for the 9.2 version is at http://e-docs.bea.com/wls/docs92/web...logic_xml.html.

                        Comment


                        • #13
                          Maven problem

                          Hi,

                          I too am struggling to build the samples using Maven. I followed the instructions shown earlier in this thread (downloaded the POM file and did "mvn install" in the samples directory), but I get the following error message :

                          Code:
                          Downloading: https://maven-repository.dev.java.net/nonav/repository/xmlunit/poms/xmlunit-1.0.pom
                          [INFO] ------------------------------------------------------------------------
                          [ERROR] BUILD ERROR
                          [INFO] ------------------------------------------------------------------------
                          [INFO] Error building POM (may not be this project's POM).
                          
                          
                          Project ID: xmlunit:xmlunit
                          
                          Reason: Error getting POM for 'xmlunit:xmlunit' from the repository: Error transferring file
                            xmlunit:xmlunit:pom:1.0
                          
                          from the specified remote repositories:
                            Maven Snapshots (http://snapshots.maven.codehaus.org/maven2/),
                            central (http://repo1.maven.org/maven2),
                            spring-ext (https://svn.sourceforge.net/svnroot/springframework/repos/repo-ext/),
                            java.net (https://maven-repository.dev.java.net/nonav/repository)
                          and when I do a "mvn -e install" it shows that the root cause is:

                          Code:
                          Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
                          It seems the problem is that Maven can't find the CA certificate for the web site "maven-repository.dev.java.net" (whose certificate is signed by "Comodo Class 3 Security Services CA").

                          I'm not faimilar with Maven, how do I tell it where to find the certificate?

                          Regards
                          Rob

                          Er.. I found the cause of the problem by running the command "mvn -Djavax.net.debug=ssl:handshake package" - the SSL debugging messages revealed that the trustStore being used was ${JAVA_HOME}/jre/lib/security/jssecacerts, whereas the standard trustStore is ${JAVA_HOME}/jre/lib/security/cacerts. Moving jssecacerts out of the way fixed the problem.
                          Last edited by robpitman; Oct 27th, 2006, 02:15 AM. Reason: Found answer to problem

                          Comment


                          • #14
                            Originally posted by Arjen Poutsma View Post
                            My instructions weren't complete, sorry about that. In the spring-ws-samples directory, you have to do a mvn install. This installs the samples pom into your local repository (the samples pom is the dependency mvn was complaining about), and also builds the individual samples (echo and airline).

                            You might get some failures in the unit tests of the Airline sample, since it needs a database to run. Read the readme.txt in the airline directory to set up this database.


                            I want to add to Arjen Poutma's posting of Oct 10th, 2006, 06:04 AM (quoted above)

                            For Spring-WS 1.5.5, Maven 2.0.9, this command sequence results in a successful build of the echo web service's .war file:

                            cd ./spring-ws-1.5.5/samples
                            mvn install
                            cd echo
                            mvn package
                            Last edited by rodk; Jan 26th, 2009, 05:59 PM.

                            Comment


                            • #15
                              similiar problem

                              i use spring-ws 1.5.8 and maven 2.2.1. and it doesn't build out of box. can you give me some instruction how i can build it?

                              C:\spring framework\spring-ws-1.5.8\samples\echo>mvn package
                              [INFO] Scanning for projects...
                              Downloading: http://s3.amazonaws.com/maven.spring...estone/org/spr
                              ingframework/ws/spring-ws-parent/1.5.8/spring-ws-parent-1.5.8.pom
                              [WARNING] Unable to get resource 'org.springframework.ws:spring-ws-parentom:1.
                              5.8' from repository spring-milestone (http://s3.amazonaws.com/maven.springframe
                              work.org/milestone): Error transferring file: Connection timed out: connect
                              Downloading: http://repo1.maven.org/maven2/org/sp...spring-ws-pare
                              nt/1.5.8/spring-ws-parent-1.5.8.pom
                              [WARNING] Unable to get resource 'org.springframework.ws:spring-ws-parentom:1.
                              5.8' from repository central (http://repo1.maven.org/maven2): Error transferring
                              file: Connection timed out: connect
                              [INFO] ------------------------------------------------------------------------
                              [ERROR] FATAL ERROR
                              [INFO] ------------------------------------------------------------------------
                              [INFO] Error building POM (may not be this project's POM).


                              Project ID: null:spring-ws-samplesom:null

                              Reason: Cannot find parent: org.springframework.ws:spring-ws-parent for project:
                              null:spring-ws-samplesom:null for project null:spring-ws-samplesom:null


                              [INFO] ------------------------------------------------------------------------
                              [INFO] Trace
                              org.apache.maven.reactor.MavenExecutionException: Cannot find parent: org.spring
                              framework.ws:spring-ws-parent for project: null:spring-ws-samplesom:null for p
                              roject null:spring-ws-samplesom:null
                              at org.apache.maven.DefaultMaven.getProjects(DefaultM aven.java:404)
                              at org.apache.maven.DefaultMaven.doExecute(DefaultMav en.java:272)
                              at org.apache.maven.DefaultMaven.execute(DefaultMaven .java:138)
                              at org.apache.maven.cli.MavenCli.main(MavenCli.java:3 62)
                              at org.apache.maven.cli.compat.CompatibleMain.main(Co mpatibleMain.java:6
                              0)
                              at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
                              at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.
                              java:39)
                              at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAcces
                              sorImpl.java:25)
                              at java.lang.reflect.Method.invoke(Method.java:597)
                              at org.codehaus.classworlds.Launcher.launchEnhanced(L auncher.java:315)
                              at org.codehaus.classworlds.Launcher.launch(Launcher. java:255)
                              at org.codehaus.classworlds.Launcher.mainWithExitCode (Launcher.java:430)

                              at org.codehaus.classworlds.Launcher.main(Launcher.ja va:375)
                              Caused by: org.apache.maven.project.ProjectBuildingException: Cannot find parent
                              : org.springframework.ws:spring-ws-parent for project: null:spring-ws-sampleso
                              m:null for project null:spring-ws-samplesom:null
                              at org.apache.maven.project.DefaultMavenProjectBuilde r.assembleLineage(D
                              efaultMavenProjectBuilder.java:1396)
                              at org.apache.maven.project.DefaultMavenProjectBuilde r.assembleLineage(D
                              efaultMavenProjectBuilder.java:1407)
                              at org.apache.maven.project.DefaultMavenProjectBuilde r.buildInternal(Def
                              aultMavenProjectBuilder.java:823)
                              at org.apache.maven.project.DefaultMavenProjectBuilde r.buildFromSourceFi
                              leInternal(DefaultMavenProjectBuilder.java:508)
                              at org.apache.maven.project.DefaultMavenProjectBuilde r.build(DefaultMave
                              nProjectBuilder.java:200)
                              at org.apache.maven.DefaultMaven.getProject(DefaultMa ven.java:604)
                              at org.apache.maven.DefaultMaven.collectProjects(Defa ultMaven.java:487)
                              at org.apache.maven.DefaultMaven.getProjects(DefaultM aven.java:391)
                              ... 12 more
                              Caused by: org.apache.maven.project.ProjectBuildingException: POM 'org.springfra
                              mework.ws:spring-ws-parent' not found in repository: Unable to download the arti
                              fact from any repository

                              org.springframework.ws:spring-ws-parentom:1.5.8

                              from the specified remote repositories:
                              central (http://repo1.maven.org/maven2),
                              spring-milestone (http://s3.amazonaws.com/maven.spring....org/milestone)


                              for project org.springframework.ws:spring-ws-parent
                              at org.apache.maven.project.DefaultMavenProjectBuilde r.findModelFromRepo
                              sitory(DefaultMavenProjectBuilder.java:605)
                              at org.apache.maven.project.DefaultMavenProjectBuilde r.assembleLineage(D
                              efaultMavenProjectBuilder.java:1392)
                              ... 19 more
                              Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoun dException: Unable
                              to download the artifact from any repository

                              org.springframework.ws:spring-ws-parentom:1.5.8

                              from the specified remote repositories:
                              central (http://repo1.maven.org/maven2),
                              spring-milestone (http://s3.amazonaws.com/maven.spring....org/milestone)



                              at org.apache.maven.artifact.resolver.DefaultArtifact Resolver.resolve(De
                              faultArtifactResolver.java:228)
                              at org.apache.maven.artifact.resolver.DefaultArtifact Resolver.resolve(De
                              faultArtifactResolver.java:90)
                              at org.apache.maven.project.DefaultMavenProjectBuilde r.findModelFromRepo
                              sitory(DefaultMavenProjectBuilder.java:558)
                              ... 20 more
                              Caused by: org.apache.maven.wagon.ResourceDoesNotExistExcepti on: Unable to downl
                              oad the artifact from any repository
                              at org.apache.maven.artifact.manager.DefaultWagonMana ger.getArtifact(Def
                              aultWagonManager.java:404)
                              at org.apache.maven.artifact.resolver.DefaultArtifact Resolver.resolve(De
                              faultArtifactResolver.java:216)
                              ... 22 more
                              [INFO] ------------------------------------------------------------------------
                              [INFO] Total time: 42 seconds
                              [INFO] Finished at: Thu Oct 08 11:56:04 EDT 2009
                              [INFO] Final Memory: 1M/4M
                              [INFO] ------------------------------------------------------------------------

                              Comment

                              Working...
                              X