Hi All,
I am creating jar and deploying into servicemix 4.5.2 for consume the
webservice project.
while converting Object to SOAP xml i am getting below error: i have checked
my .m2 folder i am having all the version of camel-soap jars:but not luck.
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-soap</artifactId>
<version>2.10.6</version>
</dependency>
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find
class [org.apache.camel.dataformat.soap.name.ServiceInterfaceStrategy] for
bean with name 'myNameStrategy' defined in URL
[bundle://251.0:0/META-INF/spring/camel-context.xml]; nested exception is
java.lang.ClassNotFoundException:
org.apache.camel.dataformat.soap.name.ServiceInterfaceStrategy not found
from bundle [WebService-Client]
---------------------------------------------
Camel-context
-------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://camel.apache.org/schema/cxf"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
http://camel.apache.org/schema/cxf
http://camel.apache.org/schema/cxf/camel-cxf.xsd">
<bean id="enrich" class="com.enricher.Enrich" />
<cxf:cxfEndpoint id="SimpleWebservice"
address="http://localhost:9003/weservice/SimpleWebservice"
wsdlURL="META-INF/wsdl/SimpleWebservice.wsdl"
endpointName="tns:SimpleWebservicePort"
serviceName="tns:ISimpleWebservice"
serviceClass="com.webservice.example.ISimpleWebservice"
xmlns:tns="http://example.webservice.com/">
<cxf:properties>
<entry key="dataFormat" value="MESSAGE" />
</cxf:properties>
</cxf:cxfEndpoint>
<bean id="myNameStrategy"
class="org.apache.camel.dataformat.soap.name.ServiceInterfaceStrategy">
<constructor-arg value="com.enricher.Enrich"/>
<constructor-arg value="true"/>
</bean>
<camelContext xmlns="http://camel.apache.org/schema/spring">
<dataFormats>
<soapjaxb id="soapFormat" contextPath="com.enricher"
elementNameStrategyRef="myNameStrategy"/>
</dataFormats>
<route streamCache="true">
<from uri="file://D:/Input?noop=true;delay=10000"/>
<convertBodyTo type="String"/>
<log message="Name of the client to be created received : ${body}"/>
<bean ref="enrich" method="createCustomer"/>
<log message="Enrich Crossed.....: ${body}"/>
<marshal ref="soapFormat"/>
<log message="CREATE SOAP : ${body}"/>
<to uri="cxf:bean:SimpleWebservice"/>
<log message="SOAP Response received : ${body}"/>
<to uri="bean:enrich?method=createCustomer"/>
</route>
</camelContext>
</beans>
--------------------------------------------------------------
customer.java
------------------
package com.webservice.example;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for customer complex type.
*
* <p>The following schema fragment specifies the expected content contained
within this class.
*
* <pre>
* <complexType name="customer">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="description"
type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="name"
type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "customer", propOrder = {
"description",
"name"
})
public class Customer {
protected String description;
protected String name;
/**
* Gets the value of the description property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDescription() {
return description;
}
/**
* Sets the value of the description property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDescription(String value) {
this.description = value;
}
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
}
--------------------------------
Enrich java
-----------------
package com.enricher;
import org.apache.camel.Body;
import com.webservice.example.Customer;
public class Enrich
{
public Customer createCustomer(String name)
{
System.out.println("Comming to Enrich Method...File Name: "+ name);
Customer customer2 = new Customer();
customer2.setDescription("GOOD DONE....");
customer2.setName(name);
System.out.println("Customer2: "+ customer2);
return customer2;
}
}
---------------------------
pom.xml
-----------------------------
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.file.poller</groupId>
<artifactId>WebService-Client</artifactId>
<packaging>jar</packaging>
<version>1.0.0-SNAPSHOT</version>
<name>A Camel Spring Route</name>
<url>http://www.myorganization.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<repositories>
<repository>
<id>release.fusesource.org</id>
<name>FuseSource Release Repository</name>
<url>http://repo.fusesource.com/nexus/content/repositories/releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>snapshot.fusesource.org</id>
<name>FuseSource Snapshot Repository</name>
<url>http://repo.fusesource.com/nexus/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>release.fusesource.org</id>
<name>FuseSource Release Repository</name>
<url>http://repo.fusesource.com/nexus/content/repositories/releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
<pluginRepository>
<id>snapshot.fusesource.org</id>
<name>FuseSource Snapshot Repository</name>
<url>http://repo.fusesource.com/nexus/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-bindings-soap</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>2.10.6</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-stream</artifactId>
<version>2.10.6</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>2.10.6</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
<version>2.10.6</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-http</artifactId>
<version>2.10.6</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-soap</artifactId>
<version>2.10.6</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jaxb</artifactId>
<version>2.10.6</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>1.1</Bundle-SymbolicName>
<Import-Package>
META-INF.cxf,
org.xmlsoap.schemas.soap.envelope;version=0,
*
</Import-Package>
<DynamicImport-Package>
org.apache.cxf.*,
org.springframework.beans.*
org.apache.camel.dataformat.*
</DynamicImport-Package>
<Private-Package>
com.enricher
</Private-Package>
<Export-Package>
</Export-Package>
<_failok>true</_failok>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.6.0.redhat-60024</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/resources/META-INF/wsdl/SimpleWebservice.wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.camel</groupId>
<artifactId>camel-maven-plugin</artifactId>
<version>2.10.0.redhat-60024</version>
</plugin>
</plugins>
</build>
</project>
--------------------------------------------
can you correct me where i am wrong.
Thanks
David
--
View this message in context:
http://camel.465427.n5.nabble.com/Cannot-find-class-org-apache-camel-dataformat-soap-name-ServiceInterfaceStrategy-tp5741964.html
Sent from the Camel Development mailing list archive at Nabble.com.