You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by rsheldon <rs...@localmatters.com> on 2008/02/12 08:24:01 UTC

CXF 2.0.3/2.0.4 Build problems with Maven and wsdl2java

This is driving me nuts, so hopefully somebody wiser than me can enlighten
me. Here are the problems I've been having trying to use maven/cxf to
generate code from a wsdl, then wire up a simple client via spring.
Different versions of CXF have different behaviours/features/bugs:

2.0.2 - Generates code from WSDL with no error. When starting the client I
get the following error:

2008-02-11 10:04:21,316 FATAL
com.localmatters.ds.controller.search.WWWSearchController - No conduit
initiator was found for the namespace http://schemas.xmlsoap.org/soap/http.
javax.xml.ws.soap.SOAPFaultException: No conduit initiator was found for the
namespace http://schemas.xmlsoap.org/soap/http.
        at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175)

If I add cxf-rt-transports-http-jetty.jar to my build (maven) then it works
OK. However, I don't want to do this as I'm using tomcat, and don't want
this dependency. So, I thought I would upgrade to 2.0.3 and see what
happens.

2.0.3 gives me the following error when generating the code from wsdl, but
stills runs and says it's successful (from maven):

INFO: Refreshing org.apache.cxf.bus.spring.BusApplicationContext@1d382ab:
display name [org.apache.cxf.bus.spring.BusApplicationContext@1d382ab];
startup date [Mon Feb 11 23:57:02 GMT-07:00 2008]; root of context hierarchy
Feb 11, 2008 11:57:03 PM
org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver
initHandlerMappings
WARNING: Ignoring namespace handler
[org.apache.cxf.jaxws.spring.NamespaceHandler]: problem with handler class
file or dependent class
java.lang.IncompatibleClassChangeError: class
org.apache.cxf.jaxws.EndpointImpl has interface javax.xml.ws.Endpoint as
super class
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at
org.apache.cxf.jaxws.spring.EndpointDefinitionParser.<init>(EndpointDefinitionParser.java:50)
        at
org.apache.cxf.jaxws.spring.NamespaceHandler.init(NamespaceHandler.java:29)

As maven completed successfullly (it said so at least, despite the errors),
I tried it in my application and it seems to work.

2.0.4 - I decided to try 2.0.4 out to see if it gave me the same errors
generating code as 2.0.3. It DID, but this time the maven build fails with
this cryptic message:
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] javax/xml/ws/RequestWrapper


So I'm at a loss really. Am I missing some dependency, or have a wrong
version of a library? I'd like to be using 2.0.4 if possible, but I can't
even get the client generated code to compile! I've attached the relevant
parts of the pom below, in case somebody can see any stupid mistakes.

Thanks a lot, hope somebody can help this CXF newbie. I've been surfing the
web for most of the day trying to work around these different issues.

Richard

<dependencies>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>2.0.4-incubator</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http</artifactId>
            <version>2.0.4-incubator</version>
        </dependency>
        <!-- 
            <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http-jetty</artifactId>
            <version>2.0.4-incubator</version>
            </dependency>
        -->
        <dependency>
            <groupId>javax.xml.ws</groupId>
            <artifactId>jaxws-api</artifactId>
            <version>2.1</version>
        </dependency>
    </dependencies>
....
<plugins>
            <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-codegen-plugin</artifactId>
                <version>2.0.4-incubator</version>
                <executions>
                    <execution>
                        <id>generate-sources</id>
                        <phase>generate-sources</phase>
                        <configuration>
                           
<sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
                            <wsdlOptions>
                                <wsdlOption>
                                   
<wsdl>${basedir}/src/main/wsdl/AccountService.wsdl</wsdl>
                                </wsdlOption>
                            </wsdlOptions>
                        </configuration>
                        <goals>
                            <goal>wsdl2java</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
         </plugins>
....
    <repositories>
        <repository>
            <id>apache-snapshots</id>
            <name>Apache SNAPSHOT Repository</name>
            <url>http://people.apache.org/repo/m2-snapshot-repository/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>apache-incubating</id>
            <name>Apache Incubating Repository</name>
           
<url>http://people.apache.org/repo/m2-incubating-repository/</url>
        </repository>
        <!-- for jaxb-impl -->
        <repository>
            <id>java.net</id>
            <url>http://download.java.net/maven/1/</url>
            <layout>legacy</layout>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>apache-plugin-snapshots</id>
            <name>Apache Maven Plugin Snapshots</name>
            <url>http://people.apache.org/repo/m2-snapshot-repository</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>apache-plugin-incubating</id>
            <name>Apache Plugin Incubating Repository</name>
           
<url>http://people.apache.org/repo/m2-incubating-repository/</url>
        </pluginRepository>
    </pluginRepositories>



-- 
View this message in context: http://www.nabble.com/CXF-2.0.3-2.0.4-Build-problems-with-Maven-and-wsdl2java-tp15427072p15427072.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: CXF 2.0.3/2.0.4 Build problems with Maven and wsdl2java

Posted by Richard Sheldon <rs...@localmatters.com>.
I blew away the 2.0 stuff on our internal shared repo, and in my personal 
repo.  I was able to build 2.0.3 and 2.0.4 without errors, and without the 
additional jaxws-api dependency.

I don't really know where the shared versions on our repo came from. They'd 
been upload by hand a long time ago, as we only recently added the 
repositories that have these jars in them.

Thanks very much for your help. Good job I didn't waste many hours on this :-(

Richard
On Tuesday 12 February 2008 15:04:40 Daniel Kulp wrote:
> My md5 is:
>
> 3bb1b336bec8f94af824b524b2bd515f  jaxws-api-2.0.jar
>
> And there definitely is a WebServiceContext in there.
>
> I just checked:
> http://repo1.maven.org/maven2/javax/xml/ws/jaxws-api/2.0/
>
> And is the same as what I have.   Thus, I'm not sure where you got
> yours.  :-)
>
> Seriously, I would try doing:
>
> rm -rf ~/.m2/repository/javax/xml/ws/jaxws-api
>
> and rebuilding and seeing what it finds and where it finds it.
>
> You're right.  CXF should definitely be pulling in the correct version
> for you, but if there already is a 2.0 version there that is corrupt, it
> won't know that it's corrupt and thus won't re-try grabbing it.  :-(
>
> Dan
>
> On Tuesday 12 February 2008, Richard Sheldon wrote:
> > Daniel,
> >
> > I'm using JDK 5, build 1.5.0_13.
> >
> > If I specify jaxws-api 2.0, I get lots of class not found errors like:
> >
> > java.lang.NoClassDefFoundError: javax/xml/ws/WebServiceContext
> >
> > I checked in the v2.0 jar file in my maven repo, and it doesn't
> > contain this class. I checked the manifest for the jar file, and it
> > says it's specification-version is 2.0.
> >
> > I was actually surprised to have to add any dependency at all, as I
> > didn't see people doing this in the examples, and I thought the CXF
> > poms would have handled it for me (transitive dependencies).
> >
> > Perhaps I have a bad version in my repo? Can you do an md5sum of your
> > 2.0 jar and send it to me (or just send me your 2.0 pom and jar?)
> >
> > Thanks for the help.
> > Richard
> >
> > On Tuesday 12 February 2008 14:29:45 Daniel Kulp wrote:
> > > What version of the JDK are you using?   If you are using JDK 6,
> > > update 4, that's going to be an issue.  (possibly any version of JDK
> > > 6)
> > >
> > > Also, I see:
> > >          <dependency>
> > >              <groupId>javax.xml.ws</groupId>
> > >              <artifactId>jaxws-api</artifactId>
> > >              <version>2.1</version>
> > >          </dependency>
> > >
> > > That's probably going to be a huge issue and may be the cause of the
> > > issue.   CXF 2.0.x implements the JAX-WS 2.0 API, not the 2.1 API.
> > > (CXF 2.1/trunk is working towards the 2.1 API)
> > >
> > > Dan
> > >
> > > On Tuesday 12 February 2008, rsheldon wrote:
> > > > This is driving me nuts, so hopefully somebody wiser than me can
> > > > enlighten me. Here are the problems I've been having trying to use
> > > > maven/cxf to generate code from a wsdl, then wire up a simple
> > > > client via spring. Different versions of CXF have different
> > > > behaviours/features/bugs:
> > > >
> > > > 2.0.2 - Generates code from WSDL with no error. When starting the
> > > > client I get the following error:
> > > >
> > > > 2008-02-11 10:04:21,316 FATAL
> > > > com.localmatters.ds.controller.search.WWWSearchController - No
> > > > conduit initiator was found for the namespace
> > > > http://schemas.xmlsoap.org/soap/http.
> > > > javax.xml.ws.soap.SOAPFaultException: No conduit initiator was
> > > > found for the namespace http://schemas.xmlsoap.org/soap/http.
> > > >         at
> > > > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java
> > > >
> > > >:175 )
> > > >
> > > > If I add cxf-rt-transports-http-jetty.jar to my build (maven) then
> > > > it works OK. However, I don't want to do this as I'm using tomcat,
> > > > and don't want this dependency. So, I thought I would upgrade to
> > > > 2.0.3 and see what happens.
> > > >
> > > > 2.0.3 gives me the following error when generating the code from
> > > > wsdl, but stills runs and says it's successful (from maven):
> > > >
> > > > INFO: Refreshing
> > > > org.apache.cxf.bus.spring.BusApplicationContext@1d382ab: display
> > > > name [org.apache.cxf.bus.spring.BusApplicationContext@1d382ab];
> > > > startup date [Mon Feb 11 23:57:02 GMT-07:00 2008]; root of context
> > > > hierarchy Feb 11, 2008 11:57:03 PM
> > > > org.springframework.beans.factory.xml.DefaultNamespaceHandlerResol
> > > >ver initHandlerMappings
> > > > WARNING: Ignoring namespace handler
> > > > [org.apache.cxf.jaxws.spring.NamespaceHandler]: problem with
> > > > handler class file or dependent class
> > > > java.lang.IncompatibleClassChangeError: class
> > > > org.apache.cxf.jaxws.EndpointImpl has interface
> > > > javax.xml.ws.Endpoint as super class
> > > >         at java.lang.ClassLoader.defineClass1(Native Method)
> > > >         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
> > > >         at
> > > > java.security.SecureClassLoader.defineClass(SecureClassLoader.java
> > > >
> > > >:124 ) at
> > > >
> > > > java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at
> > > > java.net.URLClassLoader.access$100(URLClassLoader.java:56) at
> > > > java.net.URLClassLoader$1.run(URLClassLoader.java:195) at
> > > > java.security.AccessController.doPrivileged(Native Method) at
> > > > java.net.URLClassLoader.findClass(URLClassLoader.java:188) at
> > > > java.lang.ClassLoader.loadClass(ClassLoader.java:306) at
> > > > java.lang.ClassLoader.loadClass(ClassLoader.java:251) at
> > > > java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at
> > > > org.apache.cxf.jaxws.spring.EndpointDefinitionParser.<init>(Endpoi
> > > >ntDe finitionParser.java:50) at
> > > > org.apache.cxf.jaxws.spring.NamespaceHandler.init(NamespaceHandler
> > > >.jav a:29)
> > > >
> > > > As maven completed successfullly (it said so at least, despite the
> > > > errors), I tried it in my application and it seems to work.
> > > >
> > > > 2.0.4 - I decided to try 2.0.4 out to see if it gave me the same
> > > > errors generating code as 2.0.3. It DID, but this time the maven
> > > > build fails with this cryptic message:
> > > > [INFO]
> > > > ------------------------------------------------------------------
> > > >---- -- [ERROR] BUILD ERROR
> > > > [INFO]
> > > > ------------------------------------------------------------------
> > > >---- -- [INFO] javax/xml/ws/RequestWrapper
> > > >
> > > >
> > > > So I'm at a loss really. Am I missing some dependency, or have a
> > > > wrong version of a library? I'd like to be using 2.0.4 if
> > > > possible, but I can't even get the client generated code to
> > > > compile! I've attached the relevant parts of the pom below, in
> > > > case somebody can see any stupid mistakes.
> > > >
> > > > Thanks a lot, hope somebody can help this CXF newbie. I've been
> > > > surfing the web for most of the day trying to work around these
> > > > different issues.
> > > >
> > > > Richard
> > > >
> > > > <dependencies>
> > > >         <dependency>
> > > >             <groupId>org.apache.cxf</groupId>
> > > >             <artifactId>cxf-rt-frontend-jaxws</artifactId>
> > > >             <version>2.0.4-incubator</version>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>org.apache.cxf</groupId>
> > > >             <artifactId>cxf-rt-transports-http</artifactId>
> > > >             <version>2.0.4-incubator</version>
> > > >         </dependency>
> > > >         <!--
> > > >             <dependency>
> > > >             <groupId>org.apache.cxf</groupId>
> > > >             <artifactId>cxf-rt-transports-http-jetty</artifactId>
> > > >             <version>2.0.4-incubator</version>
> > > >             </dependency>
> > > >         -->
> > > >         <dependency>
> > > >             <groupId>javax.xml.ws</groupId>
> > > >             <artifactId>jaxws-api</artifactId>
> > > >             <version>2.1</version>
> > > >         </dependency>
> > > >     </dependencies>
> > > > ....
> > > > <plugins>
> > > >             <plugin>
> > > >                 <groupId>org.apache.cxf</groupId>
> > > >                 <artifactId>cxf-codegen-plugin</artifactId>
> > > >                 <version>2.0.4-incubator</version>
> > > >                 <executions>
> > > >                     <execution>
> > > >                         <id>generate-sources</id>
> > > >                         <phase>generate-sources</phase>
> > > >                         <configuration>
> > > >
> > > > <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
> > > >                             <wsdlOptions>
> > > >                                 <wsdlOption>
> > > >
> > > > <wsdl>${basedir}/src/main/wsdl/AccountService.wsdl</wsdl>
> > > >                                 </wsdlOption>
> > > >                             </wsdlOptions>
> > > >                         </configuration>
> > > >                         <goals>
> > > >                             <goal>wsdl2java</goal>
> > > >                         </goals>
> > > >                     </execution>
> > > >                 </executions>
> > > >             </plugin>
> > > >          </plugins>
> > > > ....
> > > >     <repositories>
> > > >         <repository>
> > > >             <id>apache-snapshots</id>
> > > >             <name>Apache SNAPSHOT Repository</name>
> > > >
> > > > <url>http://people.apache.org/repo/m2-snapshot-repository/</url>
> > > > <snapshots>
> > > >                 <enabled>true</enabled>
> > > >             </snapshots>
> > > >         </repository>
> > > >         <repository>
> > > >             <id>apache-incubating</id>
> > > >             <name>Apache Incubating Repository</name>
> > > >
> > > > <url>http://people.apache.org/repo/m2-incubating-repository/</url>
> > > >         </repository>
> > > >         <!-- for jaxb-impl -->
> > > >         <repository>
> > > >             <id>java.net</id>
> > > >             <url>http://download.java.net/maven/1/</url>
> > > >             <layout>legacy</layout>
> > > >         </repository>
> > > >     </repositories>
> > > >
> > > >     <pluginRepositories>
> > > >         <pluginRepository>
> > > >             <id>apache-plugin-snapshots</id>
> > > >             <name>Apache Maven Plugin Snapshots</name>
> > > >
> > > > <url>http://people.apache.org/repo/m2-snapshot-repository</url>
> > > > <releases>
> > > >                 <enabled>false</enabled>
> > > >             </releases>
> > > >             <snapshots>
> > > >                 <enabled>true</enabled>
> > > >             </snapshots>
> > > >         </pluginRepository>
> > > >         <pluginRepository>
> > > >             <id>apache-plugin-incubating</id>
> > > >             <name>Apache Plugin Incubating Repository</name>
> > > >
> > > > <url>http://people.apache.org/repo/m2-incubating-repository/</url>
> > > >         </pluginRepository>
> > > >     </pluginRepositories>



Re: CXF 2.0.3/2.0.4 Build problems with Maven and wsdl2java

Posted by Daniel Kulp <dk...@apache.org>.

My md5 is:

3bb1b336bec8f94af824b524b2bd515f  jaxws-api-2.0.jar

And there definitely is a WebServiceContext in there. 

I just checked:
http://repo1.maven.org/maven2/javax/xml/ws/jaxws-api/2.0/

And is the same as what I have.   Thus, I'm not sure where you got 
yours.  :-)

Seriously, I would try doing:

rm -rf ~/.m2/repository/javax/xml/ws/jaxws-api

and rebuilding and seeing what it finds and where it finds it.  

You're right.  CXF should definitely be pulling in the correct version 
for you, but if there already is a 2.0 version there that is corrupt, it 
won't know that it's corrupt and thus won't re-try grabbing it.  :-(

Dan



On Tuesday 12 February 2008, Richard Sheldon wrote:
> Daniel,
>
> I'm using JDK 5, build 1.5.0_13.
>
> If I specify jaxws-api 2.0, I get lots of class not found errors like:
>
> java.lang.NoClassDefFoundError: javax/xml/ws/WebServiceContext
>
> I checked in the v2.0 jar file in my maven repo, and it doesn't
> contain this class. I checked the manifest for the jar file, and it
> says it's specification-version is 2.0.
>
> I was actually surprised to have to add any dependency at all, as I
> didn't see people doing this in the examples, and I thought the CXF
> poms would have handled it for me (transitive dependencies).
>
> Perhaps I have a bad version in my repo? Can you do an md5sum of your
> 2.0 jar and send it to me (or just send me your 2.0 pom and jar?)
>
> Thanks for the help.
> Richard
>
> On Tuesday 12 February 2008 14:29:45 Daniel Kulp wrote:
> > What version of the JDK are you using?   If you are using JDK 6,
> > update 4, that's going to be an issue.  (possibly any version of JDK
> > 6)
> >
> > Also, I see:
> >          <dependency>
> >              <groupId>javax.xml.ws</groupId>
> >              <artifactId>jaxws-api</artifactId>
> >              <version>2.1</version>
> >          </dependency>
> >
> > That's probably going to be a huge issue and may be the cause of the
> > issue.   CXF 2.0.x implements the JAX-WS 2.0 API, not the 2.1 API. 
> > (CXF 2.1/trunk is working towards the 2.1 API)
> >
> > Dan
> >
> > On Tuesday 12 February 2008, rsheldon wrote:
> > > This is driving me nuts, so hopefully somebody wiser than me can
> > > enlighten me. Here are the problems I've been having trying to use
> > > maven/cxf to generate code from a wsdl, then wire up a simple
> > > client via spring. Different versions of CXF have different
> > > behaviours/features/bugs:
> > >
> > > 2.0.2 - Generates code from WSDL with no error. When starting the
> > > client I get the following error:
> > >
> > > 2008-02-11 10:04:21,316 FATAL
> > > com.localmatters.ds.controller.search.WWWSearchController - No
> > > conduit initiator was found for the namespace
> > > http://schemas.xmlsoap.org/soap/http.
> > > javax.xml.ws.soap.SOAPFaultException: No conduit initiator was
> > > found for the namespace http://schemas.xmlsoap.org/soap/http.
> > >         at
> > > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java
> > >:175 )
> > >
> > > If I add cxf-rt-transports-http-jetty.jar to my build (maven) then
> > > it works OK. However, I don't want to do this as I'm using tomcat,
> > > and don't want this dependency. So, I thought I would upgrade to
> > > 2.0.3 and see what happens.
> > >
> > > 2.0.3 gives me the following error when generating the code from
> > > wsdl, but stills runs and says it's successful (from maven):
> > >
> > > INFO: Refreshing
> > > org.apache.cxf.bus.spring.BusApplicationContext@1d382ab: display
> > > name [org.apache.cxf.bus.spring.BusApplicationContext@1d382ab];
> > > startup date [Mon Feb 11 23:57:02 GMT-07:00 2008]; root of context
> > > hierarchy Feb 11, 2008 11:57:03 PM
> > > org.springframework.beans.factory.xml.DefaultNamespaceHandlerResol
> > >ver initHandlerMappings
> > > WARNING: Ignoring namespace handler
> > > [org.apache.cxf.jaxws.spring.NamespaceHandler]: problem with
> > > handler class file or dependent class
> > > java.lang.IncompatibleClassChangeError: class
> > > org.apache.cxf.jaxws.EndpointImpl has interface
> > > javax.xml.ws.Endpoint as super class
> > >         at java.lang.ClassLoader.defineClass1(Native Method)
> > >         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
> > >         at
> > > java.security.SecureClassLoader.defineClass(SecureClassLoader.java
> > >:124 ) at
> > > java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at
> > > java.net.URLClassLoader.access$100(URLClassLoader.java:56) at
> > > java.net.URLClassLoader$1.run(URLClassLoader.java:195) at
> > > java.security.AccessController.doPrivileged(Native Method) at
> > > java.net.URLClassLoader.findClass(URLClassLoader.java:188) at
> > > java.lang.ClassLoader.loadClass(ClassLoader.java:306) at
> > > java.lang.ClassLoader.loadClass(ClassLoader.java:251) at
> > > java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at
> > > org.apache.cxf.jaxws.spring.EndpointDefinitionParser.<init>(Endpoi
> > >ntDe finitionParser.java:50) at
> > > org.apache.cxf.jaxws.spring.NamespaceHandler.init(NamespaceHandler
> > >.jav a:29)
> > >
> > > As maven completed successfullly (it said so at least, despite the
> > > errors), I tried it in my application and it seems to work.
> > >
> > > 2.0.4 - I decided to try 2.0.4 out to see if it gave me the same
> > > errors generating code as 2.0.3. It DID, but this time the maven
> > > build fails with this cryptic message:
> > > [INFO]
> > > ------------------------------------------------------------------
> > >---- -- [ERROR] BUILD ERROR
> > > [INFO]
> > > ------------------------------------------------------------------
> > >---- -- [INFO] javax/xml/ws/RequestWrapper
> > >
> > >
> > > So I'm at a loss really. Am I missing some dependency, or have a
> > > wrong version of a library? I'd like to be using 2.0.4 if
> > > possible, but I can't even get the client generated code to
> > > compile! I've attached the relevant parts of the pom below, in
> > > case somebody can see any stupid mistakes.
> > >
> > > Thanks a lot, hope somebody can help this CXF newbie. I've been
> > > surfing the web for most of the day trying to work around these
> > > different issues.
> > >
> > > Richard
> > >
> > > <dependencies>
> > >         <dependency>
> > >             <groupId>org.apache.cxf</groupId>
> > >             <artifactId>cxf-rt-frontend-jaxws</artifactId>
> > >             <version>2.0.4-incubator</version>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>org.apache.cxf</groupId>
> > >             <artifactId>cxf-rt-transports-http</artifactId>
> > >             <version>2.0.4-incubator</version>
> > >         </dependency>
> > >         <!--
> > >             <dependency>
> > >             <groupId>org.apache.cxf</groupId>
> > >             <artifactId>cxf-rt-transports-http-jetty</artifactId>
> > >             <version>2.0.4-incubator</version>
> > >             </dependency>
> > >         -->
> > >         <dependency>
> > >             <groupId>javax.xml.ws</groupId>
> > >             <artifactId>jaxws-api</artifactId>
> > >             <version>2.1</version>
> > >         </dependency>
> > >     </dependencies>
> > > ....
> > > <plugins>
> > >             <plugin>
> > >                 <groupId>org.apache.cxf</groupId>
> > >                 <artifactId>cxf-codegen-plugin</artifactId>
> > >                 <version>2.0.4-incubator</version>
> > >                 <executions>
> > >                     <execution>
> > >                         <id>generate-sources</id>
> > >                         <phase>generate-sources</phase>
> > >                         <configuration>
> > >
> > > <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
> > >                             <wsdlOptions>
> > >                                 <wsdlOption>
> > >
> > > <wsdl>${basedir}/src/main/wsdl/AccountService.wsdl</wsdl>
> > >                                 </wsdlOption>
> > >                             </wsdlOptions>
> > >                         </configuration>
> > >                         <goals>
> > >                             <goal>wsdl2java</goal>
> > >                         </goals>
> > >                     </execution>
> > >                 </executions>
> > >             </plugin>
> > >          </plugins>
> > > ....
> > >     <repositories>
> > >         <repository>
> > >             <id>apache-snapshots</id>
> > >             <name>Apache SNAPSHOT Repository</name>
> > >
> > > <url>http://people.apache.org/repo/m2-snapshot-repository/</url>
> > > <snapshots>
> > >                 <enabled>true</enabled>
> > >             </snapshots>
> > >         </repository>
> > >         <repository>
> > >             <id>apache-incubating</id>
> > >             <name>Apache Incubating Repository</name>
> > >
> > > <url>http://people.apache.org/repo/m2-incubating-repository/</url>
> > >         </repository>
> > >         <!-- for jaxb-impl -->
> > >         <repository>
> > >             <id>java.net</id>
> > >             <url>http://download.java.net/maven/1/</url>
> > >             <layout>legacy</layout>
> > >         </repository>
> > >     </repositories>
> > >
> > >     <pluginRepositories>
> > >         <pluginRepository>
> > >             <id>apache-plugin-snapshots</id>
> > >             <name>Apache Maven Plugin Snapshots</name>
> > >
> > > <url>http://people.apache.org/repo/m2-snapshot-repository</url>
> > > <releases>
> > >                 <enabled>false</enabled>
> > >             </releases>
> > >             <snapshots>
> > >                 <enabled>true</enabled>
> > >             </snapshots>
> > >         </pluginRepository>
> > >         <pluginRepository>
> > >             <id>apache-plugin-incubating</id>
> > >             <name>Apache Plugin Incubating Repository</name>
> > >
> > > <url>http://people.apache.org/repo/m2-incubating-repository/</url>
> > >         </pluginRepository>
> > >     </pluginRepositories>



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Re: CXF 2.0.3/2.0.4 Build problems with Maven and wsdl2java

Posted by Richard Sheldon <rs...@localmatters.com>.
Daniel,

I'm using JDK 5, build 1.5.0_13.

If I specify jaxws-api 2.0, I get lots of class not found errors like:

java.lang.NoClassDefFoundError: javax/xml/ws/WebServiceContext

I checked in the v2.0 jar file in my maven repo, and it doesn't contain this 
class. I checked the manifest for the jar file, and it says it's 
specification-version is 2.0.

I was actually surprised to have to add any dependency at all, as I didn't see 
people doing this in the examples, and I thought the CXF poms would have 
handled it for me (transitive dependencies).

Perhaps I have a bad version in my repo? Can you do an md5sum of your 2.0 jar 
and send it to me (or just send me your 2.0 pom and jar?)

Thanks for the help.
Richard

On Tuesday 12 February 2008 14:29:45 Daniel Kulp wrote:
> What version of the JDK are you using?   If you are using JDK 6, update
> 4, that's going to be an issue.  (possibly any version of JDK 6)
>
> Also, I see:
>          <dependency>
>              <groupId>javax.xml.ws</groupId>
>              <artifactId>jaxws-api</artifactId>
>              <version>2.1</version>
>          </dependency>
>
> That's probably going to be a huge issue and may be the cause of the
> issue.   CXF 2.0.x implements the JAX-WS 2.0 API, not the 2.1 API.  (CXF
> 2.1/trunk is working towards the 2.1 API)
>
> Dan
>
> On Tuesday 12 February 2008, rsheldon wrote:
> > This is driving me nuts, so hopefully somebody wiser than me can
> > enlighten me. Here are the problems I've been having trying to use
> > maven/cxf to generate code from a wsdl, then wire up a simple client
> > via spring. Different versions of CXF have different
> > behaviours/features/bugs:
> >
> > 2.0.2 - Generates code from WSDL with no error. When starting the
> > client I get the following error:
> >
> > 2008-02-11 10:04:21,316 FATAL
> > com.localmatters.ds.controller.search.WWWSearchController - No conduit
> > initiator was found for the namespace
> > http://schemas.xmlsoap.org/soap/http.
> > javax.xml.ws.soap.SOAPFaultException: No conduit initiator was found
> > for the namespace http://schemas.xmlsoap.org/soap/http.
> >         at
> > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175
> >)
> >
> > If I add cxf-rt-transports-http-jetty.jar to my build (maven) then it
> > works OK. However, I don't want to do this as I'm using tomcat, and
> > don't want this dependency. So, I thought I would upgrade to 2.0.3 and
> > see what happens.
> >
> > 2.0.3 gives me the following error when generating the code from wsdl,
> > but stills runs and says it's successful (from maven):
> >
> > INFO: Refreshing
> > org.apache.cxf.bus.spring.BusApplicationContext@1d382ab: display name
> > [org.apache.cxf.bus.spring.BusApplicationContext@1d382ab]; startup
> > date [Mon Feb 11 23:57:02 GMT-07:00 2008]; root of context hierarchy
> > Feb 11, 2008 11:57:03 PM
> > org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver
> > initHandlerMappings
> > WARNING: Ignoring namespace handler
> > [org.apache.cxf.jaxws.spring.NamespaceHandler]: problem with handler
> > class file or dependent class
> > java.lang.IncompatibleClassChangeError: class
> > org.apache.cxf.jaxws.EndpointImpl has interface javax.xml.ws.Endpoint
> > as super class
> >         at java.lang.ClassLoader.defineClass1(Native Method)
> >         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
> >         at
> > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124
> >) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at
> > java.net.URLClassLoader.access$100(URLClassLoader.java:56) at
> > java.net.URLClassLoader$1.run(URLClassLoader.java:195) at
> > java.security.AccessController.doPrivileged(Native Method) at
> > java.net.URLClassLoader.findClass(URLClassLoader.java:188) at
> > java.lang.ClassLoader.loadClass(ClassLoader.java:306) at
> > java.lang.ClassLoader.loadClass(ClassLoader.java:251) at
> > java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at
> > org.apache.cxf.jaxws.spring.EndpointDefinitionParser.<init>(EndpointDe
> >finitionParser.java:50) at
> > org.apache.cxf.jaxws.spring.NamespaceHandler.init(NamespaceHandler.jav
> >a:29)
> >
> > As maven completed successfullly (it said so at least, despite the
> > errors), I tried it in my application and it seems to work.
> >
> > 2.0.4 - I decided to try 2.0.4 out to see if it gave me the same
> > errors generating code as 2.0.3. It DID, but this time the maven build
> > fails with this cryptic message:
> > [INFO]
> > ----------------------------------------------------------------------
> >-- [ERROR] BUILD ERROR
> > [INFO]
> > ----------------------------------------------------------------------
> >-- [INFO] javax/xml/ws/RequestWrapper
> >
> >
> > So I'm at a loss really. Am I missing some dependency, or have a wrong
> > version of a library? I'd like to be using 2.0.4 if possible, but I
> > can't even get the client generated code to compile! I've attached the
> > relevant parts of the pom below, in case somebody can see any stupid
> > mistakes.
> >
> > Thanks a lot, hope somebody can help this CXF newbie. I've been
> > surfing the web for most of the day trying to work around these
> > different issues.
> >
> > Richard
> >
> > <dependencies>
> >         <dependency>
> >             <groupId>org.apache.cxf</groupId>
> >             <artifactId>cxf-rt-frontend-jaxws</artifactId>
> >             <version>2.0.4-incubator</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.apache.cxf</groupId>
> >             <artifactId>cxf-rt-transports-http</artifactId>
> >             <version>2.0.4-incubator</version>
> >         </dependency>
> >         <!--
> >             <dependency>
> >             <groupId>org.apache.cxf</groupId>
> >             <artifactId>cxf-rt-transports-http-jetty</artifactId>
> >             <version>2.0.4-incubator</version>
> >             </dependency>
> >         -->
> >         <dependency>
> >             <groupId>javax.xml.ws</groupId>
> >             <artifactId>jaxws-api</artifactId>
> >             <version>2.1</version>
> >         </dependency>
> >     </dependencies>
> > ....
> > <plugins>
> >             <plugin>
> >                 <groupId>org.apache.cxf</groupId>
> >                 <artifactId>cxf-codegen-plugin</artifactId>
> >                 <version>2.0.4-incubator</version>
> >                 <executions>
> >                     <execution>
> >                         <id>generate-sources</id>
> >                         <phase>generate-sources</phase>
> >                         <configuration>
> >
> > <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
> >                             <wsdlOptions>
> >                                 <wsdlOption>
> >
> > <wsdl>${basedir}/src/main/wsdl/AccountService.wsdl</wsdl>
> >                                 </wsdlOption>
> >                             </wsdlOptions>
> >                         </configuration>
> >                         <goals>
> >                             <goal>wsdl2java</goal>
> >                         </goals>
> >                     </execution>
> >                 </executions>
> >             </plugin>
> >          </plugins>
> > ....
> >     <repositories>
> >         <repository>
> >             <id>apache-snapshots</id>
> >             <name>Apache SNAPSHOT Repository</name>
> >
> > <url>http://people.apache.org/repo/m2-snapshot-repository/</url>
> > <snapshots>
> >                 <enabled>true</enabled>
> >             </snapshots>
> >         </repository>
> >         <repository>
> >             <id>apache-incubating</id>
> >             <name>Apache Incubating Repository</name>
> >
> > <url>http://people.apache.org/repo/m2-incubating-repository/</url>
> >         </repository>
> >         <!-- for jaxb-impl -->
> >         <repository>
> >             <id>java.net</id>
> >             <url>http://download.java.net/maven/1/</url>
> >             <layout>legacy</layout>
> >         </repository>
> >     </repositories>
> >
> >     <pluginRepositories>
> >         <pluginRepository>
> >             <id>apache-plugin-snapshots</id>
> >             <name>Apache Maven Plugin Snapshots</name>
> >
> > <url>http://people.apache.org/repo/m2-snapshot-repository</url>
> > <releases>
> >                 <enabled>false</enabled>
> >             </releases>
> >             <snapshots>
> >                 <enabled>true</enabled>
> >             </snapshots>
> >         </pluginRepository>
> >         <pluginRepository>
> >             <id>apache-plugin-incubating</id>
> >             <name>Apache Plugin Incubating Repository</name>
> >
> > <url>http://people.apache.org/repo/m2-incubating-repository/</url>
> >         </pluginRepository>
> >     </pluginRepositories>



Re: CXF 2.0.3/2.0.4 Build problems with Maven and wsdl2java

Posted by Daniel Kulp <dk...@apache.org>.
What version of the JDK are you using?   If you are using JDK 6, update 
4, that's going to be an issue.  (possibly any version of JDK 6)

Also, I see:
         <dependency>
             <groupId>javax.xml.ws</groupId>
             <artifactId>jaxws-api</artifactId>
             <version>2.1</version>
         </dependency>

That's probably going to be a huge issue and may be the cause of the 
issue.   CXF 2.0.x implements the JAX-WS 2.0 API, not the 2.1 API.  (CXF 
2.1/trunk is working towards the 2.1 API)

Dan



On Tuesday 12 February 2008, rsheldon wrote:
> This is driving me nuts, so hopefully somebody wiser than me can
> enlighten me. Here are the problems I've been having trying to use
> maven/cxf to generate code from a wsdl, then wire up a simple client
> via spring. Different versions of CXF have different
> behaviours/features/bugs:
>
> 2.0.2 - Generates code from WSDL with no error. When starting the
> client I get the following error:
>
> 2008-02-11 10:04:21,316 FATAL
> com.localmatters.ds.controller.search.WWWSearchController - No conduit
> initiator was found for the namespace
> http://schemas.xmlsoap.org/soap/http.
> javax.xml.ws.soap.SOAPFaultException: No conduit initiator was found
> for the namespace http://schemas.xmlsoap.org/soap/http.
>         at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175
>)
>
> If I add cxf-rt-transports-http-jetty.jar to my build (maven) then it
> works OK. However, I don't want to do this as I'm using tomcat, and
> don't want this dependency. So, I thought I would upgrade to 2.0.3 and
> see what happens.
>
> 2.0.3 gives me the following error when generating the code from wsdl,
> but stills runs and says it's successful (from maven):
>
> INFO: Refreshing
> org.apache.cxf.bus.spring.BusApplicationContext@1d382ab: display name
> [org.apache.cxf.bus.spring.BusApplicationContext@1d382ab]; startup
> date [Mon Feb 11 23:57:02 GMT-07:00 2008]; root of context hierarchy
> Feb 11, 2008 11:57:03 PM
> org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver
> initHandlerMappings
> WARNING: Ignoring namespace handler
> [org.apache.cxf.jaxws.spring.NamespaceHandler]: problem with handler
> class file or dependent class
> java.lang.IncompatibleClassChangeError: class
> org.apache.cxf.jaxws.EndpointImpl has interface javax.xml.ws.Endpoint
> as super class
>         at java.lang.ClassLoader.defineClass1(Native Method)
>         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>         at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124
>) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at
> java.net.URLClassLoader.access$100(URLClassLoader.java:56) at
> java.net.URLClassLoader$1.run(URLClassLoader.java:195) at
> java.security.AccessController.doPrivileged(Native Method) at
> java.net.URLClassLoader.findClass(URLClassLoader.java:188) at
> java.lang.ClassLoader.loadClass(ClassLoader.java:306) at
> java.lang.ClassLoader.loadClass(ClassLoader.java:251) at
> java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at
> org.apache.cxf.jaxws.spring.EndpointDefinitionParser.<init>(EndpointDe
>finitionParser.java:50) at
> org.apache.cxf.jaxws.spring.NamespaceHandler.init(NamespaceHandler.jav
>a:29)
>
> As maven completed successfullly (it said so at least, despite the
> errors), I tried it in my application and it seems to work.
>
> 2.0.4 - I decided to try 2.0.4 out to see if it gave me the same
> errors generating code as 2.0.3. It DID, but this time the maven build
> fails with this cryptic message:
> [INFO]
> ----------------------------------------------------------------------
>-- [ERROR] BUILD ERROR
> [INFO]
> ----------------------------------------------------------------------
>-- [INFO] javax/xml/ws/RequestWrapper
>
>
> So I'm at a loss really. Am I missing some dependency, or have a wrong
> version of a library? I'd like to be using 2.0.4 if possible, but I
> can't even get the client generated code to compile! I've attached the
> relevant parts of the pom below, in case somebody can see any stupid
> mistakes.
>
> Thanks a lot, hope somebody can help this CXF newbie. I've been
> surfing the web for most of the day trying to work around these
> different issues.
>
> Richard
>
> <dependencies>
>         <dependency>
>             <groupId>org.apache.cxf</groupId>
>             <artifactId>cxf-rt-frontend-jaxws</artifactId>
>             <version>2.0.4-incubator</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.cxf</groupId>
>             <artifactId>cxf-rt-transports-http</artifactId>
>             <version>2.0.4-incubator</version>
>         </dependency>
>         <!--
>             <dependency>
>             <groupId>org.apache.cxf</groupId>
>             <artifactId>cxf-rt-transports-http-jetty</artifactId>
>             <version>2.0.4-incubator</version>
>             </dependency>
>         -->
>         <dependency>
>             <groupId>javax.xml.ws</groupId>
>             <artifactId>jaxws-api</artifactId>
>             <version>2.1</version>
>         </dependency>
>     </dependencies>
> ....
> <plugins>
>             <plugin>
>                 <groupId>org.apache.cxf</groupId>
>                 <artifactId>cxf-codegen-plugin</artifactId>
>                 <version>2.0.4-incubator</version>
>                 <executions>
>                     <execution>
>                         <id>generate-sources</id>
>                         <phase>generate-sources</phase>
>                         <configuration>
>
> <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
>                             <wsdlOptions>
>                                 <wsdlOption>
>
> <wsdl>${basedir}/src/main/wsdl/AccountService.wsdl</wsdl>
>                                 </wsdlOption>
>                             </wsdlOptions>
>                         </configuration>
>                         <goals>
>                             <goal>wsdl2java</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>             </plugin>
>          </plugins>
> ....
>     <repositories>
>         <repository>
>             <id>apache-snapshots</id>
>             <name>Apache SNAPSHOT Repository</name>
>            
> <url>http://people.apache.org/repo/m2-snapshot-repository/</url>
> <snapshots>
>                 <enabled>true</enabled>
>             </snapshots>
>         </repository>
>         <repository>
>             <id>apache-incubating</id>
>             <name>Apache Incubating Repository</name>
>
> <url>http://people.apache.org/repo/m2-incubating-repository/</url>
>         </repository>
>         <!-- for jaxb-impl -->
>         <repository>
>             <id>java.net</id>
>             <url>http://download.java.net/maven/1/</url>
>             <layout>legacy</layout>
>         </repository>
>     </repositories>
>
>     <pluginRepositories>
>         <pluginRepository>
>             <id>apache-plugin-snapshots</id>
>             <name>Apache Maven Plugin Snapshots</name>
>            
> <url>http://people.apache.org/repo/m2-snapshot-repository</url>
> <releases>
>                 <enabled>false</enabled>
>             </releases>
>             <snapshots>
>                 <enabled>true</enabled>
>             </snapshots>
>         </pluginRepository>
>         <pluginRepository>
>             <id>apache-plugin-incubating</id>
>             <name>Apache Plugin Incubating Repository</name>
>
> <url>http://people.apache.org/repo/m2-incubating-repository/</url>
>         </pluginRepository>
>     </pluginRepositories>



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog