You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by kerryland <ke...@fidelma.com> on 2010/04/12 06:02:13 UTC

camel-example-etl and ant won't run

Hi Folks,

I've found a couple of problems with camel-example-etl, at least with "ant".

Once I've downloaded dependencies and set environment variables the build
fails with:

C:\apps\apache-camel-2.2.0\examples\camel-example-etl\src\main\java\org\apache\camel\example\etl\CustomerTransformer.java:26:
package org.springframework.orm.jpa does not exist

This can be fixed by adding the following to the definition of
"sample.build.classpath" in the build.xml file:

    <path refid="spring.classpath"/>

... but then we die with:

Exception in thread "main"
org.springframework.beans.factory.BeanDefinitionStoreException: Could not
resolve bean definition resource pattern [META-INF/spring/*.xml]; nested
exception is java.io.FileNotFoundException: class path resource
[META-INF/spring/

The README.txt for camel-example-etl says:

You can see the routing rules by looking at the java code in the
src/main/java
directory and the Spring XML configuration lives in
src/main/resources/META-INF/spring

... but there is no "src/main/resources/META-INF/spring" directory, which
would seem to be exactly the problem I've run into.

Does anybody have the missing files?

Anyway, I hope I've helped to make Apache Camel better :-)

Cheers
Kerry




-- 
View this message in context: http://old.nabble.com/camel-example-etl-and-ant-won%27t-run-tp28213644p28213644.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-example-etl and ant won't run

Posted by thesamim <th...@yahoo.com>.


willem.jiang wrote:
> 
> Please use mvn dependency:list to check the pom.xml dependency, you will 
> find there are some dependency jars of Spring 3.0.0.RELEASE.
> 

Thanks for the pointer and for saving me from wasting a lot of time. 


willem.jiang wrote:
> 
> 
> You need put the camel-spring-javaconfig jar into the class path first.
> I will head to fix this issue on camel trunk today.
> 
> Willem
> 

Thanks again.
-- 
View this message in context: http://old.nabble.com/camel-example-etl-and-ant-won%27t-run-tp28213644p28378445.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-example-etl and ant won't run

Posted by Willem Jiang <wi...@gmail.com>.
thesamim wrote:
> 
> 
> willem.jiang wrote:
>>> camel-example-spring-javaconfig      Fails with:
>>> package org.apache.camel.osgi does not exist
>>> package org.apache.camel.spring.javaconfig does not exist
>>> package org.springframework.osgi.context does not exist
>>>
>> «  [hide part of quote]
>> It only work with Spring 3.x 
>>
> Really? I can ran just fine with Spring 2.5.6 if I run "mvn camel:run" but
> getting:
Please use mvn dependency:list to check the pom.xml dependency, you will 
find there are some dependency jars of Spring 3.0.0.RELEASE.
> 
> C:\opensource\apache-camel-2.2.0\examples\camel-example-spring-javaconfig>ant
> camel.dot
> Buildfile: build.xml
> 
> build.classes:
> 
> build.test:
> 
> build:
> 
> run:
>      [java] java.lang.NoClassDefFoundError:
> org/apache/camel/spring/javaconfig/Main
>      [java] Caused by: java.lang.ClassNotFoundException:
> org.apache.camel.spring.javaconfig.Main
>      [java]     at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
>      [java]     at java.security.AccessController.doPrivileged(Native
> Method)
>      [java]     at
> java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>      [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>      [java]     at
> sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>      [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
>      [java] Could not find the main class:
> org.apache.camel.spring.javaconfig.Main.  Program will exit.
>      [java] Exception in thread "main"
> 
> [Had to do some tweaking on the POM but that's for another post.]
You need put the camel-spring-javaconfig jar into the class path first.
I will head to fix this issue on camel trunk today.

Willem


Re: camel-example-etl and ant won't run

Posted by thesamim <th...@yahoo.com>.


willem.jiang wrote:
> 
>> camel-example-spring-javaconfig      Fails with:
>> package org.apache.camel.osgi does not exist
>> package org.apache.camel.spring.javaconfig does not exist
>> package org.springframework.osgi.context does not exist
>>
> «  [hide part of quote]
> It only work with Spring 3.x 
> 
Really? I can ran just fine with Spring 2.5.6 if I run "mvn camel:run" but
getting:

C:\opensource\apache-camel-2.2.0\examples\camel-example-spring-javaconfig>ant
camel.dot
Buildfile: build.xml

build.classes:

build.test:

build:

run:
     [java] java.lang.NoClassDefFoundError:
org/apache/camel/spring/javaconfig/Main
     [java] Caused by: java.lang.ClassNotFoundException:
org.apache.camel.spring.javaconfig.Main
     [java]     at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
     [java]     at java.security.AccessController.doPrivileged(Native
Method)
     [java]     at
java.net.URLClassLoader.findClass(URLClassLoader.java:190)
     [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
     [java]     at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
     [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
     [java] Could not find the main class:
org.apache.camel.spring.javaconfig.Main.  Program will exit.
     [java] Exception in thread "main"

[Had to do some tweaking on the POM but that's for another post.]
-- 
View this message in context: http://old.nabble.com/camel-example-etl-and-ant-won%27t-run-tp28213644p28367365.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-example-etl and ant won't run

Posted by Willem Jiang <wi...@gmail.com>.
Hi Kerry,

Thanks for looking this issue, I can give you some suggestions to fix 
these issue, if you are welling to help other ant people like you.

Please see my comments in the mail.

Willem

kerryland wrote:
> Hi Claus,
> 
> I've been through all the examples using "ant", with the following results:
> 
> camel-example-axis                   No ant support at all
Its need a war task
> camel-example-bam                    Missing <path
> refid="spring.classpath"/>
>                                      Missing
> org.apache.commons.dbcp.BasicDataSource 
Can you add the path id and the miss jars?

> camel-example-cafe                   Works! 
> camel-example-cxf                    Works!
> camel-example-cxf-async              No ant support at all
> camel-example-docs                   Works! 
> camel-example-etl                    Missing META-INF/spring/
> camel-example-gae                    No ant support -- and no README
> camel-example-guice-jms              Missing org.osgi.framework
need to add the OSGi jars.
> camel-example-http-async             No ant support
> camel-example-jms-file               Works!
> camel-example-loan-broker            Works!
> camel-example-management             Works!
> 
> camel-example-osgi                   Fails with:
> 	Line 28 in XML document from file
> [C:\apps\apache-camel-2.2.0\examples\camel-example-osgi\target\classes\META-INF\spring\camelContext.xml]
> is invalid; nested exception is org.xml.sax.SAXParseException:
> cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration
> can be found for element 'camelContext'.
> 
> 
> camel-example-pojo-messaging         Fails with:
> 	ClassNotFoundException: org.osgi.framework.BundleException
> 
It needs OSGi API jars.
> camel-example-reportincident         Fails with:
> 	FileNotFoundException:
> C:\apps\apache-camel-2.2.0\examples\camel-example-reportincident\src\main\resources\report_incident.wsdl
> 
> camel-example-route-throttling       No ant support
> 
> camel-example-spring                 Works!
> 
> camel-example-spring-javaconfig      Fails with:
> 	package org.apache.camel.osgi does not exist
> 	package org.apache.camel.spring.javaconfig does not exist
> 	package org.springframework.osgi.context does not exist
> 
It only work with Spring 3.x
> camel-example-spring-jms             Fails with:
>         package org.osgi.framework does not exist (and other errors)
> 
> camel-example-spring-xquery          Works!
> 
> camel-example-tracer                 Fails with:
> 
> 	ClassNotFoundException:
> org.springframework.transaction.support.TransactionTemplate, which can be
> fixed with <path refid="spring.classpath"/>, but then we get:
> 
> 	ClassNotFoundException: org.apache.commons.collections.SequencedHashMap
> 
> 
> Hope this helps.
> 
> Cheers
> Kerry (who will now go and see if Maven has improved in the couple of years
> since he last looked at it, and ran away screaming :-)
> 
> 
> Claus Ibsen-2 wrote:
>> Hi
>>
>> Thanks for sharing this.
>>
>> I bet most Camel committers use Maven and thus the example runs easy
>> with maven as you dont have to download and setup anything.
>> Just run the maven goal.
>>
>> If you have the time and want then feel free to check some of the
>> other examples if they work with ANT.
>> Then we can get those fixed as well.
>>
>>
>>
>> On Mon, Apr 12, 2010 at 6:02 AM, kerryland <ke...@fidelma.com> wrote:
>>> Hi Folks,
>>>
>>> I've found a couple of problems with camel-example-etl, at least with
>>> "ant".
>>>
>>> Once I've downloaded dependencies and set environment variables the build
>>> fails with:
>>>
>>> C:\apps\apache-camel-2.2.0\examples\camel-example-etl\src\main\java\org\apache\camel\example\etl\CustomerTransformer.java:26:
>>> package org.springframework.orm.jpa does not exist
>>>
>>> This can be fixed by adding the following to the definition of
>>> "sample.build.classpath" in the build.xml file:
>>>
>>>    <path refid="spring.classpath"/>
>>>
>>> ... but then we die with:
>>>
>>> Exception in thread "main"
>>> org.springframework.beans.factory.BeanDefinitionStoreException: Could not
>>> resolve bean definition resource pattern [META-INF/spring/*.xml]; nested
>>> exception is java.io.FileNotFoundException: class path resource
>>> [META-INF/spring/
>>>
>>> The README.txt for camel-example-etl says:
>>>
>>> You can see the routing rules by looking at the java code in the
>>> src/main/java
>>> directory and the Spring XML configuration lives in
>>> src/main/resources/META-INF/spring
>>>
>>> ... but there is no "src/main/resources/META-INF/spring" directory, which
>>> would seem to be exactly the problem I've run into.
>>>
>>> Does anybody have the missing files?
>>>
>>> Anyway, I hope I've helped to make Apache Camel better :-)
>>>
>>> Cheers
>>> Kerry
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/camel-example-etl-and-ant-won%27t-run-tp28213644p28213644.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>> -- 
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>>
> 


Re: camel-example-etl and ant won't run

Posted by kerryland <ke...@fidelma.com>.
Hi Claus,

I've been through all the examples using "ant", with the following results:

camel-example-axis                   No ant support at all
camel-example-bam                    Missing <path
refid="spring.classpath"/>
                                     Missing
org.apache.commons.dbcp.BasicDataSource              
camel-example-cafe                   Works! 
camel-example-cxf                    Works!
camel-example-cxf-async              No ant support at all
camel-example-docs                   Works! 
camel-example-etl                    Missing META-INF/spring/
camel-example-gae                    No ant support -- and no README
camel-example-guice-jms              Missing org.osgi.framework 
camel-example-http-async             No ant support
camel-example-jms-file               Works!
camel-example-loan-broker            Works!
camel-example-management             Works!

camel-example-osgi                   Fails with:
	Line 28 in XML document from file
[C:\apps\apache-camel-2.2.0\examples\camel-example-osgi\target\classes\META-INF\spring\camelContext.xml]
is invalid; nested exception is org.xml.sax.SAXParseException:
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration
can be found for element 'camelContext'.


camel-example-pojo-messaging         Fails with:
	ClassNotFoundException: org.osgi.framework.BundleException

camel-example-reportincident         Fails with:
	FileNotFoundException:
C:\apps\apache-camel-2.2.0\examples\camel-example-reportincident\src\main\resources\report_incident.wsdl

camel-example-route-throttling       No ant support

camel-example-spring                 Works!

camel-example-spring-javaconfig      Fails with:
	package org.apache.camel.osgi does not exist
	package org.apache.camel.spring.javaconfig does not exist
	package org.springframework.osgi.context does not exist

camel-example-spring-jms             Fails with:
        package org.osgi.framework does not exist (and other errors)

camel-example-spring-xquery          Works!

camel-example-tracer                 Fails with:

	ClassNotFoundException:
org.springframework.transaction.support.TransactionTemplate, which can be
fixed with <path refid="spring.classpath"/>, but then we get:

	ClassNotFoundException: org.apache.commons.collections.SequencedHashMap


Hope this helps.

Cheers
Kerry (who will now go and see if Maven has improved in the couple of years
since he last looked at it, and ran away screaming :-)


Claus Ibsen-2 wrote:
> 
> Hi
> 
> Thanks for sharing this.
> 
> I bet most Camel committers use Maven and thus the example runs easy
> with maven as you dont have to download and setup anything.
> Just run the maven goal.
> 
> If you have the time and want then feel free to check some of the
> other examples if they work with ANT.
> Then we can get those fixed as well.
> 
> 
> 
> On Mon, Apr 12, 2010 at 6:02 AM, kerryland <ke...@fidelma.com> wrote:
>>
>> Hi Folks,
>>
>> I've found a couple of problems with camel-example-etl, at least with
>> "ant".
>>
>> Once I've downloaded dependencies and set environment variables the build
>> fails with:
>>
>> C:\apps\apache-camel-2.2.0\examples\camel-example-etl\src\main\java\org\apache\camel\example\etl\CustomerTransformer.java:26:
>> package org.springframework.orm.jpa does not exist
>>
>> This can be fixed by adding the following to the definition of
>> "sample.build.classpath" in the build.xml file:
>>
>>    <path refid="spring.classpath"/>
>>
>> ... but then we die with:
>>
>> Exception in thread "main"
>> org.springframework.beans.factory.BeanDefinitionStoreException: Could not
>> resolve bean definition resource pattern [META-INF/spring/*.xml]; nested
>> exception is java.io.FileNotFoundException: class path resource
>> [META-INF/spring/
>>
>> The README.txt for camel-example-etl says:
>>
>> You can see the routing rules by looking at the java code in the
>> src/main/java
>> directory and the Spring XML configuration lives in
>> src/main/resources/META-INF/spring
>>
>> ... but there is no "src/main/resources/META-INF/spring" directory, which
>> would seem to be exactly the problem I've run into.
>>
>> Does anybody have the missing files?
>>
>> Anyway, I hope I've helped to make Apache Camel better :-)
>>
>> Cheers
>> Kerry
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/camel-example-etl-and-ant-won%27t-run-tp28213644p28213644.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: http://old.nabble.com/camel-example-etl-and-ant-won%27t-run-tp28213644p28219189.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-example-etl and ant won't run

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

Thanks for sharing this.

I bet most Camel committers use Maven and thus the example runs easy
with maven as you dont have to download and setup anything.
Just run the maven goal.

If you have the time and want then feel free to check some of the
other examples if they work with ANT.
Then we can get those fixed as well.



On Mon, Apr 12, 2010 at 6:02 AM, kerryland <ke...@fidelma.com> wrote:
>
> Hi Folks,
>
> I've found a couple of problems with camel-example-etl, at least with "ant".
>
> Once I've downloaded dependencies and set environment variables the build
> fails with:
>
> C:\apps\apache-camel-2.2.0\examples\camel-example-etl\src\main\java\org\apache\camel\example\etl\CustomerTransformer.java:26:
> package org.springframework.orm.jpa does not exist
>
> This can be fixed by adding the following to the definition of
> "sample.build.classpath" in the build.xml file:
>
>    <path refid="spring.classpath"/>
>
> ... but then we die with:
>
> Exception in thread "main"
> org.springframework.beans.factory.BeanDefinitionStoreException: Could not
> resolve bean definition resource pattern [META-INF/spring/*.xml]; nested
> exception is java.io.FileNotFoundException: class path resource
> [META-INF/spring/
>
> The README.txt for camel-example-etl says:
>
> You can see the routing rules by looking at the java code in the
> src/main/java
> directory and the Spring XML configuration lives in
> src/main/resources/META-INF/spring
>
> ... but there is no "src/main/resources/META-INF/spring" directory, which
> would seem to be exactly the problem I've run into.
>
> Does anybody have the missing files?
>
> Anyway, I hope I've helped to make Apache Camel better :-)
>
> Cheers
> Kerry
>
>
>
>
> --
> View this message in context: http://old.nabble.com/camel-example-etl-and-ant-won%27t-run-tp28213644p28213644.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus