[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Urgent help needed - Spring + Quartz + Websphere + Sybase  XML
Forum Index -> Quartz
Author Message
kelkarp

journeyman

Joined: 02/15/2011 11:14:08
Messages: 23
Offline

I am using Quartz scheduler in following environment:

Quartz - 1.8
Spring - 3.x
IBM Websphere - 6.1.x
Sybase - 12.x

My quartz.properties file is as follows:

# Default Properties file for use by StdSchedulerFactory
# to create a Quartz Scheduler Instance, if a different
# properties file is not explicitly specified.
#

#org.quartz.scheduler.instanceName = DefaultQuartzScheduler
#org.quartz.scheduler.rmi.export = false
#org.quartz.scheduler.rmi.proxy = false
#org.quartz.scheduler.wrapJobExecutionInUserTransaction = false

#============================================================================
# Configure Main Scheduler Properties
#============================================================================

org.quartz.scheduler.instanceName = QuartzClusteredScheduler
org.quartz.scheduler.instanceId = AUTO
#org.quartz.scheduler.jobFactory.class = org.quartz.simpl.SimpleJobFactory
org.quartz.scheduler.jobFactory.class = org.springframework.scheduling.quartz.SpringBeanJobFactory

#============================================================================
# Configure ThreadPool
#============================================================================

#org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 10
org.quartz.threadPool.threadPriority = 5

#============================================================================
# Configure JobStore
#============================================================================

org.quartz.jobStore.misfireThreshold = 60000
#----------for current testing
#org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
#-----------------
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
#---- using MSSQLDelegate for sybase instead of org.quartz.impl.jdbcjobstore.StdJDBCDelegate
#---- (read :quartz [path_to_distribution]/docs/dbTables/tables_sybase.sql)
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.MSSQLDelegate
org.quartz.jobStore.useProperties = true
org.quartz.jobStore.dataSource = MYDS
org.quartz.jobStore.tablePrefix = GTW_HF_
org.quartz.jobStore.isClustered = true
org.quartz.jobStore.clusterCheckinInterval = 20000

#============================================================================
# Datasource Configuration
#============================================================================
org.quartz.dataSource.MYDS.jndiURL=jdbc/SybaseData

My web.xml is as follows:

<resource-ref>
<res-ref-name>jdbc/SybaseData</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>

My spring configuration is:

<jee:jndi-lookup jndi-name="jdbc/SybaseData" id="dataSource" resource-ref="true"
cache="true" lookup-on-startup="false" proxy-interface="javax.sql.DataSource" />


I have configured JDBC Datasource in Websphere using jtds-1.2.5.jar as

Implementation class name: net.sourceforge.jtds.jdbcx.JtdsDataSource
Data store helper class name: com.ibm.websphere.rsadapter.ConnectJDBCDataStoreHelper


But my problem is the scheduler runs properly for first 5 mins(approx) when server is restarted, but it starts throwing following exception after some time.

But I am getting following exception:

[2/15/11 14:07:49:257 EST] 00000039 FreePool E J2CA0045E: Connection not available while invoking method createOrWaitForConnection for resource jdbc/SybaseData.
[2/15/11 14:07:49:259 EST] 00000039 JobStoreTX E org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager manage ClusterManager: Error managing cluster: Failed to obtain DB connection from data source 'MYDS': java.sql.SQLException: Could not retrieve datasource via JNDI url 'jdbc/SybaseData' com.ibm.websphere.ce.cm.ConnectionWaitTimeoutException: Connection not available, Timed out waiting for 180029
org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'MYDS': java.sql.SQLException: Could not retrieve datasource via JNDI url 'jdbc/SybaseData' com.ibm.websphere.ce.cm.ConnectionWaitTimeoutException: Connection not available, Timed out waiting for 180029 [See nested exception: java.sql.SQLException: Could not retrieve datasource via JNDI url 'jdbc/SybaseData' com.ibm.websphere.ce.cm.ConnectionWaitTimeoutException: Connection not available, Timed out waiting for 180029]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:690)
at org.quartz.impl.jdbcjobstore.JobStoreTX.getNonManagedTXConnection(JobStoreTX.java:69)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.doCheckin(JobStoreSupport.java:3183)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.manage(JobStoreSupport.java:3820)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.run(JobStoreSupport.java:3856)
Caused by: java.sql.SQLException: Could not retrieve datasource via JNDI url 'jdbc/SybaseData' com.ibm.websphere.ce.cm.ConnectionWaitTimeoutException: Connection not available, Timed out waiting for 180029
at org.quartz.utils.JNDIConnectionProvider.getConnection(JNDIConnectionProvider.java:163)
at org.quartz.utils.DBConnectionManager.getConnection(DBConnectionManager.java:109)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:687)
... 4 more
[2/15/11 14:28:50:195 EST] 00000039 FreePool E J2CA0045E: Connection not available while invoking method createOrWaitForConnection for resource jdbc/SybaseData.
[2/15/11 14:28:50:216 EST] 00000038 FreePool E J2CA0045E: Connection not available while invoking method createOrWaitForConnection for resource jdbc/SybaseData.
[2/15/11 14:28:53:575 EST] 0000003a FreePool E J2CA0045E: Connection not available while invoking method createOrWaitForConnection for resource jdbc/SybaseData.
[2/15/11 14:28:53:626 EST] 00000021 FreePool E J2CA0045E: Connection not available while invoking method createOrWaitForConnection for resource jdbc/SybaseData.



Please Help .... I need to fix this urgently .....
Thanks in advance ....
jhouse

seraphim
[Avatar]
Joined: 11/06/2009 15:29:56
Messages: 1703
Offline


The error messages are quite clear that the datasource (connection pool) cannot make connections to the database.

That means it's a problem with the datasource (pool) config, or with the database, or with the network.

Not a quartz-related issue.
kelkarp

journeyman

Joined: 02/15/2011 11:14:08
Messages: 23
Offline

Its basically the age-old problem of running Quartz in Websphere environment issue. As I said, Quartz runs well for first few mins.
But after some time I get the ConnectionWaitTimeout Exception.

I have even added this to my quartz config file:

<bean id="workManagerTaskExecutor" class="org.springframework.scheduling.commonj.WorkManagerTaskExecutor"
lazy-init="true">
<property name="workManagerName" value="wm/default" />
<property name="resourceRef" value="false" />
</bean>


<bean id="schedulerFactory" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="configLocation" value="/WEB-INF/quartz.properties" />
<property name="taskExecutor" ref="workManagerTaskExecutor" />
</bean>


But its still failing.

Any help would be deeply appreciated.
Thanks in advance .
 
Forum Index -> Quartz
Go to:   
Powered by JForum 2.1.7 © JForum Team