Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 318187

Summary: NegativeArraySizeException Occurs on Occasion when Calling JCEEncryptor.decryptPassword()
Product: z_Archived Reporter: lists
Component: EclipselinkAssignee: Chris Delahunt <christopher.delahunt>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: christopher.delahunt, gordon.yorke, lgalfaso, lists, ucl
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
proposed fix and testcase none

Description lists CLA 2010-06-28 10:47:13 EDT
Build Identifier: 2.0.2

Details can be found in the forum thread:

http://www.eclipse.org/forums/index.php?t=msg&th=170167&start=0&

Basically, it sounds like the fix for Toplink/3927740 did not get pulled into Eclipselink, that being synchronization of JCEEncryptor.decryptPassword(). So when using an external datasource, the method gets called with every DB call and being that decryptPassword() is not threadsafe, it will occasional blow up. Not sure if this affects anything else. Hopefully someone with access to the Toplink bug database can simply re-apply the Toplink fix to the Eclipselink codebase.

Reproducible: Sometimes

Steps to Reproduce:
1. Configure app to use Tomcat JNDI.
2. Set password field-javax.persistence.jdbc.password-to something (note, this won't actually be used for the JNDI datasource, this is just how we had things configured).
3. Apply high load to the system (triggering DB calls).

In theory, you could also just run JCEEncryptor.decryptPassword() repeatedly in a threaded scenario.
Comment 1 Chris Delahunt CLA 2010-07-27 15:54:34 EDT
Investigating
Comment 2 Chris Delahunt CLA 2010-07-29 15:22:25 EDT
Created attachment 175524 [details]
proposed fix and testcase
Comment 3 Chris Delahunt CLA 2010-08-09 14:06:02 EDT
fix checked into main and 2.1.1 on Aug 6th
Comment 4 Chris Delahunt CLA 2010-08-17 11:28:25 EDT
*** Bug 320375 has been marked as a duplicate of this bug. ***
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:08:24 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink