Announcement Announcement Module
Collapse
No announcement yet.
QuartzJobBean JobDataMap and serializable entries Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • QuartzJobBean JobDataMap and serializable entries

    I am registering several QuartJobBeans. The job beans need access to other service beans so I am trying to pass them into the bean by adding entries to jobDataAsMap. I then setup properties and corresponding setter methods on the QuartzJobBean. I expect Spring to inject the service beans into these properties every time the job is fired.

    I have configured Quartz for clustering so all trigger, job, etc information is stored in the database.

    The problem is that I am getting an error that the JobDataMap is not serializable:

    Code:
    Caused by: java.io.NotSerializableException: Unable to serialize JobDataMap for insertion into database because the value of property 'businessSessionManager' is not serializable: fleetcycle.model.framework.persistence.hibernate.TransactionRetryInterceptor
    	at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.serializeJobData(StdJDBCDelegate.java:3358)
    	at org.quartz.impl.jdbcjobstore.oracle.OracleDelegate.insertJobDetail(OracleDelegate.java:173)
    	at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeJob(JobStoreSupport.java:1102)
    	... 106 more
    Now, I'm sure I can get the error to go away by marking the fields that I am injecting as "transient" but I'm not sure if this is safe or not? Why would the JobDataMap need to be stored in the database and is there ever a case where the serialized instance would be deserialized without Spring injecting the dependencies? I don't want to end u p with NPEs if a deserialized instance is ever used.

    Sorry if this is not the correct subforum.
Working...
X