You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ankelee <an...@gmail.com> on 2010/03/08 15:10:52 UTC

Quartz confusion

I'm trying to get a Quartz timer up and running. I included
camel-quartz-2-2-0.jar and the two .jars  
camel-core.jar and the commons-collections.jar as stated on this page:

http://camel.apache.org/maven/camel-quartz/dependencies.html

from("quartz://report?cron=0+0+6+*+*+?")
.to("file://data");

and I get:

Exception in thread "main" java.lang.NoClassDefFoundError:
org/quartz/SchedulerFactory
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
	at java.lang.Class.getConstructor0(Unknown Source)
	at java.lang.Class.newInstance0(Unknown Source)
	at java.lang.Class.newInstance(Unknown Source)

What am I doing wrong?
-- 
View this message in context: http://old.nabble.com/Quartz-confusion-tp27819970p27819970.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Quartz confusion

Posted by ankelee <an...@gmail.com>.
Yeah it is working, I was fiddling around with some wrong uris.

Thanks.


Claus Ibsen-2 wrote:
> 
> On Tue, Mar 16, 2010 at 1:08 PM, ankelee <an...@gmail.com> wrote:
>>
>> Hi Claus
>>
>> Did you fix this issue or?
>>
>> I'm working with the 2.3.0 snapshot and I have the same issue:
>>
>> from("quartz://report?cron=0/10+*+*+*+*+?")
>> .pollEnrich("file://data/in?move=data/in/backup").etc...
>>
>> This ought to be working now right?
>> The route completes in the first run, although ignoring the ?move....
>> Second
>> run just get an empty timer message, even if I true ?noop=true.
>> --
> 
> Are you sure that any files exist on the 2nd run? It should pickup one
> file at a time AFAIR.
> 
> 
> 
>> View this message in context:
>> http://old.nabble.com/Quartz-confusion-tp27819970p27916757.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/Quartz-confusion-tp27819970p27918030.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Quartz confusion

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Mar 16, 2010 at 1:08 PM, ankelee <an...@gmail.com> wrote:
>
> Hi Claus
>
> Did you fix this issue or?
>
> I'm working with the 2.3.0 snapshot and I have the same issue:
>
> from("quartz://report?cron=0/10+*+*+*+*+?")
> .pollEnrich("file://data/in?move=data/in/backup").etc...
>
> This ought to be working now right?
> The route completes in the first run, although ignoring the ?move.... Second
> run just get an empty timer message, even if I true ?noop=true.
> --

Are you sure that any files exist on the 2nd run? It should pickup one
file at a time AFAIR.



> View this message in context: http://old.nabble.com/Quartz-confusion-tp27819970p27916757.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: Quartz confusion

Posted by ankelee <an...@gmail.com>.
Hi Claus

Did you fix this issue or?

I'm working with the 2.3.0 snapshot and I have the same issue:

from("quartz://report?cron=0/10+*+*+*+*+?")
.pollEnrich("file://data/in?move=data/in/backup").etc...

This ought to be working now right?
The route completes in the first run, although ignoring the ?move.... Second
run just get an empty timer message, even if I true ?noop=true.
-- 
View this message in context: http://old.nabble.com/Quartz-confusion-tp27819970p27916757.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Quartz confusion

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Mar 12, 2010 at 12:12 PM, ankelee <an...@gmail.com> wrote:
>
> Hi, alright that's great!
>
> Will that be available for use any time soon? I guess it when you close the
> ticket it will be available in the 2.3 SNAPSHOT or?

Yeah its in 2.3-SNAPSHOT which becomes Apache Camel 2.3.0 when that is GA.


> --
> View this message in context: http://old.nabble.com/Quartz-confusion-tp27819970p27874131.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: Quartz confusion

Posted by ankelee <an...@gmail.com>.
Hi, alright that's great!

Will that be available for use any time soon? I guess it when you close the
ticket it will be available in the 2.3 SNAPSHOT or?
-- 
View this message in context: http://old.nabble.com/Quartz-confusion-tp27819970p27874131.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Quartz confusion

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

I created the ticket
https://issues.apache.org/activemq/browse/CAMEL-2538

And I am working on an improvement right now.


On Wed, Mar 10, 2010 at 6:20 AM, Claus Ibsen <cl...@gmail.com> wrote:
> On Tue, Mar 9, 2010 at 9:36 PM, Hadrian Zbarcea <hz...@gmail.com> wrote:
>> Yes, that is the camel jira, also linked from the "Contributing" page [1] (issue tracker) on the official site.
>>
>> To be able to create an issue you need to have an account and log in. To get an account you need to file an icla (individual Contributor License Agreement) with apache. You can find more details here [2]. Once you do that we can grant you the necessary karma. Contributions are highly appreciated.
>>
>
> Oh you only need to sign an ICLA if you want to be able to edit the
> Camel documentation (wiki).
> And later if you are to be an Apache Committer.
>
> If you just want to create a ticket in JIRA then you just create an
> account in JIRA and then there is a "Create new Issue" button on the
> top of the page.
> So I suggest you do this as then you can create other tickets in the
> future and also comment existing tickets and whatnot.
> And you can use the JIRA voting as well to vote for tickets you would
> like to get fixed faster.
>
>
>> Hadrian
>>
>>
>> [1] http://camel.apache.org/contributing.html
>> [2] http://camel.apache.org/how-do-i-edit-the-website.html
>>
>>
>>
>> On Mar 9, 2010, at 3:17 PM, ankelee wrote:
>>
>>>
>>> This is where I'm supposed to post no?
>>> http://issues.apache.org/activemq/browse/CAMEL
>>>
>>> Can't find anywhere to create a new issue.
>>> --
>>> View this message in context: http://old.nabble.com/Quartz-confusion-tp27819970p27841341.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
>



-- 
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: Quartz confusion

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Mar 9, 2010 at 9:36 PM, Hadrian Zbarcea <hz...@gmail.com> wrote:
> Yes, that is the camel jira, also linked from the "Contributing" page [1] (issue tracker) on the official site.
>
> To be able to create an issue you need to have an account and log in. To get an account you need to file an icla (individual Contributor License Agreement) with apache. You can find more details here [2]. Once you do that we can grant you the necessary karma. Contributions are highly appreciated.
>

Oh you only need to sign an ICLA if you want to be able to edit the
Camel documentation (wiki).
And later if you are to be an Apache Committer.

If you just want to create a ticket in JIRA then you just create an
account in JIRA and then there is a "Create new Issue" button on the
top of the page.
So I suggest you do this as then you can create other tickets in the
future and also comment existing tickets and whatnot.
And you can use the JIRA voting as well to vote for tickets you would
like to get fixed faster.


> Hadrian
>
>
> [1] http://camel.apache.org/contributing.html
> [2] http://camel.apache.org/how-do-i-edit-the-website.html
>
>
>
> On Mar 9, 2010, at 3:17 PM, ankelee wrote:
>
>>
>> This is where I'm supposed to post no?
>> http://issues.apache.org/activemq/browse/CAMEL
>>
>> Can't find anywhere to create a new issue.
>> --
>> View this message in context: http://old.nabble.com/Quartz-confusion-tp27819970p27841341.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: Quartz confusion

Posted by Hadrian Zbarcea <hz...@gmail.com>.
Yes, that is the camel jira, also linked from the "Contributing" page [1] (issue tracker) on the official site.

To be able to create an issue you need to have an account and log in. To get an account you need to file an icla (individual Contributor License Agreement) with apache. You can find more details here [2]. Once you do that we can grant you the necessary karma. Contributions are highly appreciated.

Hadrian


[1] http://camel.apache.org/contributing.html
[2] http://camel.apache.org/how-do-i-edit-the-website.html



On Mar 9, 2010, at 3:17 PM, ankelee wrote:

> 
> This is where I'm supposed to post no? 
> http://issues.apache.org/activemq/browse/CAMEL
> 
> Can't find anywhere to create a new issue.
> -- 
> View this message in context: http://old.nabble.com/Quartz-confusion-tp27819970p27841341.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
> 


Re: Quartz confusion

Posted by ankelee <an...@gmail.com>.
This is where I'm supposed to post no? 
http://issues.apache.org/activemq/browse/CAMEL

Can't find anywhere to create a new issue.
-- 
View this message in context: http://old.nabble.com/Quartz-confusion-tp27819970p27841341.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Quartz confusion

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Mar 9, 2010 at 5:24 PM, ankelee <an...@gmail.com> wrote:
>
> Sure, where do I find JIRA?
>
http://camel.apache.org/support.html


> Do you have any ideas to how I could work around this then. Should I use my
> own aggregationstrategy that pulls out the filename and moves it as it is
> read. The backup part could be solved this way, but I'm very worried what to
> do on errors.
> --

Yeah use your own agg strategy and just return the new exchange.
In reality you need to handover the completions but since the original
message is just a timer then there is no point.
But the real fix in Camel must deal with that.



> View this message in context: http://old.nabble.com/Quartz-confusion-tp27819970p27838061.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: Quartz confusion

Posted by ankelee <an...@gmail.com>.
Sure, where do I find JIRA?

Do you have any ideas to how I could work around this then. Should I use my
own aggregationstrategy that pulls out the filename and moves it as it is
read. The backup part could be solved this way, but I'm very worried what to
do on errors.
-- 
View this message in context: http://old.nabble.com/Quartz-confusion-tp27819970p27838061.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Quartz confusion

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Mar 9, 2010 at 4:53 PM, ankelee <an...@gmail.com> wrote:
>
> Ok, so pollEnrich can be used for this. But the filelanguage doesnt seem to
> work fully when using this?
> I want the files to be consumed, ie moved to a backup directory on success
> and an error directory on exception. Shouldnt this work?
>
> from("quartz://report?cron=0/10+*+*+*+*+?")
> .pollEnrich("file://data/in?move=data/backup&moveFailed=data/error")
> .to(etc.)
>
> The files do not get moved after the route has completed.
>

No this is currently not supported from pollEnrich.
Could you add a ticket in JIRA then I remember to take a look as I
think its doable to support.




> --
> View this message in context: http://old.nabble.com/Quartz-confusion-tp27819970p27837602.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: Quartz confusion

Posted by ankelee <an...@gmail.com>.
Ok, so pollEnrich can be used for this. But the filelanguage doesnt seem to
work fully when using this?
I want the files to be consumed, ie moved to a backup directory on success
and an error directory on exception. Shouldnt this work?

from("quartz://report?cron=0/10+*+*+*+*+?")
.pollEnrich("file://data/in?move=data/backup&moveFailed=data/error")
.to(etc.)

The files do not get moved after the route has completed.

-- 
View this message in context: http://old.nabble.com/Quartz-confusion-tp27819970p27837602.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Quartz confusion

Posted by ankelee <an...@gmail.com>.
Yes that works. Now I have another problem:

from("quartz://test?cron=0/10+*+*+*+*+?")
.to("file://incoming?move=backup&moveFailed=error")
.process(). etc.

I know the above doesn't work but it illustrates what I want.

If I understand the timer stuff correctly I need to swap the content of the
quartz trigger message with the payload that I wish to send into the route.
I can only see me doing this completely manually ie. loading the file
manually and deleting it manually, but then I'm going to miss the nice
backup/moveFailed feature of the file language. Any tips?

I read this thread:
http://old.nabble.com/quartz-trigger-for-ftp-consumer-td27595602.html#a27595602
but I don't really understand how the stuff in the last reply would be
implemented.
-- 
View this message in context: http://old.nabble.com/Quartz-confusion-tp27819970p27836977.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Quartz confusion

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

You also need quartz.jar itself. If you are using Maven all that is
taken care of.

Basically you need whats listed as compile here

[INFO] The following files have been resolved:
[INFO]    aopalliance:aopalliance:jar:1.0:test
[INFO]    com.sun.xml.bind:jaxb-impl:jar:2.1.12:compile
[INFO]    commons-collections:commons-collections:jar:3.2.1:compile
[INFO]    commons-logging:commons-logging:jar:1.1.1:test
[INFO]    commons-logging:commons-logging-api:jar:1.1:compile
[INFO]    javax.activation:activation:jar:1.1:compile
[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]    opensymphony:quartz:jar:1.6.6:compile
[INFO]    org.apache.camel:camel-core:jar:2.3-SNAPSHOT:compile
[INFO]    org.apache.camel:camel-spring:jar:2.3-SNAPSHOT:test
[INFO]    org.apache.camel:camel-test:jar:2.3-SNAPSHOT:test
[INFO]    org.fusesource.commonman:commons-management:jar:1.0:compile
[INFO]    org.springframework:spring-aop:jar:2.5.6:test
[INFO]    org.springframework:spring-beans:jar:2.5.6:test
[INFO]    org.springframework:spring-context:jar:2.5.6:test
[INFO]    org.springframework:spring-core:jar:2.5.6:test
[INFO]    org.springframework:spring-tx:jar:2.5.6:test
[INFO]


On Mon, Mar 8, 2010 at 3:10 PM, ankelee <an...@gmail.com> wrote:
>
> I'm trying to get a Quartz timer up and running. I included
> camel-quartz-2-2-0.jar and the two .jars
> camel-core.jar and the commons-collections.jar as stated on this page:
>
> http://camel.apache.org/maven/camel-quartz/dependencies.html
>
> from("quartz://report?cron=0+0+6+*+*+?")
> .to("file://data");
>
> and I get:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/quartz/SchedulerFactory
>        at java.lang.Class.getDeclaredConstructors0(Native Method)
>        at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
>        at java.lang.Class.getConstructor0(Unknown Source)
>        at java.lang.Class.newInstance0(Unknown Source)
>        at java.lang.Class.newInstance(Unknown Source)
>
> What am I doing wrong?
> --
> View this message in context: http://old.nabble.com/Quartz-confusion-tp27819970p27819970.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