You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Jeremy Quinn <je...@media.demon.co.uk> on 2004/11/08 13:18:25 UTC
Problems with Quartz JobStore
Hi All
Has anyone got any experience using a persistable JobStore with Quartz ?
I am trying to use Postgresql to persist Quartz jobs across restarts of
Cocoon.
I have the following setup :
1) Using the script in docs/dbTables/tables_postgres.sql that comes
with Quartz 1.4.2 distribution, create a database called 'quartz',
grant privileges on the tables, confirm that I can connect with user:
'cocoon', using an external client (PostMan Query.app).
2) Add the postgres driver to :
BRANCH_2_1_X/build/webapp/WEB-INF/lib/postgresql.jar
3) Add the config to load the driver to web.xml:
<init-param>
<param-name>load-class</param-name>
<param-value>org.postgresql.Driver</param-value>
</init-param>
4) Add the datasource to cocoon.xconf :
<datasources>
<jdbc logger="core.datasources.quartz" name="quartz">
<pool-controller max="10" min="5"/>
<dburl>jdbc:postgresql://localhost/quartz</dburl>
<user>cocoon</user>
<password>*************</password>
</jdbc>
. . .
</datasources>
5) Adjust the Quartz setup in cocoon.xconf :
<!--<store type="ram"/>-->
<store type="tx"
delegate="org.quartz.impl.jdbcjobstore.PostreSQLDelegate">
<datasource provider="excalibur">quartz</datasource>
</store>
When I start Cocoon, I get the following exception in cron.log :
ERROR (2004-11-08) 11:50.10:449 [core.manager] (Unknown-URI)
Unknown-thread/ExcaliburComponentManager: Caught an exception trying to
initialize the component handler.
org.apache.avalon.framework.configuration.ConfigurationException: No
datasource available by that name: quartz
at
org.apache.cocoon.components.cron.DataSourceComponentConnectionProvider.
<init>(DataSourceComponentConnectionProvider.java:42)
at
org.apache.cocoon.components.cron.QuartzJobScheduler.createJobStore(Quar
tzJobScheduler.java:738)
at
org.apache.cocoon.components.cron.QuartzJobScheduler.initialize(QuartzJo
bScheduler.java:321)
at
org.apache.avalon.framework.container.ContainerUtil.initialize(Container
Util.java:283)
at
org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstanc
e(DefaultComponentFactory.java:277)
at
org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.initial
ize(ThreadSafeComponentHandler.java:108)
at
org.apache.avalon.excalibur.component.ExcaliburComponentManager.initiali
ze(ExcaliburComponentManager.java:522)
at
org.apache.cocoon.components.CocoonComponentManager.initialize(CocoonCom
ponentManager.java:541)
at
org.apache.avalon.framework.container.ContainerUtil.initialize(Container
Util.java:283)
at org.apache.cocoon.Cocoon.initialize(Cocoon.java:314)
at
org.apache.avalon.framework.container.ContainerUtil.initialize(Container
Util.java:283)
at
org.apache.cocoon.servlet.CocoonServlet.createCocoon(CocoonServlet.java:
1382)
at org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:480)
at
org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:220)
at
org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandl
er.java:445)
at
org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebAp
plicationHandler.java:150)
at
org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationCont
ext.java:458)
at org.mortbay.http.HttpServer.start(HttpServer.java:663)
at org.mortbay.jetty.Server.main(Server.java:429)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at Loader.invokeMain(Unknown Source)
at Loader.run(Unknown Source)
at Loader.main(Unknown Source)
DataSourceComponentConnectionProvider cannot find the specified
datasource.
What have I done wrong?
Thanks for any help
regards Jeremy
--------------------------------------------------------
If email from this address is not signed
IT IS NOT FROM ME
Always check the label, folks !!!!!
--------------------------------------------------------
Re: Problems with Quartz JobStore
Posted by Vadim Gritsenko <va...@reverycodes.com>.
Jeremy Quinn wrote:
> Hi All
>
> Has anyone got any experience using a persistable JobStore with Quartz ?
>
> I am trying to use Postgresql to persist Quartz jobs across restarts of
> Cocoon.
...
> What have I done wrong?
Works for me with j2ee datasource:
<store type="tx">
<datasource>java:comp/env/jdbc/MyJobStoreDS</datasource>
</store>
Declared in webapp's tomcat's context xml file:
<Context docBase="webapp" path="/url">
<Resource auth="Container" name="jdbc/MyJobStoreDS" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/MyJobStoreDS">
... etc ...
</ResourceParams>
</Context>
Have not tried yet Excalibur's datasource.
Vadim
Re: Problems with Quartz JobStore
Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On 8 Nov 2004, at 14:55, Jeremy Quinn wrote:
> Caused by: org.quartz.impl.jdbcjobstore.InvalidConfigurationException:
> Invalid delegate class: org.quartz.impl.jdbcjobstore.PostreSQLDelegate
> at
> org.quartz.impl.jdbcjobstore.JobStoreSupport.setDriverDelegateClass(Job
> StoreSupport.java:427)
> at
> org.apache.cocoon.components.cron.QuartzJobScheduler.createJobStore(Qua
> rtzJobScheduler.java:756)
> ... 24 more
>
This seems to be caused by a re-thrown ClassNotFoundException in
org.quartz.impl.jdbcjobstore.JobStoreSupport.setDriverDelegateClass
I had org.quartz.impl.jdbcjobstore.PostgreSQLDelegate mis-spelt
(!!!!!!!)
Copied from the original "tables_postgres.sql" file, with the handy
(but wrong) message :
# In your Quartz properties file, you'll need to set
# org.quartz.jobStore.driverDelegateClass =
org.quartz.impl.jdbcjobstore.PostreSQLDelegate
Now for some more testing !!
Thanks guys
regards Jeremy
--------------------------------------------------------
If email from this address is not signed
IT IS NOT FROM ME
Always check the label, folks !!!!!
--------------------------------------------------------
Re: Problems with Quartz JobStore
Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On 8 Nov 2004, at 13:55, Unico Hommes wrote:
> What if, instead of using the short names <datasources> and <jdbc>,
> you declare the datasource like so:
>
> <component
> role="org.apache.avalon.excalibur.datasource.DataSourceComponent/
> quartz"
>
> class="org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataS
> ource">
> <pool-controller max="10" min="5"/>
> <dburl>jdbc:postgresql://localhost/quartz</dburl>
> <user>cocoon</user>
> <password>*************</password>
> </component>
>
> I was under the impression that ECM would transparently map the short
> name form and the above form to the same lookup semantics.
> (serviceManager.lookup(DataSourceComponent.ROLE + "/quartz")) Perhaps
> I was wrong and it is only Fortress that does that.
OK, that moved the problem on a bit, it seems to find the datasource
when setup like this, but the next exception I get is this:
Invalid delegate class: org.quartz.impl.jdbcjobstore.PostreSQLDelegate
ERROR (2004-11-08) 14:34.33:068 [access] (Unknown-URI)
Unknown-thread/CocoonServlet: Exception reloading
org.apache.avalon.framework.configuration.ConfigurationException: Could
not instantiate DriverDelegate class
org.quartz.impl.jdbcjobstore.PostreSQLDelegate
at
org.apache.cocoon.components.cron.QuartzJobScheduler.createJobStore(Quar
tzJobScheduler.java:759)
at
org.apache.cocoon.components.cron.QuartzJobScheduler.initialize(QuartzJo
bScheduler.java:321)
at
org.apache.avalon.framework.container.ContainerUtil.initialize(Container
Util.java:283)
at
org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstanc
e(DefaultComponentFactory.java:277)
at
org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.initial
ize(ThreadSafeComponentHandler.java:108)
at
org.apache.avalon.excalibur.component.ExcaliburComponentManager.initiali
ze(ExcaliburComponentManager.java:522)
at
org.apache.cocoon.components.CocoonComponentManager.initialize(CocoonCom
ponentManager.java:541)
at
org.apache.avalon.framework.container.ContainerUtil.initialize(Container
Util.java:283)
at org.apache.cocoon.Cocoon.initialize(Cocoon.java:314)
at
org.apache.avalon.framework.container.ContainerUtil.initialize(Container
Util.java:283)
at
org.apache.cocoon.servlet.CocoonServlet.createCocoon(CocoonServlet.java:
1382)
at org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:480)
at
org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:220)
at
org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandl
er.java:445)
at
org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebAp
plicationHandler.java:150)
at
org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationCont
ext.java:458)
at org.mortbay.http.HttpServer.start(HttpServer.java:663)
at org.mortbay.jetty.Server.main(Server.java:429)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at Loader.invokeMain(Unknown Source)
at Loader.run(Unknown Source)
at Loader.main(Unknown Source)
Caused by: org.quartz.impl.jdbcjobstore.InvalidConfigurationException:
Invalid delegate class: org.quartz.impl.jdbcjobstore.PostreSQLDelegate
at
org.quartz.impl.jdbcjobstore.JobStoreSupport.setDriverDelegateClass(JobS
toreSupport.java:427)
at
org.apache.cocoon.components.cron.QuartzJobScheduler.createJobStore(Quar
tzJobScheduler.java:756)
... 24 more
So, I tried resetting the Delegate to :
org.quartz.impl.jdbcjobstore.StdJDBCDelegate instead of
org.quartz.impl.jdbcjobstore.PostreSQLDelegate, which allows Quartz to
startup without errors.
However, when I make CronJobs, I get database errors like:
ERROR (2004-11-08) 14:48.12:630 [cron]
PoolThread-3/QuartzJobScheduler: cannot create QuartzJobSchedulerEntry
org.quartz.JobPersistenceException: Couldn't retrieve job: Bad Integer
\254\355\000\005sr\000\025org.quartz.JobDataMap\237\260\203\350\277\251\
260\313\002\000\001Z\000\023allowsTransientDataxr\000\035org.quartz.util
s.DirtyFlagMap\023\346.\255(v\012\316\002\000\002Z\000\005dirtyL\000\003
mapt\000\017Ljava/util/Map;
xp\001sr\000\021java.util.HashMap\005\007\332\301\303\026`\321\003\000\0
02F\000\012loadFactorI\000\011thresholdxp?
@\000\000\000\000\000\014w\010\000\000\000\020\000\000\000\004t\000\035Q
uartzJobScheduler.Parameterssr\0001org.apache.avalon.framework.parameter
s.Parameters\253.+\343\333Q\026\375\002\000\002Z\000\012m_readOnlyL\000\
014m_parametersq\000~\000\002xp\000sq\000~\000\004?
@\000\000\000\000\000\014w\010\000\000\000\020\000\000\000\001t\000\010p
ipelinet\000#gov-cms/publisher/archive/baz/
b.xmlxt\000\032QuartzJobScheduler.JobNamet\000\016end[baz/
b.xml]t\000"QuartzJobScheduler.RunConcurrentlysr\000\021java.lang.Boolea
n\315
r\200\325\234\372\356\002\000\001Z\000\005valuexp\001t\000\027QuartzJobS
cheduler.ROLEt\0002org.apache.cocoon.components.cron.CronJob/
pipelinex\000 [See nested exception: org.postgresql.util.PSQLException:
Bad Integer
etc.
regards Jeremy
> Jeremy Quinn wrote:
>
>> Hi All
>>
>> Has anyone got any experience using a persistable JobStore with
>> Quartz ?
>>
>> I am trying to use Postgresql to persist Quartz jobs across restarts
>> of Cocoon.
>>
>> I have the following setup :
>>
>> 1) Using the script in docs/dbTables/tables_postgres.sql that comes
>> with Quartz 1.4.2 distribution, create a database called 'quartz',
>> grant privileges on the tables, confirm that I can connect with user:
>> 'cocoon', using an external client (PostMan Query.app).
>>
>> 2) Add the postgres driver to :
>> BRANCH_2_1_X/build/webapp/WEB-INF/lib/postgresql.jar
>>
>> 3) Add the config to load the driver to web.xml:
>>
>> <init-param>
>> <param-name>load-class</param-name>
>> <param-value>org.postgresql.Driver</param-value>
>> </init-param>
>>
>> 4) Add the datasource to cocoon.xconf :
>>
>> <datasources>
>> <jdbc logger="core.datasources.quartz" name="quartz">
>> <pool-controller max="10" min="5"/>
>> <dburl>jdbc:postgresql://localhost/quartz</dburl>
>> <user>cocoon</user>
>> <password>*************</password>
>> </jdbc>
>> . . .
>> </datasources>
>>
>> 5) Adjust the Quartz setup in cocoon.xconf :
>>
>> <!--<store type="ram"/>-->
>>
>> <store type="tx"
>> delegate="org.quartz.impl.jdbcjobstore.PostreSQLDelegate">
>> <datasource provider="excalibur">quartz</datasource>
>> </store>
>>
>>
>> When I start Cocoon, I get the following exception in cron.log :
>>
>> ERROR (2004-11-08) 11:50.10:449 [core.manager] (Unknown-URI)
>> Unknown-thread/ExcaliburComponentManager: Caught an exception trying
>> to initialize the component handler.
>> org.apache.avalon.framework.configuration.ConfigurationException: No
>> datasource available by that name: quartz
>> at
>> org.apache.cocoon.components.cron.DataSourceComponentConnectionProvide
>> r. <init>(DataSourceComponentConnectionProvider.java:42)
>> at
>> org.apache.cocoon.components.cron.QuartzJobScheduler.createJobStore(Qu
>> ar tzJobScheduler.java:738)
>> at
>> org.apache.cocoon.components.cron.QuartzJobScheduler.initialize(Quartz
>> Jo bScheduler.java:321)
>> at
>> org.apache.avalon.framework.container.ContainerUtil.initialize(Contain
>> er Util.java:283)
>> at
>> org.apache.avalon.excalibur.component.DefaultComponentFactory.newInsta
>> nc e(DefaultComponentFactory.java:277)
>> at
>> org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.initi
>> al ize(ThreadSafeComponentHandler.java:108)
>> at
>> org.apache.avalon.excalibur.component.ExcaliburComponentManager.initia
>> li ze(ExcaliburComponentManager.java:522)
>> at
>> org.apache.cocoon.components.CocoonComponentManager.initialize(CocoonC
>> om ponentManager.java:541)
>> at
>> org.apache.avalon.framework.container.ContainerUtil.initialize(Contain
>> er Util.java:283)
>> at org.apache.cocoon.Cocoon.initialize(Cocoon.java:314)
>> at
>> org.apache.avalon.framework.container.ContainerUtil.initialize(Contain
>> er Util.java:283)
>> at
>> org.apache.cocoon.servlet.CocoonServlet.createCocoon(CocoonServlet.jav
>> a: 1382)
>> at
>> org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:480)
>> at
>> org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:220)
>> at
>> org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHan
>> dl er.java:445)
>> at
>> org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(Web
>> Ap plicationHandler.java:150)
>> at
>> org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationCo
>> nt ext.java:458)
>> at org.mortbay.http.HttpServer.start(HttpServer.java:663)
>> at org.mortbay.jetty.Server.main(Server.java:429)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
>> av a:39)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
>> or Impl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:324)
>> at Loader.invokeMain(Unknown Source)
>> at Loader.run(Unknown Source)
>> at Loader.main(Unknown Source)
>>
>> DataSourceComponentConnectionProvider cannot find the specified
>> datasource.
>>
>> What have I done wrong?
>>
>> Thanks for any help
>>
>> regards Jeremy
>>
>>
>> --------------------------------------------------------
>>
>> If email from this address is not signed
>> IT IS NOT FROM ME
>>
>> Always check the label, folks !!!!!
>> --------------------------------------------------------
>>
>
>
--------------------------------------------------------
If email from this address is not signed
IT IS NOT FROM ME
Always check the label, folks !!!!!
--------------------------------------------------------
Re: Problems with Quartz JobStore
Posted by Jeremy Quinn <je...@luminas.co.uk>.
On 8 Nov 2004, at 13:55, Unico Hommes wrote:
> What if, instead of using the short names <datasources> and <jdbc>,
> you declare the datasource like so:
>
> <component
> role="org.apache.avalon.excalibur.datasource.DataSourceComponent/
> quartz"
>
> class="org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataS
> ource">
> <pool-controller max="10" min="5"/>
> <dburl>jdbc:postgresql://localhost/quartz</dburl>
> <user>cocoon</user>
> <password>*************</password>
> </component>
>
> I was under the impression that ECM would transparently map the short
> name form and the above form to the same lookup semantics.
> (serviceManager.lookup(DataSourceComponent.ROLE + "/quartz")) Perhaps
> I was wrong and it is only Fortress that does that.
Thanks for the suggestion Unico, I will try this.
regards Jeremy
> Jeremy Quinn wrote:
>
>> Hi All
>>
>> Has anyone got any experience using a persistable JobStore with
>> Quartz ?
>>
>> I am trying to use Postgresql to persist Quartz jobs across restarts
>> of Cocoon.
>>
>> I have the following setup :
>>
>> 1) Using the script in docs/dbTables/tables_postgres.sql that comes
>> with Quartz 1.4.2 distribution, create a database called 'quartz',
>> grant privileges on the tables, confirm that I can connect with user:
>> 'cocoon', using an external client (PostMan Query.app).
>>
>> 2) Add the postgres driver to :
>> BRANCH_2_1_X/build/webapp/WEB-INF/lib/postgresql.jar
>>
>> 3) Add the config to load the driver to web.xml:
>>
>> <init-param>
>> <param-name>load-class</param-name>
>> <param-value>org.postgresql.Driver</param-value>
>> </init-param>
>>
>> 4) Add the datasource to cocoon.xconf :
>>
>> <datasources>
>> <jdbc logger="core.datasources.quartz" name="quartz">
>> <pool-controller max="10" min="5"/>
>> <dburl>jdbc:postgresql://localhost/quartz</dburl>
>> <user>cocoon</user>
>> <password>*************</password>
>> </jdbc>
>> . . .
>> </datasources>
>>
>> 5) Adjust the Quartz setup in cocoon.xconf :
>>
>> <!--<store type="ram"/>-->
>>
>> <store type="tx"
>> delegate="org.quartz.impl.jdbcjobstore.PostreSQLDelegate">
>> <datasource provider="excalibur">quartz</datasource>
>> </store>
>>
>>
>> When I start Cocoon, I get the following exception in cron.log :
>>
>> ERROR (2004-11-08) 11:50.10:449 [core.manager] (Unknown-URI)
>> Unknown-thread/ExcaliburComponentManager: Caught an exception trying
>> to initialize the component handler.
>> org.apache.avalon.framework.configuration.ConfigurationException: No
>> datasource available by that name: quartz
>> at
>> org.apache.cocoon.components.cron.DataSourceComponentConnectionProvide
>> r. <init>(DataSourceComponentConnectionProvider.java:42)
>> at
>> org.apache.cocoon.components.cron.QuartzJobScheduler.createJobStore(Qu
>> ar tzJobScheduler.java:738)
>> at
>> org.apache.cocoon.components.cron.QuartzJobScheduler.initialize(Quartz
>> Jo bScheduler.java:321)
>> at
>> org.apache.avalon.framework.container.ContainerUtil.initialize(Contain
>> er Util.java:283)
>> at
>> org.apache.avalon.excalibur.component.DefaultComponentFactory.newInsta
>> nc e(DefaultComponentFactory.java:277)
>> at
>> org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.initi
>> al ize(ThreadSafeComponentHandler.java:108)
>> at
>> org.apache.avalon.excalibur.component.ExcaliburComponentManager.initia
>> li ze(ExcaliburComponentManager.java:522)
>> at
>> org.apache.cocoon.components.CocoonComponentManager.initialize(CocoonC
>> om ponentManager.java:541)
>> at
>> org.apache.avalon.framework.container.ContainerUtil.initialize(Contain
>> er Util.java:283)
>> at org.apache.cocoon.Cocoon.initialize(Cocoon.java:314)
>> at
>> org.apache.avalon.framework.container.ContainerUtil.initialize(Contain
>> er Util.java:283)
>> at
>> org.apache.cocoon.servlet.CocoonServlet.createCocoon(CocoonServlet.jav
>> a: 1382)
>> at
>> org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:480)
>> at
>> org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:220)
>> at
>> org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHan
>> dl er.java:445)
>> at
>> org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(Web
>> Ap plicationHandler.java:150)
>> at
>> org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationCo
>> nt ext.java:458)
>> at org.mortbay.http.HttpServer.start(HttpServer.java:663)
>> at org.mortbay.jetty.Server.main(Server.java:429)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
>> av a:39)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
>> or Impl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:324)
>> at Loader.invokeMain(Unknown Source)
>> at Loader.run(Unknown Source)
>> at Loader.main(Unknown Source)
>>
>> DataSourceComponentConnectionProvider cannot find the specified
>> datasource.
>>
>> What have I done wrong?
>>
>> Thanks for any help
>>
>> regards Jeremy
>>
>>
>> --------------------------------------------------------
>>
>> If email from this address is not signed
>> IT IS NOT FROM ME
>>
>> Always check the label, folks !!!!!
>> --------------------------------------------------------
>>
>
>
--------------------------------------------------------
If email from this address is not signed
IT IS NOT FROM ME
Always check the label, folks !!!!!
--------------------------------------------------------
Re: Problems with Quartz JobStore
Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On 8 Nov 2004, at 14:15, Vadim Gritsenko wrote:
> Unico Hommes wrote:
>> What if, instead of using the short names <datasources> and <jdbc>,
>> you declare the datasource like so:
>> <component
>> role="org.apache.avalon.excalibur.datasource.DataSourceComponent/
>> quartz"
>>
>> class="org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcData
>> Source"> <pool-controller max="10" min="5"/>
>> <dburl>jdbc:postgresql://localhost/quartz</dburl>
>> <user>cocoon</user>
>> <password>*************</password>
>> </component>
>> I was under the impression that ECM would transparently map the short
>> name form and the above form to the same lookup semantics.
>> (serviceManager.lookup(DataSourceComponent.ROLE + "/quartz")) Perhaps
>> I was wrong and it is only Fortress that does that.
>
> You have to lookup selector first, and then, "quartz" from selector.
I adjusted DataSourceComponentConnectionProvider to do it this way, but
I still get no datasource found .... all of the database samples that
use 'personnel' still work fine though.
public DataSourceComponentConnectionProvider(String dsName,
ServiceManager manager) throws ConfigurationException {
m_manager = manager;
try {
// used to do it like this :
//m_ds = (DataSourceComponent)
m_manager.lookup(DataSourceComponent.ROLE + "/" + dsName);
dbselector = (ServiceSelector)
m_manager.lookup(DataSourceComponent.ROLE + "Selector");
m_ds = (DataSourceComponent) this.dbselector.select(dsName);
}
catch (ServiceException e) {
//throw new ConfigurationException("No datasource available
by that name: " + dsName);
throw new ConfigurationException(e.getMessage());
}
}
ERROR (2004-11-08) 14:25.32:313 [core.manager] (Unknown-URI)
Unknown-thread/ExcaliburComponentManager: Caught an exception trying to
initialize the component handler.
org.apache.avalon.framework.configuration.ConfigurationException:
datasources: ComponentSelector could not find the component for hint
[quartz] (key [quartz])
(Key='org.apache.avalon.excalibur.datasource.DataSourceComponentSelector
/quartz')
at
org.apache.cocoon.components.cron.DataSourceComponentConnectionProvider.
<init>(DataSourceComponentConnectionProvider.java:50)
at
org.apache.cocoon.components.cron.QuartzJobScheduler.createJobStore(Quar
tzJobScheduler.java:738)
. . . .
So still no idea what I am doing wrong with <datasources/>
regards Jeremy
--------------------------------------------------------
If email from this address is not signed
IT IS NOT FROM ME
Always check the label, folks !!!!!
--------------------------------------------------------
Re: Problems with Quartz JobStore
Posted by Unico Hommes <un...@hippo.nl>.
Vadim Gritsenko wrote:
> Unico Hommes wrote:
>
>> What if, instead of using the short names <datasources> and <jdbc>,
>> you declare the datasource like so:
>>
>> <component
>> role="org.apache.avalon.excalibur.datasource.DataSourceComponent/quartz"
>>
>> class="org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSource">
>>
>> <pool-controller max="10" min="5"/>
>> <dburl>jdbc:postgresql://localhost/quartz</dburl>
>> <user>cocoon</user>
>> <password>*************</password>
>> </component>
>>
>> I was under the impression that ECM would transparently map the short
>> name form and the above form to the same lookup semantics.
>> (serviceManager.lookup(DataSourceComponent.ROLE + "/quartz")) Perhaps
>> I was wrong and it is only Fortress that does that.
>
>
> You have to lookup selector first, and then, "quartz" from selector.
Yeah, I gathered as much from Jeremy's description. I thought ECM would
accept either method. I'll change it.
--
Unico
Re: Problems with Quartz JobStore
Posted by Vadim Gritsenko <va...@reverycodes.com>.
Unico Hommes wrote:
> What if, instead of using the short names <datasources> and <jdbc>, you
> declare the datasource like so:
>
> <component
> role="org.apache.avalon.excalibur.datasource.DataSourceComponent/quartz"
>
> class="org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSource">
>
> <pool-controller max="10" min="5"/>
> <dburl>jdbc:postgresql://localhost/quartz</dburl>
> <user>cocoon</user>
> <password>*************</password>
> </component>
>
> I was under the impression that ECM would transparently map the short
> name form and the above form to the same lookup semantics.
> (serviceManager.lookup(DataSourceComponent.ROLE + "/quartz")) Perhaps I
> was wrong and it is only Fortress that does that.
You have to lookup selector first, and then, "quartz" from selector.
Vadim
Re: Problems with Quartz JobStore
Posted by Unico Hommes <un...@hippo.nl>.
What if, instead of using the short names <datasources> and <jdbc>, you
declare the datasource like so:
<component
role="org.apache.avalon.excalibur.datasource.DataSourceComponent/quartz"
class="org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSource">
<pool-controller max="10" min="5"/>
<dburl>jdbc:postgresql://localhost/quartz</dburl>
<user>cocoon</user>
<password>*************</password>
</component>
I was under the impression that ECM would transparently map the short
name form and the above form to the same lookup semantics.
(serviceManager.lookup(DataSourceComponent.ROLE + "/quartz")) Perhaps I
was wrong and it is only Fortress that does that.
--
Unico
Jeremy Quinn wrote:
> Hi All
>
> Has anyone got any experience using a persistable JobStore with Quartz ?
>
> I am trying to use Postgresql to persist Quartz jobs across restarts
> of Cocoon.
>
> I have the following setup :
>
> 1) Using the script in docs/dbTables/tables_postgres.sql that comes
> with Quartz 1.4.2 distribution, create a database called 'quartz',
> grant privileges on the tables, confirm that I can connect with user:
> 'cocoon', using an external client (PostMan Query.app).
>
> 2) Add the postgres driver to :
> BRANCH_2_1_X/build/webapp/WEB-INF/lib/postgresql.jar
>
> 3) Add the config to load the driver to web.xml:
>
> <init-param>
> <param-name>load-class</param-name>
> <param-value>org.postgresql.Driver</param-value>
> </init-param>
>
> 4) Add the datasource to cocoon.xconf :
>
> <datasources>
> <jdbc logger="core.datasources.quartz" name="quartz">
> <pool-controller max="10" min="5"/>
> <dburl>jdbc:postgresql://localhost/quartz</dburl>
> <user>cocoon</user>
> <password>*************</password>
> </jdbc>
> . . .
> </datasources>
>
> 5) Adjust the Quartz setup in cocoon.xconf :
>
> <!--<store type="ram"/>-->
>
> <store type="tx"
> delegate="org.quartz.impl.jdbcjobstore.PostreSQLDelegate">
> <datasource provider="excalibur">quartz</datasource>
> </store>
>
>
> When I start Cocoon, I get the following exception in cron.log :
>
> ERROR (2004-11-08) 11:50.10:449 [core.manager] (Unknown-URI)
> Unknown-thread/ExcaliburComponentManager: Caught an exception trying
> to initialize the component handler.
> org.apache.avalon.framework.configuration.ConfigurationException: No
> datasource available by that name: quartz
> at
> org.apache.cocoon.components.cron.DataSourceComponentConnectionProvider.
> <init>(DataSourceComponentConnectionProvider.java:42)
> at
> org.apache.cocoon.components.cron.QuartzJobScheduler.createJobStore(Quar
> tzJobScheduler.java:738)
> at
> org.apache.cocoon.components.cron.QuartzJobScheduler.initialize(QuartzJo
> bScheduler.java:321)
> at
> org.apache.avalon.framework.container.ContainerUtil.initialize(Container
> Util.java:283)
> at
> org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstanc
> e(DefaultComponentFactory.java:277)
> at
> org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.initial
> ize(ThreadSafeComponentHandler.java:108)
> at
> org.apache.avalon.excalibur.component.ExcaliburComponentManager.initiali
> ze(ExcaliburComponentManager.java:522)
> at
> org.apache.cocoon.components.CocoonComponentManager.initialize(CocoonCom
> ponentManager.java:541)
> at
> org.apache.avalon.framework.container.ContainerUtil.initialize(Container
> Util.java:283)
> at org.apache.cocoon.Cocoon.initialize(Cocoon.java:314)
> at
> org.apache.avalon.framework.container.ContainerUtil.initialize(Container
> Util.java:283)
> at
> org.apache.cocoon.servlet.CocoonServlet.createCocoon(CocoonServlet.java:
> 1382)
> at
> org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:480)
> at
> org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:220)
> at
> org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandl
> er.java:445)
> at
> org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebAp
> plicationHandler.java:150)
> at
> org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationCont
> ext.java:458)
> at org.mortbay.http.HttpServer.start(HttpServer.java:663)
> at org.mortbay.jetty.Server.main(Server.java:429)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> a:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> Impl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at Loader.invokeMain(Unknown Source)
> at Loader.run(Unknown Source)
> at Loader.main(Unknown Source)
>
> DataSourceComponentConnectionProvider cannot find the specified
> datasource.
>
> What have I done wrong?
>
> Thanks for any help
>
> regards Jeremy
>
>
> --------------------------------------------------------
>
> If email from this address is not signed
> IT IS NOT FROM ME
>
> Always check the label, folks !!!!!
> --------------------------------------------------------
>