History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QUARTZ-513
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: James House
Reporter: A. Bonhomme
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Quartz Scheduler

EOFException being throw in StdJDBCDelegate.getObjectFromBlob for jobs with no jobdata

Created: 18/Sep/06 11:43 PM   Updated: 21/Oct/07 02:38 PM
Component/s: Job Stores
Affects Version/s: 1.6
Fix Version/s: 1.6.1

Environment:
Win2000 Server Svc Pack 4
jdk1.5.0_05
MySQL 5.0.22
MySQL Connector Java 3.1.13
Quartz 1.6 Alpha
Issue Links:
Related
This issue relates to:
QUARTZ-566 MSSQLDelegate.getObjectFromBlob throw... Critical Closed
This issue is related to:
QUARTZ-560 Trigger with empty JobDataMap can't b... Major Closed


 Description  « Hide
This has all been documented in urls listed below:
   QUARTZ-421
   http://forums.opensymphony.com/thread.jspa?messageID=87626&#87626

But to sum it up without forcing you to read those other urls.....

When a Job with no JobData is serialized to the db, it is serialized as an empty byte array (ie. new byte[0]). This seems to work without error, but when deserializing that Job a JobPersistenceException (wrapping a EOFException ) is thrown. A little investigation shows that StdJDBCDelegate.getObjectFromBlob takes the InputStream it receives from the database and calls .readObject against it via an ObjectInputStream. For empty byte arrays this results in the EOFException.

I could see this this being a problem for situations other than Jobs with empty JobData, but I'll leave that as an exercise for the committers ;-)

Thanks!

 All   Comments   Change History      Sort Order:
Henri Yandell - [03/May/07 01:59 PM ]
As QUARTZ-421 is resolved I think we can resolved this one too.

Frederic Lavigne - [01/Jun/07 09:58 AM ]
The fix in StdJDBCDelegate which checks ((ByteArrayInputStream) binaryInput).available() == 0 ) does not seem enough. I've been using Derby as the database and they do not use ByteArrayInputStream but their own org.apache.derby.iapi.services.io.NewByteArrayInputStream which unfortunately does not inherit from ByteArrayInputStream thus the problem still arise :( I worked around it by removing the check for ByteArrayInputStream and just checking if binaryInput.available() == 0 but I'm not really sure this is the right way to go...

Henri Yandell - [06/Sep/07 11:56 AM ]
Much the same issue: QUARTZ-560

In that I was able to reproduce things, but found that for Derby the StdJDBCDelegate was working fine. Which version of Derby were you on Frederic?

James House - [21/Oct/07 02:38 PM ]

I've spent a fair amount of time this weekend testing the fixes to the delegates (CloudscapeDelegate, MSSQLDelegate, PointbaseDelegate, StdJDBCDelegate).

All seems to work fine now, so far as I can tell, though there's sometimes variations once people try things with different releases of those DBs. Hopefully the empty stream, byte array checks have done the trick across the board.


Closing QUARTZ-560, QUARTZ-566, and QUARTZ-513 (all related to this issue).

Also, marked the CloudscapeDelegate deprecated.