You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by js...@gmail.com on 2010/02/08 16:40:25 UTC

java2ws problem

Hi,

I'm new with CXF. I'm using version 2.1.3. When I try to use java2ws
goal from "cxf-java2ws-plugin" maven plugin, I get:

java.lang.ClassNotFoundException:
com.inworx.insurix.commontables.dto.MonedaDTO

This class is in a jar that is correctly configured as a maven
dependency. What do I have to do for the maven plugin to find id?
Thanks in advance
Jorge

Re: java2ws problem

Posted by jaybytez <ja...@yahoo.com>.
So here is a quick example.  

1) I have a pojo called ContactPoint with some basic information and it is
to be represented as a complexType.
2) Pom file for building this into a jar.
3) ContactPointEndpoint is a simple interface that takes in a ContactPoint
and returns it.
4) Pom file that runs java2ws to generate a wsdl, wrapper bean, and client.

This produces a similar error where the ContactPointEndpoint is in its own
project with a dependency to the jar artifact that ContactPoint exists in.

The java2ws generates code and errors, but when I am in Eclipse and look at
the generated wrapper bean and client, there are no errors and it resolves
the classes.

Any thoughts as to what this might be or what I have done wrong?

Thanks a ton!!!   Jay

------------ContactPoint.java---------------------------------
package com.foo;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "http://foo.com/model", name = "ContactPoint",
propOrder = {
        "id", "number" })
public class ContactPoint {

    /** The id. */
    private Long id; // NOPMD

    private String number;

    public Long getId() {
        return id;
    }

    public void setId(final Long id) {
        this.id = id;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(final String number) {
        this.number = number;
    }

}

------------ContactPoint pom.xml---------------------------------
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <artifactId>foo-model</artifactId>
  <groupId>com.foo</groupId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>
</project>

------------ContactPointEndpoint.java---------------------------------
package com.foo;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;

/**
 * Spring service that handles CRUD requests for People entities
 * 
 * @generated
 */
@WebService(targetNamespace = "http://foo.com/service")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.WRAPPED, use =
SOAPBinding.Use.LITERAL, style = SOAPBinding.Style.DOCUMENT)
public interface ContactPointEndpoint {

    /**
     * Save an existing People entity
     * 
     * @generated
     */
    @WebMethod
    @ResponseWrapper(targetNamespace = "http://foo.com/service")
    @RequestWrapper(targetNamespace = "http://foo.com/service")
    @WebResult(targetNamespace = "http://foo.com/model", name =
"updatedContactPoint")
    ContactPoint updateContactPoint(
            @WebParam(targetNamespace = "http://foo.com/model", name =
"criteria") ContactPoint cp);

}

------------ContactPointEndpoint pom.xml---------------------------------
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<artifactId>foo-service</artifactId>
	<groupId>com.foo</groupId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>jar</packaging>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.cxf</groupId>
				<artifactId>cxf-java2ws-plugin</artifactId>
				<version>2.2.9</version>
				<dependencies>
					<dependency>
						<groupId>org.apache.cxf</groupId>
						<artifactId>cxf-rt-frontend-jaxws</artifactId>
						<version>2.2.9</version>
					</dependency>
					<dependency>
						<groupId>org.apache.cxf</groupId>
						<artifactId>cxf-rt-frontend-simple</artifactId>
						<version>2.2.9</version>
					</dependency>
					<dependency>
						<artifactId>foo-model</artifactId>
						<groupId>com.foo</groupId>
						<version>0.0.1-SNAPSHOT</version>
					</dependency>
				</dependencies>

				<executions>
					<execution>
						<id>process-classes</id>
						<phase>process-classes</phase>
						<configuration>
							<className>com.foo.ContactPointEndpoint</className>
							<genWsdl>true</genWsdl>
							<verbose>true</verbose>
							<genClient>true</genClient>
							<genWrapperbean>true</genWrapperbean>
							<frontend>jaxws</frontend>
							<databinding>jaxb</databinding>
							<argline>-createxsdimports -s
								${project.build.directory}/generated-sources/main/java -classdir
								${basedir}/target/classes</argline>
						</configuration>
						<goals>
							<goal>java2ws</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
	<dependencies>
		<dependency>
			<artifactId>foo-model</artifactId>
			<groupId>com.foo</groupId>
			<version>0.0.1-SNAPSHOT</version>
		</dependency>
	</dependencies>
</project>
-- 
View this message in context: http://cxf.547215.n5.nabble.com/java2ws-problem-tp568861p2653030.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: java2ws problem

Posted by Daniel Kulp <dk...@apache.org>.
Can one of you provide a sample application that shows this?

Dan


On Wednesday 25 August 2010 12:34:59 am jaybytez wrote:
> I am having this exact same problem in 2.2.9 and have found no solution to
> it.
> 
> Were you able to solve this problem?
> 
> Right now when I use the plugin, source is generated from my SEI, but
> errors are
> thrown where the SEI refers to any classes that are found in dependency
> jars even
> though I have these jars in my maven dependency and maven plugin
> dependency.
> 
> Any help you can provide would be excellent.
> 
> Thanks...jay

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Re: java2ws problem

Posted by jaybytez <ja...@yahoo.com>.
I am having this exact same problem in 2.2.9 and have found no solution to
it.

Were you able to solve this problem?

Right now when I use the plugin, source is generated from my SEI, but errors
are
thrown where the SEI refers to any classes that are found in dependency jars
even
though I have these jars in my maven dependency and maven plugin dependency.

Any help you can provide would be excellent.

Thanks...jay
-- 
View this message in context: http://cxf.547215.n5.nabble.com/java2ws-problem-tp568861p2652177.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: java2ws problem

Posted by js...@gmail.com.
Thanks Daniel, I'll try that. For now unfortunately, I have to continue
to use cxf 2.1.3
Thanks
Jorge

On Tue, 2010-02-09 at 15:27 -0500, Daniel Kulp wrote:

> On Mon February 8 2010 10:40:25 am jsaridis@gmail.com wrote:
> > Hi,
> > 
> > I'm new with CXF. I'm using version 2.1.3. When I try to use java2ws
> > goal from "cxf-java2ws-plugin" maven plugin, I get:
> 
> Can you try with a newer version of CXF?   Particularly 2.2.6.   If that 
> doesn't help, a test case would be most helpful.
> 
> Dan
>  
> 
> > 
> > java.lang.ClassNotFoundException:
> > com.inworx.insurix.commontables.dto.MonedaDTO
> > 
> > This class is in a jar that is correctly configured as a maven
> > dependency. What do I have to do for the maven plugin to find id?
> > Thanks in advance
> > Jorge
> > 
> 



Re: java2ws problem

Posted by Daniel Kulp <dk...@apache.org>.
On Mon February 8 2010 10:40:25 am jsaridis@gmail.com wrote:
> Hi,
> 
> I'm new with CXF. I'm using version 2.1.3. When I try to use java2ws
> goal from "cxf-java2ws-plugin" maven plugin, I get:

Can you try with a newer version of CXF?   Particularly 2.2.6.   If that 
doesn't help, a test case would be most helpful.

Dan
 

> 
> java.lang.ClassNotFoundException:
> com.inworx.insurix.commontables.dto.MonedaDTO
> 
> This class is in a jar that is correctly configured as a maven
> dependency. What do I have to do for the maven plugin to find id?
> Thanks in advance
> Jorge
> 

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog