You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Bryan Hansen <br...@gmail.com> on 2007/08/07 23:19:09 UTC

SAAJ Error

Hello,

I am trying to run the example here:

http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html

I have setup everything to the best of my knowledge correctly and it deploys
on the server, but when I try to run the client I get this exception:

javax.xml.ws.WebServiceException: Cannot create SAAJ factory instance.
    at org.apache.cxf.jaxws.binding.soap.SOAPBindingImpl.getSOAPFactory(
SOAPBindingImpl.java:118)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java
:150)
    at $Proxy42.sayHi(Unknown Source)
    at org.lds.ticketing.integration.WebServiceClientTest.testWebService(
WebServiceClientTest.java:15)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at org.springframework.test.ConditionalTestCase.runBare(
ConditionalTestCase.java:69)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.junit.internal.runners.OldTestClassRunner.run(
OldTestClassRunner.java:76)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
JUnit4TestReference.java:38)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
RemoteTestRunner.java:673)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
RemoteTestRunner.java:386)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
RemoteTestRunner.java:196)
Caused by: javax.xml.soap.SOAPException: Unable to create SOAP Factory:
Unable to create SAAJ meta-factoryProvider
com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl not found
    at javax.xml.soap.SOAPFactory.newInstance(Unknown Source)
    at org.apache.cxf.jaxws.binding.soap.SOAPBindingImpl.getSOAPFactory(
SOAPBindingImpl.java:113)
    ... 23 more

I googled for that error and the only relevant response I could find said to
make sure that I had the correct version of the saaj library, 1.3 which I
do.

My spring service is defined like this:

    <import resource="classpath:META-INF/cxf/cxf.xml" />
    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

    <jaxws:endpoint
      id="helloWorld"
      implementor="org.foo.service.web.HelloWorldImpl"
      address="/HelloWorld" />

And the client is defined as:

<bean id="client" class="org.foo.service.web.HelloWorld"
      factory-bean="clientFactory" factory-method="create"/>

    <bean id="clientFactory" class="
org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
      <property name="serviceClass" value="org.foo.service.web.HelloWorld"/>
      <property name="address" value="
http://localhost:8080/ticketing/HelloWorld"/>
    </bean>

The versions of the classes from my maven2 pom are:

<dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf</artifactId>
            <version>2.0-incubator</version>
        </dependency>

        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1</version>
        </dependency>

        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <version>1.1</version>
        </dependency>

        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>jsr250-api</artifactId>
            <version>1.0</version>
        </dependency>

        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4</version>
        </dependency>

        <dependency>
            <groupId>org.apache.neethi</groupId>
            <artifactId>neethi</artifactId>
            <version>2.0</version>
        </dependency>

        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.1</version>
        </dependency>

        <dependency>
            <groupId>javax.xml</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>2.1.4</version>
        </dependency>

        <dependency>
            <groupId>javax.xml.ws</groupId>
            <artifactId>jaxws-api</artifactId>
            <version>2.0</version>
        </dependency>

        <dependency>
            <groupId>javax.jws</groupId>
            <artifactId>jsr181</artifactId>
            <version>1.0</version>
        </dependency>

        <dependency>
            <groupId>javax.xml.soap</groupId>
            <artifactId>saaj-api</artifactId>
            <version>1.3</version>
        </dependency>

        <dependency>
            <groupId>stax</groupId>
            <artifactId>stax-api</artifactId>
            <version>1.0.1</version>
        </dependency>

        <dependency>
            <groupId>org.apache.ws.commons</groupId>
            <artifactId>XmlSchema</artifactId>
            <version>1.1</version>
        </dependency>

        <dependency>
            <groupId>org.codehaus.woodstox</groupId>
            <artifactId>wstx-asl</artifactId>
            <version>3.2.1</version>
        </dependency>

        <dependency>
            <groupId>wsdl4j</groupId>
            <artifactId>wsdl4j</artifactId>
            <version>1.6.1</version>
        </dependency>

        <dependency>
            <groupId>aopalliance</groupId>
            <artifactId>aopalliance</artifactId>
            <version>1.0</version>
        </dependency>

        <dependency>
            <groupId>xml-resolver</groupId>
            <artifactId>xml-resolver</artifactId>
            <version>1.2</version>
        </dependency>

Any ideas as to what might be wrong?

Thanks,

Bryan

Re: SAAJ Error

Posted by Bryan Hansen <br...@gmail.com>.
That was it! Thanks Peter. Sorting through all the jars can be a bit of a
pain especially with the incubator versions.

Thanks for your help!

Bryan

On 8/7/07, Peter Jones <pe...@iona.com> wrote:
>
>
> Hi Bryan,
>
> I see the saaj-api dependency in your pom entries below, but I don't see a
> saaj-impl dependency.  I suspect thats what you are missing.
>
>     <dependency>
>         <groupId>com.sun.xml.messaging.saaj</groupId>
>         <artifactId>saaj-impl</artifactId>
>         <version>1.3</version>
>     </dependency>
>
> Let us know if that helps any...
>
> Cheers,
> Peter
>
> On Tue, Aug 07, 2007 at 03:19:09PM -0600, Bryan Hansen wrote:
> > Hello,
> >
> > I am trying to run the example here:
> >
> > http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html
> >
> > I have setup everything to the best of my knowledge correctly and it
> deploys
> > on the server, but when I try to run the client I get this exception:
> >
> > javax.xml.ws.WebServiceException: Cannot create SAAJ factory instance.
> >     at org.apache.cxf.jaxws.binding.soap.SOAPBindingImpl.getSOAPFactory(
> > SOAPBindingImpl.java:118)
> >     at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(
> JaxWsClientProxy.java
> > :150)
> >     at $Proxy42.sayHi(Unknown Source)
> >     at org.lds.ticketing.integration.WebServiceClientTest.testWebService
> (
> > WebServiceClientTest.java:15)
> >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >     at sun.reflect.NativeMethodAccessorImpl.invoke(
> > NativeMethodAccessorImpl.java:39)
> >     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > DelegatingMethodAccessorImpl.java:25)
> >     at java.lang.reflect.Method.invoke(Method.java:585)
> >     at junit.framework.TestCase.runTest(TestCase.java:168)
> >     at junit.framework.TestCase.runBare(TestCase.java:134)
> >     at org.springframework.test.ConditionalTestCase.runBare(
> > ConditionalTestCase.java:69)
> >     at junit.framework.TestResult$1.protect(TestResult.java:110)
> >     at junit.framework.TestResult.runProtected(TestResult.java:128)
> >     at junit.framework.TestResult.run(TestResult.java:113)
> >     at junit.framework.TestCase.run(TestCase.java:124)
> >     at junit.framework.TestSuite.runTest(TestSuite.java:232)
> >     at junit.framework.TestSuite.run(TestSuite.java:227)
> >     at org.junit.internal.runners.OldTestClassRunner.run(
> > OldTestClassRunner.java:76)
> >     at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
> > JUnit4TestReference.java:38)
> >     at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
> > TestExecution.java:38)
> >     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> > RemoteTestRunner.java:460)
> >     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> > RemoteTestRunner.java:673)
> >     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> > RemoteTestRunner.java:386)
> >     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> > RemoteTestRunner.java:196)
> > Caused by: javax.xml.soap.SOAPException: Unable to create SOAP Factory:
> > Unable to create SAAJ meta-factoryProvider
> > com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl not found
> >     at javax.xml.soap.SOAPFactory.newInstance(Unknown Source)
> >     at org.apache.cxf.jaxws.binding.soap.SOAPBindingImpl.getSOAPFactory(
> > SOAPBindingImpl.java:113)
> >     ... 23 more
> >
> > I googled for that error and the only relevant response I could find
> said to
> > make sure that I had the correct version of the saaj library, 1.3 which
> I
> > do.
> >
> > My spring service is defined like this:
> >
> >     <import resource="classpath:META-INF/cxf/cxf.xml" />
> >     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> >     <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
> >
> >     <jaxws:endpoint
> >       id="helloWorld"
> >       implementor="org.foo.service.web.HelloWorldImpl"
> >       address="/HelloWorld" />
> >
> > And the client is defined as:
> >
> > <bean id="client" class="org.foo.service.web.HelloWorld"
> >       factory-bean="clientFactory" factory-method="create"/>
> >
> >     <bean id="clientFactory" class="
> > org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
> >       <property name="serviceClass" value="
> org.foo.service.web.HelloWorld"/>
> >       <property name="address" value="
> > http://localhost:8080/ticketing/HelloWorld"/>
> >     </bean>
> >
> > The versions of the classes from my maven2 pom are:
> >
> > <dependency>
> >             <groupId>org.apache.cxf</groupId>
> >             <artifactId>cxf</artifactId>
> >             <version>2.0-incubator</version>
> >         </dependency>
> >
> >         <dependency>
> >             <groupId>commons-logging</groupId>
> >             <artifactId>commons-logging</artifactId>
> >             <version>1.1</version>
> >         </dependency>
> >
> >         <dependency>
> >             <groupId>javax.activation</groupId>
> >             <artifactId>activation</artifactId>
> >             <version>1.1</version>
> >         </dependency>
> >
> >         <dependency>
> >             <groupId>javax.annotation</groupId>
> >             <artifactId>jsr250-api</artifactId>
> >             <version>1.0</version>
> >         </dependency>
> >
> >         <dependency>
> >             <groupId>javax.mail</groupId>
> >             <artifactId>mail</artifactId>
> >             <version>1.4</version>
> >         </dependency>
> >
> >         <dependency>
> >             <groupId>org.apache.neethi</groupId>
> >             <artifactId>neethi</artifactId>
> >             <version>2.0</version>
> >         </dependency>
> >
> >         <dependency>
> >             <groupId>javax.xml.bind</groupId>
> >             <artifactId>jaxb-api</artifactId>
> >             <version>2.1</version>
> >         </dependency>
> >
> >         <dependency>
> >             <groupId>javax.xml</groupId>
> >             <artifactId>jaxb-impl</artifactId>
> >             <version>2.1.4</version>
> >         </dependency>
> >
> >         <dependency>
> >             <groupId>javax.xml.ws</groupId>
> >             <artifactId>jaxws-api</artifactId>
> >             <version>2.0</version>
> >         </dependency>
> >
> >         <dependency>
> >             <groupId>javax.jws</groupId>
> >             <artifactId>jsr181</artifactId>
> >             <version>1.0</version>
> >         </dependency>
> >
> >         <dependency>
> >             <groupId>javax.xml.soap</groupId>
> >             <artifactId>saaj-api</artifactId>
> >             <version>1.3</version>
> >         </dependency>
> >
> >         <dependency>
> >             <groupId>stax</groupId>
> >             <artifactId>stax-api</artifactId>
> >             <version>1.0.1</version>
> >         </dependency>
> >
> >         <dependency>
> >             <groupId>org.apache.ws.commons</groupId>
> >             <artifactId>XmlSchema</artifactId>
> >             <version>1.1</version>
> >         </dependency>
> >
> >         <dependency>
> >             <groupId>org.codehaus.woodstox</groupId>
> >             <artifactId>wstx-asl</artifactId>
> >             <version>3.2.1</version>
> >         </dependency>
> >
> >         <dependency>
> >             <groupId>wsdl4j</groupId>
> >             <artifactId>wsdl4j</artifactId>
> >             <version>1.6.1</version>
> >         </dependency>
> >
> >         <dependency>
> >             <groupId>aopalliance</groupId>
> >             <artifactId>aopalliance</artifactId>
> >             <version>1.0</version>
> >         </dependency>
> >
> >         <dependency>
> >             <groupId>xml-resolver</groupId>
> >             <artifactId>xml-resolver</artifactId>
> >             <version>1.2</version>
> >         </dependency>
> >
> > Any ideas as to what might be wrong?
> >
> > Thanks,
> >
> > Bryan
>
> --
> Peter Jones
> IONA Technologies Inc.
> E-Mail: mailto:peter.jones@iona.com
> Tel: (w) 709-738-3725 x22 | Fax: 709-738-3745
> 84-86 Elizabeth Ave. St. John's, NL A1A 1W7 Canada
>

Re: SAAJ Error

Posted by Peter Jones <pe...@iona.com>.
Hi Bryan,

I see the saaj-api dependency in your pom entries below, but I don't see a
saaj-impl dependency.  I suspect thats what you are missing.

    <dependency>
        <groupId>com.sun.xml.messaging.saaj</groupId>
        <artifactId>saaj-impl</artifactId>
        <version>1.3</version>
    </dependency>

Let us know if that helps any...

Cheers,
Peter

On Tue, Aug 07, 2007 at 03:19:09PM -0600, Bryan Hansen wrote:
> Hello,
> 
> I am trying to run the example here:
> 
> http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html
> 
> I have setup everything to the best of my knowledge correctly and it deploys
> on the server, but when I try to run the client I get this exception:
> 
> javax.xml.ws.WebServiceException: Cannot create SAAJ factory instance.
>     at org.apache.cxf.jaxws.binding.soap.SOAPBindingImpl.getSOAPFactory(
> SOAPBindingImpl.java:118)
>     at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java
> :150)
>     at $Proxy42.sayHi(Unknown Source)
>     at org.lds.ticketing.integration.WebServiceClientTest.testWebService(
> WebServiceClientTest.java:15)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:585)
>     at junit.framework.TestCase.runTest(TestCase.java:168)
>     at junit.framework.TestCase.runBare(TestCase.java:134)
>     at org.springframework.test.ConditionalTestCase.runBare(
> ConditionalTestCase.java:69)
>     at junit.framework.TestResult$1.protect(TestResult.java:110)
>     at junit.framework.TestResult.runProtected(TestResult.java:128)
>     at junit.framework.TestResult.run(TestResult.java:113)
>     at junit.framework.TestCase.run(TestCase.java:124)
>     at junit.framework.TestSuite.runTest(TestSuite.java:232)
>     at junit.framework.TestSuite.run(TestSuite.java:227)
>     at org.junit.internal.runners.OldTestClassRunner.run(
> OldTestClassRunner.java:76)
>     at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
> JUnit4TestReference.java:38)
>     at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
> TestExecution.java:38)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> RemoteTestRunner.java:460)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> RemoteTestRunner.java:673)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> RemoteTestRunner.java:386)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> RemoteTestRunner.java:196)
> Caused by: javax.xml.soap.SOAPException: Unable to create SOAP Factory:
> Unable to create SAAJ meta-factoryProvider
> com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl not found
>     at javax.xml.soap.SOAPFactory.newInstance(Unknown Source)
>     at org.apache.cxf.jaxws.binding.soap.SOAPBindingImpl.getSOAPFactory(
> SOAPBindingImpl.java:113)
>     ... 23 more
> 
> I googled for that error and the only relevant response I could find said to
> make sure that I had the correct version of the saaj library, 1.3 which I
> do.
> 
> My spring service is defined like this:
> 
>     <import resource="classpath:META-INF/cxf/cxf.xml" />
>     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
>     <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
> 
>     <jaxws:endpoint
>       id="helloWorld"
>       implementor="org.foo.service.web.HelloWorldImpl"
>       address="/HelloWorld" />
> 
> And the client is defined as:
> 
> <bean id="client" class="org.foo.service.web.HelloWorld"
>       factory-bean="clientFactory" factory-method="create"/>
> 
>     <bean id="clientFactory" class="
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
>       <property name="serviceClass" value="org.foo.service.web.HelloWorld"/>
>       <property name="address" value="
> http://localhost:8080/ticketing/HelloWorld"/>
>     </bean>
> 
> The versions of the classes from my maven2 pom are:
> 
> <dependency>
>             <groupId>org.apache.cxf</groupId>
>             <artifactId>cxf</artifactId>
>             <version>2.0-incubator</version>
>         </dependency>
> 
>         <dependency>
>             <groupId>commons-logging</groupId>
>             <artifactId>commons-logging</artifactId>
>             <version>1.1</version>
>         </dependency>
> 
>         <dependency>
>             <groupId>javax.activation</groupId>
>             <artifactId>activation</artifactId>
>             <version>1.1</version>
>         </dependency>
> 
>         <dependency>
>             <groupId>javax.annotation</groupId>
>             <artifactId>jsr250-api</artifactId>
>             <version>1.0</version>
>         </dependency>
> 
>         <dependency>
>             <groupId>javax.mail</groupId>
>             <artifactId>mail</artifactId>
>             <version>1.4</version>
>         </dependency>
> 
>         <dependency>
>             <groupId>org.apache.neethi</groupId>
>             <artifactId>neethi</artifactId>
>             <version>2.0</version>
>         </dependency>
> 
>         <dependency>
>             <groupId>javax.xml.bind</groupId>
>             <artifactId>jaxb-api</artifactId>
>             <version>2.1</version>
>         </dependency>
> 
>         <dependency>
>             <groupId>javax.xml</groupId>
>             <artifactId>jaxb-impl</artifactId>
>             <version>2.1.4</version>
>         </dependency>
> 
>         <dependency>
>             <groupId>javax.xml.ws</groupId>
>             <artifactId>jaxws-api</artifactId>
>             <version>2.0</version>
>         </dependency>
> 
>         <dependency>
>             <groupId>javax.jws</groupId>
>             <artifactId>jsr181</artifactId>
>             <version>1.0</version>
>         </dependency>
> 
>         <dependency>
>             <groupId>javax.xml.soap</groupId>
>             <artifactId>saaj-api</artifactId>
>             <version>1.3</version>
>         </dependency>
> 
>         <dependency>
>             <groupId>stax</groupId>
>             <artifactId>stax-api</artifactId>
>             <version>1.0.1</version>
>         </dependency>
> 
>         <dependency>
>             <groupId>org.apache.ws.commons</groupId>
>             <artifactId>XmlSchema</artifactId>
>             <version>1.1</version>
>         </dependency>
> 
>         <dependency>
>             <groupId>org.codehaus.woodstox</groupId>
>             <artifactId>wstx-asl</artifactId>
>             <version>3.2.1</version>
>         </dependency>
> 
>         <dependency>
>             <groupId>wsdl4j</groupId>
>             <artifactId>wsdl4j</artifactId>
>             <version>1.6.1</version>
>         </dependency>
> 
>         <dependency>
>             <groupId>aopalliance</groupId>
>             <artifactId>aopalliance</artifactId>
>             <version>1.0</version>
>         </dependency>
> 
>         <dependency>
>             <groupId>xml-resolver</groupId>
>             <artifactId>xml-resolver</artifactId>
>             <version>1.2</version>
>         </dependency>
> 
> Any ideas as to what might be wrong?
> 
> Thanks,
> 
> Bryan

-- 
Peter Jones
IONA Technologies Inc.
E-Mail: mailto:peter.jones@iona.com
Tel: (w) 709-738-3725 x22 | Fax: 709-738-3745
84-86 Elizabeth Ave. St. John's, NL A1A 1W7 Canada