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 [EMAIL PROTECTED]:
display name [EMAIL PROTECTED];
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.

Reply via email to