-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Adding additional persistence.xml files
PostPosted: Tue Oct 02, 2007 3:58 pm 
Newbie

Joined: Thu Sep 14, 2006 12:08 pm
Posts: 19
I have a base project (base-project) that produces a jar with persistence classes and a META-INF/persistence.xml file.

I then have an extension project (ext-project) that depends upon the base-project.jar and wishes to add additional persistence.xml files to add entity listeners and perhaps additional persistence classes etc.

I cannot seem to get the ext-project's persistence.xml file to be processed by hibernate code no matter where I place it. I can tell this by looking at TRACE logs emitted by hibernate:

TRACE Ejb3Configuration:214 - Analyse of persistence.xml: jar:file:...base-project.jar!/META-INF/persistence.xml

and not seeing any similar message for the 2nd persistence.xml in ext-project.

I suspect that I am not placing the file in the correct location and it is therefor being ignored.

My standalone test program runs with the 2nd persistence.xml file as META-INF/persistence.xml file in a directory that is in the programs classpath.

Why is it not being processed during the creation of the PersistenceManagerFactory?

I am creating the PersistenceManagerFactory using following code:

Persistence.createEntityManagerFactory(persistenceUnitName, properties);

TIA for your help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.