openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jens Leisenberg (JIRA)" <>
Subject [jira] [Created] (OPENJPA-2227) OpenJPA doesn't find custom SequenceGenerators
Date Mon, 09 Jul 2012 19:25:33 GMT
Jens Leisenberg created OPENJPA-2227:

             Summary: OpenJPA doesn't find custom SequenceGenerators
                 Key: OPENJPA-2227
             Project: OpenJPA
          Issue Type: Bug
          Components: kernel
    Affects Versions: 2.2.0, 2.1.0, 2.0.0
         Environment: WebSphere Application Server V8.0 and V8.5
            Reporter: Jens Leisenberg
            Priority: Blocker
         Attachments: ClassNotFoundException.txt

I'm trying to use a custom SequenceGenerator within an enterprise application using openJPA
(providing by WebSphere).

When defining a custom Sequence a ClassNotFoundException (for the Sequence class) will be
thrown when trying to insert data into the database.

@SequenceGenerator(name="MySequence", sequenceName="org.apache.openjpa.generator.UIDGenerator()")
public class Customer implements Serializable {
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="MySequence")
    private long id;

The example will produce the stacktrace attached.

It seems that the wrong class loader is used to instantiate the custom sequence class. A very
similar issue seems to be: OPENJPA-758. With JavaSE (JUnit) all is working fine, but after
deploying into WAS the Exception will occur.

I think within the method SequenceMetaData.instantiate(Classloader envLoader) the JavaTypes.classForName()
-method with parameter mustExist=false should be used instead of the pure Class.forName()
call. But I'm not sure about the Metadata-parameter needed for this method call.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message