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




Reply via email to