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 !!!!!
--------------------------------------------------------