You should likely reference the service in your xml file Then from Quartz point of view its just a regular bean id you refer to, and not all the osgi filter syntax which it does not understand.
See the spring-dm docs about service registry references And possible at Karaf / ServiceMix docs as they are OSGi based. On Sat, Aug 31, 2013 at 5:20 PM, lakshmi.prashant <[email protected]> wrote: > Hi, > > I am trying to set up quartz in clustered mode to work with camel quartz in > my camel route. > > (i.e) we have deployed the bundle with the camel route having camel quartz > endpoint, in all the cluster nodes. But I would like to have my camel route > triggered only in one of the nodes in the cluster at the scheduled time & I > am hoping that if the camel quartz refers to quartz in clustered mode, then > the trigger will reach the camel route in only one node. > > The datasources are available as OSGI services in the cluster. But I need to > configure the data source by its name (JNDI name) in the quartz properties > of the QuartzComponent & I am getting a missing datsasource exception. Pls. > find attached the spring xml with the camel route beans.xml > <http://camel.465427.n5.nabble.com/file/n5738400/beans.xml> > > Any suggestions to make this work are welcome. Kindly help. > > Thanks, > Lakshmi > > > Code snippet used for clustering: > <bean id="quartz" class="org.apache.camel.component.quartz.QuartzComponent"> > <property name="properties"> > <props> > <prop > key="dataSource">osgi:service/javax.sql.DataSource/(dataSourceName=default)</prop> > <prop key="org.quartz.jobStore.dataSource"> > osgi:service/javax.sql.DataSource/(dataSourceName=default)</</prop> > … > </props> > </property> > </bean> > > > > Exception trace: org.quartz.JobPersistenceException: Failed to obtain DB > connection from data source 'default': java.sql.SQLException: There is no > DataSource named > 'osgi:service/javax.sql.DataSource/(dataSourceName=default)'[See nested > exception: java.sql.SQLException: There is no DataSource named 'default'] > at > org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:715) > at > org.quartz.impl.jdbcjobstore.JobStoreTX.getNonManagedTXConnection(JobStoreTX.java:69) > at > org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3785) > at > org.quartz.impl.jdbcjobstore.JobStoreTX.executeInLock(JobStoreTX.java:90) > at > org.quartz.impl.jdbcjobstore.JobStoreSupport.executeWithoutLock(JobStoreSupport.java:3693) > at > org.quartz.impl.jdbcjobstore.JobStoreSupport.retrieveTrigger(JobStoreSupport.java:1561) > at > org.quartz.core.QuartzScheduler.getTrigger(QuartzScheduler.java:1448) > at org.quartz.impl.StdScheduler.getTrigger(StdScheduler.java:551) > Caused by: java.sql.SQLException: There is no DataSource named > 'osgi:service/javax.sql.DataSource/(dataSourceName=default)' > at > org.quartz.utils.DBConnectionManager.getConnection(DBConnectionManager.java:105) > at > org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:712) > > > org.quartz.JobPersistenceException: Failed to obtain DB connection from data > source 'jdbc/DefaultDB': java.sql.SQLException: There is no DataSource named > 'jdbc/DefaultDB' [See nested exception: java.sql.SQLException: There is no > DataSource named 'jdbc/DefaultDB'] > > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Missing-datasource-exception-while-referring-to-OSGI-datasource-for-clustering-quartz-with-camel-quaz-tp5738400.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
