You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by snowbug <la...@gmail.com> on 2009/08/26 00:49:07 UTC

Missing dependeng classes using spring bean xml to configure camel

Hi

I just started to put Camel into our project and hit this exception which I
couldn't find a solution from googling many hours and I wonder if I didn't
something wrong since others is not complaining. 

I used spring bean configuration files to config camel context, etc. When I
start my application, it throws exception:
java.lang.ClassNotFoundException:
org.apache.xbean.spring.context.v2.XBeanNamespaceHandler

So I grabbed the xbean-spring-2.6.jar file from 
http://geronimo.apache.org/xbean/download.html
http://geronimo.apache.org/xbean/download.html , which then gives me another
exception:
java.lang.ClassNotFoundException:
org.springframework.beans.factory.support.ComponentDefinition

Which I could not find from the Spring distribution (v2.5.6) at all. 

Does anyone know what is the problem?

Here is my spring config file:

<?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:context="http://www.springframework.org/schema/context"
xmlns:camel="http://camel.apache.org/schema/spring"
    xmlns:broker="http://activemq.apache.org/schema/core"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
        http://camel.apache.org/schema/spring classpath:camel-spring.xsd
        http://activemq.apache.org/schema/core classpath:activemq.xsd">

    <!-- declare a camel context that scans for classes that is RouteBuilder
-->
    <camel:camelContext id="camel">
        <camel:packageScan>
            <camel:package>com.mypackage</camel:package>
        </camel:packageScan>
        <!-- enable JMX connector so we can connect to the server and browse
mbeans -->
        <!-- Camel will log at INFO level the service URI to use for
connecting with jconsole -->
        <camel:jmxAgent id="agent" createConnector="true" />
    </camel:camelContext>

    <!-- configure the ActiveMQ JMS broker server -->
    <broker:broker useJmx="false" persistent="false" brokerName="localhost">
        <broker:transportConnectors>
            <broker:transportConnector name="vm" uri="vm://localhost" />
        </broker:transportConnectors>
    </broker:broker>

    <!-- configure the Camel ActiveMQ to use the ActiveMQ broker declared
above -->
    <bean id="jms"
class="org.apache.activemq.camel.component.ActiveMQComponent">
        <property name="brokerURL" value="vm://localhost" />
    </bean>
</beans>
-- 
View this message in context: http://www.nabble.com/Missing-dependeng-classes-using-spring-bean-xml-to-configure-camel-tp25143590p25143590.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Missing dependeng classes using spring bean xml to configure camel

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

The maven reports show this. But they tend to be a bit outdated, eg
from January 2009.
http://camel.apache.org/maven/camel-jms/dependencies.html



On Wed, Aug 26, 2009 at 9:55 AM, snowbug<la...@gmail.com> wrote:
>
> Thank you Claus, I just figured out it's due to the jar dependencies but you
> beat me on posting this :)
>
> In my defense, not all companies are using Maven and mine is one of those.
> It'll definitely help to list the dependencies without assuming everyone
> would be using Maven, after all, it's about have choices :)
>
> As you mentioned, I was having the wrong version of xbean-spring.jar file.
> Man, the Apache xbean page is so outdated that it lists v2.8 as the latest
> (2.6 for xbean-spring) while the latest is already 3.5. And to make things
> worse, their download link for xbean is incorrect leaving me wonder where to
> get those files. I eventually got all the files from
> http://www.mvnrepository.com/artifact/org.apache.xbean
> http://www.mvnrepository.com/artifact/org.apache.xbean .
>
> In addition to the dependencies you've listed, I had to also download
> xmlbean, which seems used by Camel during type conversion when sending
> messages.
>
> Again, thank you for the help.
>
> Alan
>
>
> Claus Ibsen-2 wrote:
>>
>> Hi
>>
>> If you use maven then you wont have all this trouble with .jar hunt.
>>
>> Here is the dependecy:list used for testing camel-jms which uses ActiveMQ.
>>
>> Mind the list is for Camel 2.1-SNAPSHOT but it should give you an idea
>> which jars you may need.
>> Or look in your <AMQ_HOME>/lib folder which jars it have.
>>
>>
>> [INFO] The following files have been resolved:
>> [INFO]    aopalliance:aopalliance:jar:1.0:compile
>> [INFO]    backport-util-concurrent:backport-util-concurrent:jar:2.1:test
>> [INFO]    com.sun.xml.bind:jaxb-impl:jar:2.1.10:compile
>> [INFO]    commons-logging:commons-logging:jar:1.1.1:test
>> [INFO]    commons-logging:commons-logging-api:jar:1.1:compile
>> [INFO]    commons-pool:commons-pool:jar:1.3:compile
>> [INFO]    javax.activation:activation:jar:1.1:compile
>> [INFO]    javax.annotation:jsr250-api:jar:1.0:test
>> [INFO]    javax.xml.bind:jaxb-api:jar:2.1:compile
>> [INFO]    javax.xml.stream:stax-api:jar:1.0-2:compile
>> [INFO]    junit:junit:jar:4.4:test
>> [INFO]    log4j:log4j:jar:1.2.14:test
>> [INFO]    org.apache.activemq:activeio-core:jar:3.1.0:test
>> [INFO]    org.apache.activemq:activemq-camel:jar:5.2.0:test
>> [INFO]    org.apache.activemq:activemq-core:jar:5.2.0:test
>> [INFO]    org.apache.activemq:activemq-pool:jar:5.2.0:test
>> [INFO]    org.apache.camel:camel-core:jar:2.1-SNAPSHOT:compile
>> [INFO]    org.apache.camel:camel-core:test-jar:tests:2.1-SNAPSHOT:test
>> [INFO]    org.apache.camel:camel-spring:jar:2.1-SNAPSHOT:compile
>> [INFO]    org.apache.camel:camel-spring:test-jar:tests:2.1-SNAPSHOT:test
>> [INFO]    org.apache.camel:camel-test:jar:2.1-SNAPSHOT:test
>> [INFO]
>> org.apache.geronimo.specs:geronimo-j2ee-management_1.0_spec:jar:1.1:test
>> [INFO]
>> org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1.1:compile
>> [INFO]
>> org.apache.geronimo.specs:geronimo-jta_1.0.1B_spec:jar:1.0.1:test
>> [INFO]
>> org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile
>> [INFO]    org.apache.xbean:xbean-spring:jar:3.5:test
>> [INFO]    org.fusesource.commonman:commons-management:jar:1.0:compile
>> [INFO]    org.jencks:jencks-amqpool:jar:2.1:test
>> [INFO]    org.springframework:spring-aop:jar:2.5.6:test
>> [INFO]    org.springframework:spring-beans:jar:2.5.6:compile
>> [INFO]    org.springframework:spring-context:jar:2.5.6:compile
>> [INFO]    org.springframework:spring-context-support:jar:2.5.6:compile
>> [INFO]    org.springframework:spring-core:jar:2.5.6:compile
>> [INFO]    org.springframework:spring-jms:jar:2.5.6:compile
>> [INFO]    org.springframework:spring-test:jar:2.5.6:test
>> [INFO]    org.springframework:spring-tx:jar:2.5.6:compile
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Missing-dependeng-classes-using-spring-bean-xml-to-configure-camel-tp25143590p25148256.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/
Twitter: http://twitter.com/davsclaus

Re: Missing dependeng classes using spring bean xml to configure camel

Posted by snowbug <la...@gmail.com>.
Thank you Claus, I just figured out it's due to the jar dependencies but you
beat me on posting this :)

In my defense, not all companies are using Maven and mine is one of those.
It'll definitely help to list the dependencies without assuming everyone
would be using Maven, after all, it's about have choices :)

As you mentioned, I was having the wrong version of xbean-spring.jar file.
Man, the Apache xbean page is so outdated that it lists v2.8 as the latest
(2.6 for xbean-spring) while the latest is already 3.5. And to make things
worse, their download link for xbean is incorrect leaving me wonder where to
get those files. I eventually got all the files from 
http://www.mvnrepository.com/artifact/org.apache.xbean
http://www.mvnrepository.com/artifact/org.apache.xbean .

In addition to the dependencies you've listed, I had to also download
xmlbean, which seems used by Camel during type conversion when sending
messages.

Again, thank you for the help.

Alan


Claus Ibsen-2 wrote:
> 
> Hi
> 
> If you use maven then you wont have all this trouble with .jar hunt.
> 
> Here is the dependecy:list used for testing camel-jms which uses ActiveMQ.
> 
> Mind the list is for Camel 2.1-SNAPSHOT but it should give you an idea
> which jars you may need.
> Or look in your <AMQ_HOME>/lib folder which jars it have.
> 
> 
> [INFO] The following files have been resolved:
> [INFO]    aopalliance:aopalliance:jar:1.0:compile
> [INFO]    backport-util-concurrent:backport-util-concurrent:jar:2.1:test
> [INFO]    com.sun.xml.bind:jaxb-impl:jar:2.1.10:compile
> [INFO]    commons-logging:commons-logging:jar:1.1.1:test
> [INFO]    commons-logging:commons-logging-api:jar:1.1:compile
> [INFO]    commons-pool:commons-pool:jar:1.3:compile
> [INFO]    javax.activation:activation:jar:1.1:compile
> [INFO]    javax.annotation:jsr250-api:jar:1.0:test
> [INFO]    javax.xml.bind:jaxb-api:jar:2.1:compile
> [INFO]    javax.xml.stream:stax-api:jar:1.0-2:compile
> [INFO]    junit:junit:jar:4.4:test
> [INFO]    log4j:log4j:jar:1.2.14:test
> [INFO]    org.apache.activemq:activeio-core:jar:3.1.0:test
> [INFO]    org.apache.activemq:activemq-camel:jar:5.2.0:test
> [INFO]    org.apache.activemq:activemq-core:jar:5.2.0:test
> [INFO]    org.apache.activemq:activemq-pool:jar:5.2.0:test
> [INFO]    org.apache.camel:camel-core:jar:2.1-SNAPSHOT:compile
> [INFO]    org.apache.camel:camel-core:test-jar:tests:2.1-SNAPSHOT:test
> [INFO]    org.apache.camel:camel-spring:jar:2.1-SNAPSHOT:compile
> [INFO]    org.apache.camel:camel-spring:test-jar:tests:2.1-SNAPSHOT:test
> [INFO]    org.apache.camel:camel-test:jar:2.1-SNAPSHOT:test
> [INFO]   
> org.apache.geronimo.specs:geronimo-j2ee-management_1.0_spec:jar:1.1:test
> [INFO]   
> org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1.1:compile
> [INFO]   
> org.apache.geronimo.specs:geronimo-jta_1.0.1B_spec:jar:1.0.1:test
> [INFO]   
> org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile
> [INFO]    org.apache.xbean:xbean-spring:jar:3.5:test
> [INFO]    org.fusesource.commonman:commons-management:jar:1.0:compile
> [INFO]    org.jencks:jencks-amqpool:jar:2.1:test
> [INFO]    org.springframework:spring-aop:jar:2.5.6:test
> [INFO]    org.springframework:spring-beans:jar:2.5.6:compile
> [INFO]    org.springframework:spring-context:jar:2.5.6:compile
> [INFO]    org.springframework:spring-context-support:jar:2.5.6:compile
> [INFO]    org.springframework:spring-core:jar:2.5.6:compile
> [INFO]    org.springframework:spring-jms:jar:2.5.6:compile
> [INFO]    org.springframework:spring-test:jar:2.5.6:test
> [INFO]    org.springframework:spring-tx:jar:2.5.6:compile
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: http://www.nabble.com/Missing-dependeng-classes-using-spring-bean-xml-to-configure-camel-tp25143590p25148256.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Missing dependeng classes using spring bean xml to configure camel

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

If you use maven then you wont have all this trouble with .jar hunt.

Here is the dependecy:list used for testing camel-jms which uses ActiveMQ.

Mind the list is for Camel 2.1-SNAPSHOT but it should give you an idea
which jars you may need.
Or look in your <AMQ_HOME>/lib folder which jars it have.


[INFO] The following files have been resolved:
[INFO]    aopalliance:aopalliance:jar:1.0:compile
[INFO]    backport-util-concurrent:backport-util-concurrent:jar:2.1:test
[INFO]    com.sun.xml.bind:jaxb-impl:jar:2.1.10:compile
[INFO]    commons-logging:commons-logging:jar:1.1.1:test
[INFO]    commons-logging:commons-logging-api:jar:1.1:compile
[INFO]    commons-pool:commons-pool:jar:1.3:compile
[INFO]    javax.activation:activation:jar:1.1:compile
[INFO]    javax.annotation:jsr250-api:jar:1.0:test
[INFO]    javax.xml.bind:jaxb-api:jar:2.1:compile
[INFO]    javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO]    junit:junit:jar:4.4:test
[INFO]    log4j:log4j:jar:1.2.14:test
[INFO]    org.apache.activemq:activeio-core:jar:3.1.0:test
[INFO]    org.apache.activemq:activemq-camel:jar:5.2.0:test
[INFO]    org.apache.activemq:activemq-core:jar:5.2.0:test
[INFO]    org.apache.activemq:activemq-pool:jar:5.2.0:test
[INFO]    org.apache.camel:camel-core:jar:2.1-SNAPSHOT:compile
[INFO]    org.apache.camel:camel-core:test-jar:tests:2.1-SNAPSHOT:test
[INFO]    org.apache.camel:camel-spring:jar:2.1-SNAPSHOT:compile
[INFO]    org.apache.camel:camel-spring:test-jar:tests:2.1-SNAPSHOT:test
[INFO]    org.apache.camel:camel-test:jar:2.1-SNAPSHOT:test
[INFO]    org.apache.geronimo.specs:geronimo-j2ee-management_1.0_spec:jar:1.1:test
[INFO]    org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1.1:compile
[INFO]    org.apache.geronimo.specs:geronimo-jta_1.0.1B_spec:jar:1.0.1:test
[INFO]    org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile
[INFO]    org.apache.xbean:xbean-spring:jar:3.5:test
[INFO]    org.fusesource.commonman:commons-management:jar:1.0:compile
[INFO]    org.jencks:jencks-amqpool:jar:2.1:test
[INFO]    org.springframework:spring-aop:jar:2.5.6:test
[INFO]    org.springframework:spring-beans:jar:2.5.6:compile
[INFO]    org.springframework:spring-context:jar:2.5.6:compile
[INFO]    org.springframework:spring-context-support:jar:2.5.6:compile
[INFO]    org.springframework:spring-core:jar:2.5.6:compile
[INFO]    org.springframework:spring-jms:jar:2.5.6:compile
[INFO]    org.springframework:spring-test:jar:2.5.6:test
[INFO]    org.springframework:spring-tx:jar:2.5.6:compile


On Wed, Aug 26, 2009 at 12:49 AM, snowbug<la...@gmail.com> wrote:
>
> Hi
>
> I just started to put Camel into our project and hit this exception which I
> couldn't find a solution from googling many hours and I wonder if I didn't
> something wrong since others is not complaining.
>
> I used spring bean configuration files to config camel context, etc. When I
> start my application, it throws exception:
> java.lang.ClassNotFoundException:
> org.apache.xbean.spring.context.v2.XBeanNamespaceHandler
>
> So I grabbed the xbean-spring-2.6.jar file from
> http://geronimo.apache.org/xbean/download.html
> http://geronimo.apache.org/xbean/download.html , which then gives me another
> exception:
> java.lang.ClassNotFoundException:
> org.springframework.beans.factory.support.ComponentDefinition
>
> Which I could not find from the Spring distribution (v2.5.6) at all.
>
> Does anyone know what is the problem?
>
> Here is my spring config file:
>
> <?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:context="http://www.springframework.org/schema/context"
> xmlns:camel="http://camel.apache.org/schema/spring"
>    xmlns:broker="http://activemq.apache.org/schema/core"
>    xsi:schemaLocation="
>        http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>        http://www.springframework.org/schema/context
> http://www.springframework.org/schema/context/spring-context-2.5.xsd
>        http://camel.apache.org/schema/spring classpath:camel-spring.xsd
>        http://activemq.apache.org/schema/core classpath:activemq.xsd">
>
>    <!-- declare a camel context that scans for classes that is RouteBuilder
> -->
>    <camel:camelContext id="camel">
>        <camel:packageScan>
>            <camel:package>com.mypackage</camel:package>
>        </camel:packageScan>
>        <!-- enable JMX connector so we can connect to the server and browse
> mbeans -->
>        <!-- Camel will log at INFO level the service URI to use for
> connecting with jconsole -->
>        <camel:jmxAgent id="agent" createConnector="true" />
>    </camel:camelContext>
>
>    <!-- configure the ActiveMQ JMS broker server -->
>    <broker:broker useJmx="false" persistent="false" brokerName="localhost">
>        <broker:transportConnectors>
>            <broker:transportConnector name="vm" uri="vm://localhost" />
>        </broker:transportConnectors>
>    </broker:broker>
>
>    <!-- configure the Camel ActiveMQ to use the ActiveMQ broker declared
> above -->
>    <bean id="jms"
> class="org.apache.activemq.camel.component.ActiveMQComponent">
>        <property name="brokerURL" value="vm://localhost" />
>    </bean>
> </beans>
> --
> View this message in context: http://www.nabble.com/Missing-dependeng-classes-using-spring-bean-xml-to-configure-camel-tp25143590p25143590.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/
Twitter: http://twitter.com/davsclaus