Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D076CD40A for ; Tue, 31 Jul 2012 14:35:36 +0000 (UTC) Received: (qmail 13942 invoked by uid 500); 31 Jul 2012 14:35:35 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 13807 invoked by uid 500); 31 Jul 2012 14:35:35 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 13590 invoked by uid 99); 31 Jul 2012 14:35:35 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jul 2012 14:35:35 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id F0DE51404B4 for ; Tue, 31 Jul 2012 14:35:34 +0000 (UTC) Date: Tue, 31 Jul 2012 14:35:34 +0000 (UTC) From: "Jody Grassel (JIRA)" To: dev@openjpa.apache.org Message-ID: <119389702.121594.1343745334988.JavaMail.jiratomcat@issues-vm> In-Reply-To: <1965991251.24702.1341861934702.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Updated] (OPENJPA-2227) OpenJPA doesn't find custom SequenceGenerators MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OPENJPA-2227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jody Grassel updated OPENJPA-2227: ---------------------------------- Attachment: OPENJPA-2227-2.2.x.patch Uploaded copy of the patch for 2.2.x, as integration for this branch needs to be delayed. > OpenJPA doesn't find custom SequenceGenerators > ---------------------------------------------- > > Key: OPENJPA-2227 > URL: https://issues.apache.org/jira/browse/OPENJPA-2227 > Project: OpenJPA > Issue Type: Bug > Components: kernel > Affects Versions: 2.0.0, 2.1.0, 2.2.0 > Environment: WebSphere Application Server V8.0 and V8.5 > Reporter: Jens Leisenberg > Assignee: Jody Grassel > Priority: Blocker > Attachments: ClassNotFoundException.txt, OPENJPA-2227-2.2.x.patch > > > 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. > ExampleConfiguration: > {code} > @Entity > @SequenceGenerator(name="MySequence", sequenceName="org.apache.openjpa.generator.UIDGenerator()") > public class Customer implements Serializable { > @Id > @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="MySequence") > private long id; > {code} > 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira