I'm using the PCEnhancerTask with Ant and OpenJPA version 2.1.0. This line: PersistenceUnitInfoImpl pinfo = parseResources(parser, urls, name, loader); (Class PersistenceProductDerivation , line 525) seems to be the point where it begins to go wrong. This following method (beginning in the line 554) generates an internal list of all persistence units, but returns only one of them losing information about the rest: private PersistenceUnitInfoImpl parseResources(ConfigurationParser parser, List urls, String name, ClassLoader loader) throws IOException { List pinfos = new ArrayList(); for (URL url : urls) { parser.parse(url); pinfos.addAll((List) parser.getResults()); } return findUnit(pinfos, name, loader); } It's OK if the persistence unit name is specified, but if it is not specified, then only the classes from this single returned persistence unit are enhanced and the rest is not. Kind regards, Michael Spiro > -----Ursprüngliche Nachricht----- > Von: Pinaki Poddar [mailto:ppoddar@apache.org] > Gesendet: Dienstag, 17. Januar 2012 15:57 > An: dev@openjpa.apache.org > Betreff: Re: Enhancement with multiple persistence units > > Hi, > > Enhancer seems to run on all units when it was invoked as > > $ java org.apache.openjpa.enhance.PCEnhancer -p META- > INF/persistence.xml > > If you are running by a Ant/Maven script, prefer invoking the java > class ( > i.e. org.apache.openjpa.enhance.PCEnhancer) directly instead of the Ant > task > defined by OpenJPA. Runs much cleaner. > > what exactly is not working currently? > > ----- > Pinaki Poddar > Chair, Apache OpenJPA Project > -- > View this message in context: > http://openjpa.208410.n2.nabble.com/Enhancement-with-multiple- > persistence-units-tp7183611p7196631.html > Sent from the OpenJPA Developers mailing list archive at Nabble.com.