You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by cmoulliard <cm...@gmail.com> on 2009/03/09 16:01:36 UTC

java.lang.NoClassDefFoundError: org/apache/camel/model/RouteType - camel 2.0

Hi,

When I deploy the following routes on SMX4, 

<?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:camel="http://camel.apache.org/schema/spring"
	xmlns:cxf="http://camel.apache.org/schema/cxf"
	xsi:schemaLocation=" http://www.springframework.org/schema/beans
		http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
		http://camel.apache.org/schema/osgi
		http://camel.apache.org/schema/osgi/camel-osgi.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="bindyDataformat"
class="org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat">
		<constructor-arg type="java.lang.String"
			value="org.apache.camel.example.reportincident.model" />
	</bean>

	<bean id="csv" class="org.apache.camel.example.reportincident.beans.Csv" />
	<bean id="webService"
class="org.apache.camel.example.reportincident.beans.WebService" />

	<!--
		<bean id="reportIncidentEndpoint"
		class="org.apache.camel.example.reportincident.ReportIncidentEndpoint"/>
	-->

	<bean id="OK"
		class="org.apache.camel.example.reportincident.OutputReportIncident">
		<property name="code" value="0" />
	</bean>

	<bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
		<property name="brokerURL" value="vm://localhost:61616" />
	</bean>


	<!-- webservice endpoint  -->
	<cxf:cxfEndpoint id="reportIncident"
		address="http://localhost:8080/camel-example/incident"
wsdlURL="wsdl/report_incident.wsdl"
	
serviceClass="org.apache.camel.example.reportincident.ReportIncidentEndpoint"
		xmlns:s="http://reportincident.example.camel.apache.org">
	</cxf:cxfEndpoint>

	<camelContext trace="true" xmlns="http://camel.apache.org/schema/osgi">

	
<camel:package>org.apache.camel.example.reportincident.routing</camel:package>

		<!-- File route  -->
		<camel:route>
			<camel:from	uri="file://d:/temp/data/?move=d:/temp/done/${file:name}" />
			<camel:unmarshal ref="bindyDataformat" />
			<camel:to uri="bean:csv" />
			<camel:to uri="activemq:queue:in" />
		</camel:route>
		
		<camel:route>
			<camel:from uri="activemq:queue:in" />
			<camel:to uri="file://d:/temp/data/queue/" />
		</camel:route>

	</camelContext>
</beans>


then Camel generates the following error :

15:56:53,890 | ERROR | xtenderThread-10 | WaiterApplicationContextExecutor |
WaiterApplicationContextExecutor  398 | Unable to create application context
for [reportincid
ent.interfaces], unsatisfied dependencies: none
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected
exception parsing XML document from URL
[bundle://54.0:0/META-INF/spring/camel-context.xml]; ne
sted exception is java.lang.NoClassDefFoundError:
org/apache/camel/model/RouteType
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:420)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
        at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
        at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
        at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
        at
org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:176)
        at
org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:142)
        at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
        at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
        at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:68)
        at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:259)
        at
org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
        at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:237)
        at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.
java:215)
        at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.j
ava:168)
        at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:179)
        at
org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:759)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NoClassDefFoundError: org/apache/camel/model/RouteType
        at
org.apache.camel.osgi.CamelNamespaceHandler.getJaxbPackages(CamelNamespaceHandler.java:47)
        at
org.apache.camel.osgi.CamelNamespaceHandler.createJaxbContext(CamelNamespaceHandler.java:34)
        at
org.apache.camel.spring.handler.CamelNamespaceHandler.getJaxbContext(CamelNamespaceHandler.java:150)
        at
org.apache.camel.spring.handler.CamelNamespaceHandler.parseUsingJaxb(CamelNamespaceHandler.java:141)
        at
org.apache.camel.spring.handler.CamelNamespaceHandler$CamelContextBeanDefinitionParser.doParse(CamelNamespaceHandler.java:196)
        at
org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:84)
        at
org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:56)
        at
org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
        at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1297)
        at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
        at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
        at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)

REMARK : Everything works fine outside of SMX4 (OSGI server)

Surprisingly, this class does not exist in the Camel 2.-SNAPSHOT. So, from
where this error comes from ?

Regards,

Charles

-----
Charles Moulliard
SOA Architect

My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: http://www.nabble.com/java.lang.NoClassDefFoundError%3A-org-apache-camel-model-RouteType---camel-2.0-tp22413437p22413437.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: java.lang.NoClassDefFoundError: org/apache/camel/model/RouteType - camel 2.0

Posted by Claus Ibsen <cl...@gmail.com>.
Yeah all camel components have been rebuild. You need to rebuild and
install new bundles of any camel component you use, also
camel-spring-javaconfig

And could you look in your class:
com.xpectis.camel.bindy.csv.FileCsvUnmarshalTest$ContextConfig

Looks like it is using the old classes!!


On Tue, Mar 10, 2009 at 10:36 AM, cmoulliard <cm...@gmail.com> wrote:
>
> Claus,
>
> Have you also updated the code to build the routes when we use spring
> javaconfig :
>
> @ContextConfiguration(locations =
> "com.xpectis.camel.bindy.csv.FileCsvUnmarshalTest$ContextConfig", loader =
> JavaConfigContextLoader.class)
> public class FileCsvUnmarshalTest extends AbstractJUnit4SpringContextTests {
>
>    @EndpointInject(uri = "mock:result")
>    private MockEndpoint resultEndpoint;
>
>    @Test
>    public void testUnMarshallMessage() throws Exception {
>        resultEndpoint.expectedMessageCount(1);
>        resultEndpoint.assertIsSatisfied();
>    }
>
>    @Configuration
>    public static class ContextConfig extends SingleRouteCamelConfiguration
> {
>
>        BindyCsvDataFormat camelDataFormat = new
> BindyCsvDataFormat("com.xpectis.camel.bindy.model");
>
>        @Override
>        @Bean
>        public RouteBuilder route() {
>            return new RouteBuilder() {
>                @Override
>                public void configure() {
>
> from("file://src/data?noop=true").unmarshal(camelDataFormat).to("mock:result");
>                }
>            };
>        }
>    }
>
> }
>
> because I have the same error in this case.
>
> Caused by: java.lang.NoSuchMethodError:
> com.xpectis.camel.bindy.csv.FileCsvUnmarshalTest$ContextConfig$1.from(Ljava/lang/String;)Lorg/apache/camel/model/RouteType;
>        at
> com.xpectis.camel.bindy.csv.FileCsvUnmarshalTest$ContextConfig$1.configure(FileCsvUnmarshalTest.java:53)
>        at
> org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:240)
>        at
> org.apache.camel.builder.RouteBuilder.getRouteList(RouteBuilder.java:214)
>        at
> org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:437)
>        at
> org.apache.camel.spring.javaconfig.CamelConfiguration.camelContext(CamelConfiguration.java:58)
>        at
> com.xpectis.camel.bindy.csv.FileCsvUnmarshalTest$ContextConfig$$EnhancerByCGLIB$$608ff13b.CGLIB$camelContext$3(<generated>)
>        at
> com.xpectis.camel.bindy.csv.FileCsvUnmarshalTest$ContextConfig$$EnhancerByCGLIB$$608ff13b$$FastClassByCGLIB$$ea63cc09.invoke(<generated>)
>        at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
>        at
> org.springframework.config.java.annotation.BeanMethodInterceptor.intercept(BeanMethodInterceptor.java:65)
>        at
> com.xpectis.camel.bindy.csv.FileCsvUnmarshalTest$ContextConfig$$EnhancerByCGLIB$$608ff13b.camelContext(<generated>)
>        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:597)
>        at
> org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:115)
>
>
> cmoulliard wrote:
>>
>> I will recheck but I have done a build of camel-core, camel-spring,
>> camel-osgi and camel-bindy yesterday afternoon.
>>
>>
>> Claus Ibsen-2 wrote:
>>>
>>> The classes have been renamed lately in Camel. xxxType is now named
>>> xxxDefinition.
>>>
>>> So you need to update all camel jars in your container. Also camel-spring
>>>
>>>
>>> On Mon, Mar 9, 2009 at 4:01 PM, cmoulliard <cm...@gmail.com> wrote:
>>>>
>>>> Hi,
>>>>
>>>> When I deploy the following routes on SMX4,
>>>>
>>>> <?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:camel="http://camel.apache.org/schema/spring"
>>>>        xmlns:cxf="http://camel.apache.org/schema/cxf"
>>>>        xsi:schemaLocation=" http://www.springframework.org/schema/beans
>>>>
>>>>  http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>>>>                http://camel.apache.org/schema/osgi
>>>>                http://camel.apache.org/schema/osgi/camel-osgi.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="bindyDataformat"
>>>> class="org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat">
>>>>                <constructor-arg type="java.lang.String"
>>>>
>>>>  value="org.apache.camel.example.reportincident.model" />
>>>>        </bean>
>>>>
>>>>        <bean id="csv"
>>>> class="org.apache.camel.example.reportincident.beans.Csv" />
>>>>        <bean id="webService"
>>>> class="org.apache.camel.example.reportincident.beans.WebService" />
>>>>
>>>>        <!--
>>>>                <bean id="reportIncidentEndpoint"
>>>>
>>>>  class="org.apache.camel.example.reportincident.ReportIncidentEndpoint"/>
>>>>        -->
>>>>
>>>>        <bean id="OK"
>>>>
>>>>  class="org.apache.camel.example.reportincident.OutputReportIncident">
>>>>                <property name="code" value="0" />
>>>>        </bean>
>>>>
>>>>        <bean id="activemq"
>>>> class="org.apache.activemq.camel.component.ActiveMQComponent">
>>>>                <property name="brokerURL" value="vm://localhost:61616"
>>>> />
>>>>        </bean>
>>>>
>>>>
>>>>        <!-- webservice endpoint  -->
>>>>        <cxf:cxfEndpoint id="reportIncident"
>>>>                address="http://localhost:8080/camel-example/incident"
>>>> wsdlURL="wsdl/report_incident.wsdl"
>>>>
>>>> serviceClass="org.apache.camel.example.reportincident.ReportIncidentEndpoint"
>>>>                xmlns:s="http://reportincident.example.camel.apache.org">
>>>>        </cxf:cxfEndpoint>
>>>>
>>>>        <camelContext trace="true"
>>>> xmlns="http://camel.apache.org/schema/osgi">
>>>>
>>>>
>>>> <camel:package>org.apache.camel.example.reportincident.routing</camel:package>
>>>>
>>>>                <!-- File route  -->
>>>>                <camel:route>
>>>>                        <camel:from
>>>> uri="file://d:/temp/data/?move=d:/temp/done/${file:name}" />
>>>>                        <camel:unmarshal ref="bindyDataformat" />
>>>>                        <camel:to uri="bean:csv" />
>>>>                        <camel:to uri="activemq:queue:in" />
>>>>                </camel:route>
>>>>
>>>>                <camel:route>
>>>>                        <camel:from uri="activemq:queue:in" />
>>>>                        <camel:to uri="file://d:/temp/data/queue/" />
>>>>                </camel:route>
>>>>
>>>>        </camelContext>
>>>> </beans>
>>>>
>>>>
>>>> then Camel generates the following error :
>>>>
>>>> 15:56:53,890 | ERROR | xtenderThread-10 |
>>>> WaiterApplicationContextExecutor |
>>>> WaiterApplicationContextExecutor  398 | Unable to create application
>>>> context
>>>> for [reportincid
>>>> ent.interfaces], unsatisfied dependencies: none
>>>> org.springframework.beans.factory.BeanDefinitionStoreException:
>>>> Unexpected
>>>> exception parsing XML document from URL
>>>> [bundle://54.0:0/META-INF/spring/camel-context.xml]; ne
>>>> sted exception is java.lang.NoClassDefFoundError:
>>>> org/apache/camel/model/RouteType
>>>>        at
>>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:420)
>>>>        at
>>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
>>>>        at
>>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
>>>>        at
>>>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
>>>>        at
>>>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
>>>>        at
>>>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
>>>>        at
>>>> org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:176)
>>>>        at
>>>> org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:142)
>>>>        at
>>>> org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
>>>>        at
>>>> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
>>>>        at
>>>> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:68)
>>>>        at
>>>> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:259)
>>>>        at
>>>> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
>>>>        at
>>>> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:237)
>>>>        at
>>>> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.
>>>> java:215)
>>>>        at
>>>> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.j
>>>> ava:168)
>>>>        at
>>>> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:179)
>>>>        at
>>>> org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:759)
>>>>        at java.lang.Thread.run(Thread.java:619)
>>>> Caused by: java.lang.NoClassDefFoundError:
>>>> org/apache/camel/model/RouteType
>>>>        at
>>>> org.apache.camel.osgi.CamelNamespaceHandler.getJaxbPackages(CamelNamespaceHandler.java:47)
>>>>        at
>>>> org.apache.camel.osgi.CamelNamespaceHandler.createJaxbContext(CamelNamespaceHandler.java:34)
>>>>        at
>>>> org.apache.camel.spring.handler.CamelNamespaceHandler.getJaxbContext(CamelNamespaceHandler.java:150)
>>>>        at
>>>> org.apache.camel.spring.handler.CamelNamespaceHandler.parseUsingJaxb(CamelNamespaceHandler.java:141)
>>>>        at
>>>> org.apache.camel.spring.handler.CamelNamespaceHandler$CamelContextBeanDefinitionParser.doParse(CamelNamespaceHandler.java:196)
>>>>        at
>>>> org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:84)
>>>>        at
>>>> org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:56)
>>>>        at
>>>> org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
>>>>        at
>>>> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1297)
>>>>        at
>>>> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
>>>>        at
>>>> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
>>>>        at
>>>> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
>>>>        at
>>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
>>>>        at
>>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
>>>>
>>>> REMARK : Everything works fine outside of SMX4 (OSGI server)
>>>>
>>>> Surprisingly, this class does not exist in the Camel 2.-SNAPSHOT. So,
>>>> from
>>>> where this error comes from ?
>>>>
>>>> Regards,
>>>>
>>>> Charles
>>>>
>>>> -----
>>>> Charles Moulliard
>>>> SOA Architect
>>>>
>>>> My Blog :  http://cmoulliard.blogspot.com/
>>>> http://cmoulliard.blogspot.com/
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/java.lang.NoClassDefFoundError%3A-org-apache-camel-model-RouteType---camel-2.0-tp22413437p22413437.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> Apache Camel Committer
>>>
>>> Open Source Integration: http://fusesource.com
>>> Blog: http://davsclaus.blogspot.com/
>>>
>>>
>>
>>
>
>
> -----
> Charles Moulliard
> SOA Architect
>
> My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/
> --
> View this message in context: http://www.nabble.com/java.lang.NoClassDefFoundError%3A-org-apache-camel-model-RouteType---camel-2.0-tp22413437p22430795.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/

Re: java.lang.NoClassDefFoundError: org/apache/camel/model/RouteType - camel 2.0

Posted by cmoulliard <cm...@gmail.com>.
Claus,

Have you also updated the code to build the routes when we use spring
javaconfig :

@ContextConfiguration(locations =
"com.xpectis.camel.bindy.csv.FileCsvUnmarshalTest$ContextConfig", loader =
JavaConfigContextLoader.class)
public class FileCsvUnmarshalTest extends AbstractJUnit4SpringContextTests {

    @EndpointInject(uri = "mock:result")
    private MockEndpoint resultEndpoint;

    @Test
    public void testUnMarshallMessage() throws Exception {
        resultEndpoint.expectedMessageCount(1);
        resultEndpoint.assertIsSatisfied();
    }

    @Configuration
    public static class ContextConfig extends SingleRouteCamelConfiguration
{
       
        BindyCsvDataFormat camelDataFormat = new
BindyCsvDataFormat("com.xpectis.camel.bindy.model");

        @Override
        @Bean
        public RouteBuilder route() {
            return new RouteBuilder() {
                @Override
                public void configure() {
                   
from("file://src/data?noop=true").unmarshal(camelDataFormat).to("mock:result");
                }
            };
        }
    }

}

because I have the same error in this case.

Caused by: java.lang.NoSuchMethodError:
com.xpectis.camel.bindy.csv.FileCsvUnmarshalTest$ContextConfig$1.from(Ljava/lang/String;)Lorg/apache/camel/model/RouteType;
	at
com.xpectis.camel.bindy.csv.FileCsvUnmarshalTest$ContextConfig$1.configure(FileCsvUnmarshalTest.java:53)
	at
org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:240)
	at
org.apache.camel.builder.RouteBuilder.getRouteList(RouteBuilder.java:214)
	at
org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:437)
	at
org.apache.camel.spring.javaconfig.CamelConfiguration.camelContext(CamelConfiguration.java:58)
	at
com.xpectis.camel.bindy.csv.FileCsvUnmarshalTest$ContextConfig$$EnhancerByCGLIB$$608ff13b.CGLIB$camelContext$3(<generated>)
	at
com.xpectis.camel.bindy.csv.FileCsvUnmarshalTest$ContextConfig$$EnhancerByCGLIB$$608ff13b$$FastClassByCGLIB$$ea63cc09.invoke(<generated>)
	at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
	at
org.springframework.config.java.annotation.BeanMethodInterceptor.intercept(BeanMethodInterceptor.java:65)
	at
com.xpectis.camel.bindy.csv.FileCsvUnmarshalTest$ContextConfig$$EnhancerByCGLIB$$608ff13b.camelContext(<generated>)
	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:597)
	at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:115)


cmoulliard wrote:
> 
> I will recheck but I have done a build of camel-core, camel-spring,
> camel-osgi and camel-bindy yesterday afternoon.
> 
> 
> Claus Ibsen-2 wrote:
>> 
>> The classes have been renamed lately in Camel. xxxType is now named
>> xxxDefinition.
>> 
>> So you need to update all camel jars in your container. Also camel-spring
>> 
>> 
>> On Mon, Mar 9, 2009 at 4:01 PM, cmoulliard <cm...@gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> When I deploy the following routes on SMX4,
>>>
>>> <?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:camel="http://camel.apache.org/schema/spring"
>>>        xmlns:cxf="http://camel.apache.org/schema/cxf"
>>>        xsi:schemaLocation=" http://www.springframework.org/schema/beans
>>>              
>>>  http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>>>                http://camel.apache.org/schema/osgi
>>>                http://camel.apache.org/schema/osgi/camel-osgi.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="bindyDataformat"
>>> class="org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat">
>>>                <constructor-arg type="java.lang.String"
>>>                      
>>>  value="org.apache.camel.example.reportincident.model" />
>>>        </bean>
>>>
>>>        <bean id="csv"
>>> class="org.apache.camel.example.reportincident.beans.Csv" />
>>>        <bean id="webService"
>>> class="org.apache.camel.example.reportincident.beans.WebService" />
>>>
>>>        <!--
>>>                <bean id="reportIncidentEndpoint"
>>>              
>>>  class="org.apache.camel.example.reportincident.ReportIncidentEndpoint"/>
>>>        -->
>>>
>>>        <bean id="OK"
>>>              
>>>  class="org.apache.camel.example.reportincident.OutputReportIncident">
>>>                <property name="code" value="0" />
>>>        </bean>
>>>
>>>        <bean id="activemq"
>>> class="org.apache.activemq.camel.component.ActiveMQComponent">
>>>                <property name="brokerURL" value="vm://localhost:61616"
>>> />
>>>        </bean>
>>>
>>>
>>>        <!-- webservice endpoint  -->
>>>        <cxf:cxfEndpoint id="reportIncident"
>>>                address="http://localhost:8080/camel-example/incident"
>>> wsdlURL="wsdl/report_incident.wsdl"
>>>
>>> serviceClass="org.apache.camel.example.reportincident.ReportIncidentEndpoint"
>>>                xmlns:s="http://reportincident.example.camel.apache.org">
>>>        </cxf:cxfEndpoint>
>>>
>>>        <camelContext trace="true"
>>> xmlns="http://camel.apache.org/schema/osgi">
>>>
>>>
>>> <camel:package>org.apache.camel.example.reportincident.routing</camel:package>
>>>
>>>                <!-- File route  -->
>>>                <camel:route>
>>>                        <camel:from    
>>> uri="file://d:/temp/data/?move=d:/temp/done/${file:name}" />
>>>                        <camel:unmarshal ref="bindyDataformat" />
>>>                        <camel:to uri="bean:csv" />
>>>                        <camel:to uri="activemq:queue:in" />
>>>                </camel:route>
>>>
>>>                <camel:route>
>>>                        <camel:from uri="activemq:queue:in" />
>>>                        <camel:to uri="file://d:/temp/data/queue/" />
>>>                </camel:route>
>>>
>>>        </camelContext>
>>> </beans>
>>>
>>>
>>> then Camel generates the following error :
>>>
>>> 15:56:53,890 | ERROR | xtenderThread-10 |
>>> WaiterApplicationContextExecutor |
>>> WaiterApplicationContextExecutor  398 | Unable to create application
>>> context
>>> for [reportincid
>>> ent.interfaces], unsatisfied dependencies: none
>>> org.springframework.beans.factory.BeanDefinitionStoreException:
>>> Unexpected
>>> exception parsing XML document from URL
>>> [bundle://54.0:0/META-INF/spring/camel-context.xml]; ne
>>> sted exception is java.lang.NoClassDefFoundError:
>>> org/apache/camel/model/RouteType
>>>        at
>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:420)
>>>        at
>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
>>>        at
>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
>>>        at
>>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
>>>        at
>>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
>>>        at
>>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
>>>        at
>>> org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:176)
>>>        at
>>> org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:142)
>>>        at
>>> org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
>>>        at
>>> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
>>>        at
>>> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:68)
>>>        at
>>> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:259)
>>>        at
>>> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
>>>        at
>>> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:237)
>>>        at
>>> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.
>>> java:215)
>>>        at
>>> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.j
>>> ava:168)
>>>        at
>>> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:179)
>>>        at
>>> org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:759)
>>>        at java.lang.Thread.run(Thread.java:619)
>>> Caused by: java.lang.NoClassDefFoundError:
>>> org/apache/camel/model/RouteType
>>>        at
>>> org.apache.camel.osgi.CamelNamespaceHandler.getJaxbPackages(CamelNamespaceHandler.java:47)
>>>        at
>>> org.apache.camel.osgi.CamelNamespaceHandler.createJaxbContext(CamelNamespaceHandler.java:34)
>>>        at
>>> org.apache.camel.spring.handler.CamelNamespaceHandler.getJaxbContext(CamelNamespaceHandler.java:150)
>>>        at
>>> org.apache.camel.spring.handler.CamelNamespaceHandler.parseUsingJaxb(CamelNamespaceHandler.java:141)
>>>        at
>>> org.apache.camel.spring.handler.CamelNamespaceHandler$CamelContextBeanDefinitionParser.doParse(CamelNamespaceHandler.java:196)
>>>        at
>>> org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:84)
>>>        at
>>> org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:56)
>>>        at
>>> org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
>>>        at
>>> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1297)
>>>        at
>>> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
>>>        at
>>> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
>>>        at
>>> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
>>>        at
>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
>>>        at
>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
>>>
>>> REMARK : Everything works fine outside of SMX4 (OSGI server)
>>>
>>> Surprisingly, this class does not exist in the Camel 2.-SNAPSHOT. So,
>>> from
>>> where this error comes from ?
>>>
>>> Regards,
>>>
>>> Charles
>>>
>>> -----
>>> Charles Moulliard
>>> SOA Architect
>>>
>>> My Blog :  http://cmoulliard.blogspot.com/
>>> http://cmoulliard.blogspot.com/
>>> --
>>> View this message in context:
>>> http://www.nabble.com/java.lang.NoClassDefFoundError%3A-org-apache-camel-model-RouteType---camel-2.0-tp22413437p22413437.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
>> 
>> -- 
>> Claus Ibsen
>> Apache Camel Committer
>> 
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> 
>> 
> 
> 


-----
Charles Moulliard
SOA Architect

My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: http://www.nabble.com/java.lang.NoClassDefFoundError%3A-org-apache-camel-model-RouteType---camel-2.0-tp22413437p22430795.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: java.lang.NoClassDefFoundError: org/apache/camel/model/RouteType - camel 2.0

Posted by cmoulliard <cm...@gmail.com>.
I will recheck but I have done a build of camel-core, camel-spring,
camel-osgi and camel-bindy yesterday afternoon.


Claus Ibsen-2 wrote:
> 
> The classes have been renamed lately in Camel. xxxType is now named
> xxxDefinition.
> 
> So you need to update all camel jars in your container. Also camel-spring
> 
> 
> On Mon, Mar 9, 2009 at 4:01 PM, cmoulliard <cm...@gmail.com> wrote:
>>
>> Hi,
>>
>> When I deploy the following routes on SMX4,
>>
>> <?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:camel="http://camel.apache.org/schema/spring"
>>        xmlns:cxf="http://camel.apache.org/schema/cxf"
>>        xsi:schemaLocation=" http://www.springframework.org/schema/beans
>>              
>>  http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>>                http://camel.apache.org/schema/osgi
>>                http://camel.apache.org/schema/osgi/camel-osgi.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="bindyDataformat"
>> class="org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat">
>>                <constructor-arg type="java.lang.String"
>>                      
>>  value="org.apache.camel.example.reportincident.model" />
>>        </bean>
>>
>>        <bean id="csv"
>> class="org.apache.camel.example.reportincident.beans.Csv" />
>>        <bean id="webService"
>> class="org.apache.camel.example.reportincident.beans.WebService" />
>>
>>        <!--
>>                <bean id="reportIncidentEndpoint"
>>              
>>  class="org.apache.camel.example.reportincident.ReportIncidentEndpoint"/>
>>        -->
>>
>>        <bean id="OK"
>>              
>>  class="org.apache.camel.example.reportincident.OutputReportIncident">
>>                <property name="code" value="0" />
>>        </bean>
>>
>>        <bean id="activemq"
>> class="org.apache.activemq.camel.component.ActiveMQComponent">
>>                <property name="brokerURL" value="vm://localhost:61616" />
>>        </bean>
>>
>>
>>        <!-- webservice endpoint  -->
>>        <cxf:cxfEndpoint id="reportIncident"
>>                address="http://localhost:8080/camel-example/incident"
>> wsdlURL="wsdl/report_incident.wsdl"
>>
>> serviceClass="org.apache.camel.example.reportincident.ReportIncidentEndpoint"
>>                xmlns:s="http://reportincident.example.camel.apache.org">
>>        </cxf:cxfEndpoint>
>>
>>        <camelContext trace="true"
>> xmlns="http://camel.apache.org/schema/osgi">
>>
>>
>> <camel:package>org.apache.camel.example.reportincident.routing</camel:package>
>>
>>                <!-- File route  -->
>>                <camel:route>
>>                        <camel:from    
>> uri="file://d:/temp/data/?move=d:/temp/done/${file:name}" />
>>                        <camel:unmarshal ref="bindyDataformat" />
>>                        <camel:to uri="bean:csv" />
>>                        <camel:to uri="activemq:queue:in" />
>>                </camel:route>
>>
>>                <camel:route>
>>                        <camel:from uri="activemq:queue:in" />
>>                        <camel:to uri="file://d:/temp/data/queue/" />
>>                </camel:route>
>>
>>        </camelContext>
>> </beans>
>>
>>
>> then Camel generates the following error :
>>
>> 15:56:53,890 | ERROR | xtenderThread-10 |
>> WaiterApplicationContextExecutor |
>> WaiterApplicationContextExecutor  398 | Unable to create application
>> context
>> for [reportincid
>> ent.interfaces], unsatisfied dependencies: none
>> org.springframework.beans.factory.BeanDefinitionStoreException:
>> Unexpected
>> exception parsing XML document from URL
>> [bundle://54.0:0/META-INF/spring/camel-context.xml]; ne
>> sted exception is java.lang.NoClassDefFoundError:
>> org/apache/camel/model/RouteType
>>        at
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:420)
>>        at
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
>>        at
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
>>        at
>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
>>        at
>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
>>        at
>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
>>        at
>> org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:176)
>>        at
>> org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:142)
>>        at
>> org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
>>        at
>> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
>>        at
>> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:68)
>>        at
>> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:259)
>>        at
>> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
>>        at
>> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:237)
>>        at
>> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.
>> java:215)
>>        at
>> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.j
>> ava:168)
>>        at
>> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:179)
>>        at
>> org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:759)
>>        at java.lang.Thread.run(Thread.java:619)
>> Caused by: java.lang.NoClassDefFoundError:
>> org/apache/camel/model/RouteType
>>        at
>> org.apache.camel.osgi.CamelNamespaceHandler.getJaxbPackages(CamelNamespaceHandler.java:47)
>>        at
>> org.apache.camel.osgi.CamelNamespaceHandler.createJaxbContext(CamelNamespaceHandler.java:34)
>>        at
>> org.apache.camel.spring.handler.CamelNamespaceHandler.getJaxbContext(CamelNamespaceHandler.java:150)
>>        at
>> org.apache.camel.spring.handler.CamelNamespaceHandler.parseUsingJaxb(CamelNamespaceHandler.java:141)
>>        at
>> org.apache.camel.spring.handler.CamelNamespaceHandler$CamelContextBeanDefinitionParser.doParse(CamelNamespaceHandler.java:196)
>>        at
>> org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:84)
>>        at
>> org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:56)
>>        at
>> org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
>>        at
>> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1297)
>>        at
>> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
>>        at
>> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
>>        at
>> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
>>        at
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
>>        at
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
>>
>> REMARK : Everything works fine outside of SMX4 (OSGI server)
>>
>> Surprisingly, this class does not exist in the Camel 2.-SNAPSHOT. So,
>> from
>> where this error comes from ?
>>
>> Regards,
>>
>> Charles
>>
>> -----
>> Charles Moulliard
>> SOA Architect
>>
>> My Blog :  http://cmoulliard.blogspot.com/
>> http://cmoulliard.blogspot.com/
>> --
>> View this message in context:
>> http://www.nabble.com/java.lang.NoClassDefFoundError%3A-org-apache-camel-model-RouteType---camel-2.0-tp22413437p22413437.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> 
> 


-----
Charles Moulliard
SOA Architect

My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: http://www.nabble.com/java.lang.NoClassDefFoundError%3A-org-apache-camel-model-RouteType---camel-2.0-tp22413437p22430235.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: java.lang.NoClassDefFoundError: org/apache/camel/model/RouteType - camel 2.0

Posted by Claus Ibsen <cl...@gmail.com>.
The classes have been renamed lately in Camel. xxxType is now named
xxxDefinition.

So you need to update all camel jars in your container. Also camel-spring


On Mon, Mar 9, 2009 at 4:01 PM, cmoulliard <cm...@gmail.com> wrote:
>
> Hi,
>
> When I deploy the following routes on SMX4,
>
> <?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:camel="http://camel.apache.org/schema/spring"
>        xmlns:cxf="http://camel.apache.org/schema/cxf"
>        xsi:schemaLocation=" http://www.springframework.org/schema/beans
>                http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>                http://camel.apache.org/schema/osgi
>                http://camel.apache.org/schema/osgi/camel-osgi.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="bindyDataformat"
> class="org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat">
>                <constructor-arg type="java.lang.String"
>                        value="org.apache.camel.example.reportincident.model" />
>        </bean>
>
>        <bean id="csv" class="org.apache.camel.example.reportincident.beans.Csv" />
>        <bean id="webService"
> class="org.apache.camel.example.reportincident.beans.WebService" />
>
>        <!--
>                <bean id="reportIncidentEndpoint"
>                class="org.apache.camel.example.reportincident.ReportIncidentEndpoint"/>
>        -->
>
>        <bean id="OK"
>                class="org.apache.camel.example.reportincident.OutputReportIncident">
>                <property name="code" value="0" />
>        </bean>
>
>        <bean id="activemq"
> class="org.apache.activemq.camel.component.ActiveMQComponent">
>                <property name="brokerURL" value="vm://localhost:61616" />
>        </bean>
>
>
>        <!-- webservice endpoint  -->
>        <cxf:cxfEndpoint id="reportIncident"
>                address="http://localhost:8080/camel-example/incident"
> wsdlURL="wsdl/report_incident.wsdl"
>
> serviceClass="org.apache.camel.example.reportincident.ReportIncidentEndpoint"
>                xmlns:s="http://reportincident.example.camel.apache.org">
>        </cxf:cxfEndpoint>
>
>        <camelContext trace="true" xmlns="http://camel.apache.org/schema/osgi">
>
>
> <camel:package>org.apache.camel.example.reportincident.routing</camel:package>
>
>                <!-- File route  -->
>                <camel:route>
>                        <camel:from     uri="file://d:/temp/data/?move=d:/temp/done/${file:name}" />
>                        <camel:unmarshal ref="bindyDataformat" />
>                        <camel:to uri="bean:csv" />
>                        <camel:to uri="activemq:queue:in" />
>                </camel:route>
>
>                <camel:route>
>                        <camel:from uri="activemq:queue:in" />
>                        <camel:to uri="file://d:/temp/data/queue/" />
>                </camel:route>
>
>        </camelContext>
> </beans>
>
>
> then Camel generates the following error :
>
> 15:56:53,890 | ERROR | xtenderThread-10 | WaiterApplicationContextExecutor |
> WaiterApplicationContextExecutor  398 | Unable to create application context
> for [reportincid
> ent.interfaces], unsatisfied dependencies: none
> org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected
> exception parsing XML document from URL
> [bundle://54.0:0/META-INF/spring/camel-context.xml]; ne
> sted exception is java.lang.NoClassDefFoundError:
> org/apache/camel/model/RouteType
>        at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:420)
>        at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
>        at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
>        at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
>        at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
>        at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
>        at
> org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:176)
>        at
> org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:142)
>        at
> org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
>        at
> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
>        at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:68)
>        at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:259)
>        at
> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
>        at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:237)
>        at
> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.
> java:215)
>        at
> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.j
> ava:168)
>        at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:179)
>        at
> org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:759)
>        at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.NoClassDefFoundError: org/apache/camel/model/RouteType
>        at
> org.apache.camel.osgi.CamelNamespaceHandler.getJaxbPackages(CamelNamespaceHandler.java:47)
>        at
> org.apache.camel.osgi.CamelNamespaceHandler.createJaxbContext(CamelNamespaceHandler.java:34)
>        at
> org.apache.camel.spring.handler.CamelNamespaceHandler.getJaxbContext(CamelNamespaceHandler.java:150)
>        at
> org.apache.camel.spring.handler.CamelNamespaceHandler.parseUsingJaxb(CamelNamespaceHandler.java:141)
>        at
> org.apache.camel.spring.handler.CamelNamespaceHandler$CamelContextBeanDefinitionParser.doParse(CamelNamespaceHandler.java:196)
>        at
> org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:84)
>        at
> org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:56)
>        at
> org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
>        at
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1297)
>        at
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
>        at
> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
>        at
> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
>        at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
>        at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
>
> REMARK : Everything works fine outside of SMX4 (OSGI server)
>
> Surprisingly, this class does not exist in the Camel 2.-SNAPSHOT. So, from
> where this error comes from ?
>
> Regards,
>
> Charles
>
> -----
> Charles Moulliard
> SOA Architect
>
> My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/
> --
> View this message in context: http://www.nabble.com/java.lang.NoClassDefFoundError%3A-org-apache-camel-model-RouteType---camel-2.0-tp22413437p22413437.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/