Re: Configuring Quartz under TomEE

2019-12-22 Thread Ihsan Ecemis


No, we did not try using a Custom Resource and it is not clear to me how to 
solve our problem with this.  Could you please provide some more detail?  Thank 
you.


> On Dec 20, 2019, at 08:23, Richard Monson-Haefel  
> wrote:
> 
> You probably tried this but I was going to suggest a Custom Resource.
> http://tomee.apache.org/application-resources.html
> 
> On Thu, Dec 19, 2019 at 10:13 PM Ihsan Ecemis  wrote:
> 
>> 
>> Hello Everyone,
>> 
>> We would like to store Quartz scheduling information within a relational
>> database. We tried different configuration options to use our own
>> properties file instead of TomEE's default, but could not get it to work.
>> 
>> Here are the things we tried:
>> 
>> (1) We defined the system property 'org.quartz.properties', e.g. did
>> "-Dorg.quartz.properties=/tmp/quartz.properties".
>> (2) Since TomEE shades org.quartz, we also tried
>> "-Dorg.apache.openejb.quartz.properties=/tmp/quartz.properties".
>> (3) We also tried configuring this via web.xml file by adding:
>> 
>>  
>>quartz:config-file
>>/tmp/quartz.properties
>>  
>> 
>> 
>> In all these cases, even though we set org.quartz.jobStore.class =
>> org.quartz.impl.jdbcjobstore.JobStoreTX (or
>> org.apache.openejb.quartz.jobStore.class =
>> org.apache.openejb.quartz.impl.jdbcjobstore.JobStoreTX) and adjust all
>> parameters as documented at Quartz User Guide,  TomEE is initializing
>> RAMJobStore instead of JobStoreTX.  Also, there is no indication in the
>> logs that Quartz is opening our properties file.
>> 
>> How can we configure Quartz under TomEE?
>> 
>> Any help would be greatly appreaciated.
>> 
>> Thanks,
>> 
>> Ihsan.
> 
> 
> 
> -- 
> Richard Monson-Haefel
> https://twitter.com/rmonson
> https://www.linkedin.com/in/monsonhaefel/



Re: Configuring Quartz under TomEE

2019-12-22 Thread Ihsan Ecemis

Thanks for the suggestion Jon.  We added org.quartz-scheduler as a dependency 
to our project and configured it in web.xml.  With that, we could get a second 
Scheduler started and use JobStoreTX.

However, our code schedules task using javax.ejb.Schedule annotation, e.g.: 

@Schedule(minute = "*", hour = "*")
public void schedulerTest() {
LOGGER.info("Entered schedulerTest");
}

and this still uses the Scheduler started by TomEE and not the one we want. 

AFAIK,  @Schedule does not have any parameter to specify which Scheduler to 
use.  

How can we make this to use the Scheduler we want? 


> On Dec 20, 2019, at 04:23, Jonathan Gallimore  
> wrote:
> 
> TomEE uses Quartz internally to schedule EJB timers etc - the reason for
> shading it is to avoid it conflicting with Quartz packaged in your
> application. So theoretically, you should be able to package Quartz in your
> application, and use it per its own documentation. If you have a code
> sample with your issue that you can provide us with, we'd be happy to take
> a look.
> 
> Cheers
> 
> Jon
> 
> On Fri, Dec 20, 2019 at 4:13 AM Ihsan Ecemis  wrote:
> 
>> 
>> Hello Everyone,
>> 
>> We would like to store Quartz scheduling information within a relational
>> database. We tried different configuration options to use our own
>> properties file instead of TomEE's default, but could not get it to work.
>> 
>> Here are the things we tried:
>> 
>> (1) We defined the system property 'org.quartz.properties', e.g. did
>> "-Dorg.quartz.properties=/tmp/quartz.properties".
>> (2) Since TomEE shades org.quartz, we also tried
>> "-Dorg.apache.openejb.quartz.properties=/tmp/quartz.properties".
>> (3) We also tried configuring this via web.xml file by adding:
>> 
>>  
>>quartz:config-file
>>/tmp/quartz.properties
>>  
>> 
>> 
>> In all these cases, even though we set org.quartz.jobStore.class =
>> org.quartz.impl.jdbcjobstore.JobStoreTX (or
>> org.apache.openejb.quartz.jobStore.class =
>> org.apache.openejb.quartz.impl.jdbcjobstore.JobStoreTX) and adjust all
>> parameters as documented at Quartz User Guide,  TomEE is initializing
>> RAMJobStore instead of JobStoreTX.  Also, there is no indication in the
>> logs that Quartz is opening our properties file.
>> 
>> How can we configure Quartz under TomEE?
>> 
>> Any help would be greatly appreaciated.
>> 
>> Thanks,
>> 
>> Ihsan.



Re: Configuring Quartz under TomEE

2019-12-20 Thread Richard Monson-Haefel
You probably tried this but I was going to suggest a Custom Resource.
http://tomee.apache.org/application-resources.html

On Thu, Dec 19, 2019 at 10:13 PM Ihsan Ecemis  wrote:

>
> Hello Everyone,
>
> We would like to store Quartz scheduling information within a relational
> database. We tried different configuration options to use our own
> properties file instead of TomEE's default, but could not get it to work.
>
> Here are the things we tried:
>
> (1) We defined the system property 'org.quartz.properties', e.g. did
> "-Dorg.quartz.properties=/tmp/quartz.properties".
> (2) Since TomEE shades org.quartz, we also tried
> "-Dorg.apache.openejb.quartz.properties=/tmp/quartz.properties".
> (3) We also tried configuring this via web.xml file by adding:
>
>   
> quartz:config-file
> /tmp/quartz.properties
>   
>
>
> In all these cases, even though we set org.quartz.jobStore.class =
> org.quartz.impl.jdbcjobstore.JobStoreTX (or
> org.apache.openejb.quartz.jobStore.class =
> org.apache.openejb.quartz.impl.jdbcjobstore.JobStoreTX) and adjust all
> parameters as documented at Quartz User Guide,  TomEE is initializing
> RAMJobStore instead of JobStoreTX.  Also, there is no indication in the
> logs that Quartz is opening our properties file.
>
> How can we configure Quartz under TomEE?
>
> Any help would be greatly appreaciated.
>
> Thanks,
>
> Ihsan.



-- 
Richard Monson-Haefel
https://twitter.com/rmonson
https://www.linkedin.com/in/monsonhaefel/


Re: Configuring Quartz under TomEE

2019-12-20 Thread Jonathan Gallimore
TomEE uses Quartz internally to schedule EJB timers etc - the reason for
shading it is to avoid it conflicting with Quartz packaged in your
application. So theoretically, you should be able to package Quartz in your
application, and use it per its own documentation. If you have a code
sample with your issue that you can provide us with, we'd be happy to take
a look.

Cheers

Jon

On Fri, Dec 20, 2019 at 4:13 AM Ihsan Ecemis  wrote:

>
> Hello Everyone,
>
> We would like to store Quartz scheduling information within a relational
> database. We tried different configuration options to use our own
> properties file instead of TomEE's default, but could not get it to work.
>
> Here are the things we tried:
>
> (1) We defined the system property 'org.quartz.properties', e.g. did
> "-Dorg.quartz.properties=/tmp/quartz.properties".
> (2) Since TomEE shades org.quartz, we also tried
> "-Dorg.apache.openejb.quartz.properties=/tmp/quartz.properties".
> (3) We also tried configuring this via web.xml file by adding:
>
>   
> quartz:config-file
> /tmp/quartz.properties
>   
>
>
> In all these cases, even though we set org.quartz.jobStore.class =
> org.quartz.impl.jdbcjobstore.JobStoreTX (or
> org.apache.openejb.quartz.jobStore.class =
> org.apache.openejb.quartz.impl.jdbcjobstore.JobStoreTX) and adjust all
> parameters as documented at Quartz User Guide,  TomEE is initializing
> RAMJobStore instead of JobStoreTX.  Also, there is no indication in the
> logs that Quartz is opening our properties file.
>
> How can we configure Quartz under TomEE?
>
> Any help would be greatly appreaciated.
>
> Thanks,
>
> Ihsan.