views:

34

answers:

2

I'm using NetBeans 6.8 and Glassfish Enterprise Server 2.1.1 ((v2.1 Patch06)(9.1_02 Patch12)) (build b31g-fcs).

I created a servlet and used Netbeans code generation features to imlement persistence using TopLink (JPA1).

When I try to create an Entity Manager with the following code:

EntityManagerFactory entityManagerFactory=Persistence.createEntityManagerFactory("xyzPU");
EntityManager entityManager=entityManagerFactory.createEntityManager();

I receive the following terrible exception:

Exception [TOPLINK-7106] (Oracle TopLink Essentials - 2.1 (Build b31g-fcs (10/19/2009))): oracle.toplink.essentials.exceptions.ValidationException
Exception Description: Error encountered during string encryption.
Internal Exception: java.security.ProviderException: update() failed 
oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:240) 
oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:93) 
oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:138) 
oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:132) 
oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:91) 
etc...

Trying to figure out what was going on I put the 2 lines of code above into a new class with a main() method (same package of the one where the code was before but outside of the servlet) and everything worked properly. Thus, there should be no issues with libraries importing, configuration files, etc.. Furthermore, I tried also running the servlet using another version of glassfish (I guess just a lighter version) and it worked fine too.

Can anyone explain me what's going on? Could it be anything related to some settings/configurations of the Glassfish Enterprise Server Edition together with the servlet environment? What should I do?

+1  A: 

Here is something I found about the error TOP-07106 (from here):

TOP-07106: Error encountered during string encryption.

Cause: Error encountered during password string encryption.

Action: An error is raised while trying to encrypt the password string. A common reason for this exception is the usage of JDK 1.3 and earlier versions. The TopLink JCE encryption mechanism requires JDK 1.4 and later (or JDK 1.3 configured with the JCE plug-in) to function properly.

Level: 1

Type: ERROR

Impact: Configuration

Does it help? Could you be facing a similar situation?

Pascal Thivent
Thank you for your comment. Unfortunately I'm using the most current version of JDK (and this might actually be the issue). It looks like I'm hitting the following bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6928796Unfortunately I'm having different issues trying to downgrade to an earlier JDK version and I don't really understand the workarounds... Could you help with that? Thanks!
Marcello
@Marcello: To be honest, this was a shot in the dark. And I don't know if you're hitting the mentioned bug (I can't see any obvious evidence but you have more details I guess). Maybe downgrading the JDK version is worth the try but, well, you didn't tell anything about the errors you're facing then :)
Pascal Thivent
A: 

Do you have any passwords specified in your persistence.xml that are encrypted?

Doug

Doug Clarke
Nope, the problem might be this bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6928796Could you help me with the workarounds? I don't really know where to start.. Thank you.
Marcello