EclipseLink JPA: Composite Persistence Units Example [message #827188] |
Fri, 23 March 2012 01:43 |
Brian Zou Messages: 5 Registered: March 2012 |
Junior Member |
|
|
Has anyone used this example? I have member1, member2 working fine. Using this I keep getting error. Debugging it, this method keep loading the same persistence.xml, so it's a infinite loop:
protected static Map<String, SEPersistenceUnitInfo> <b>getCompositeMemberPuInfoMap(PersistenceUnitInfo puInfo, Map predeployProperties)</b> {
Set<SEPersistenceUnitInfo> memeberPuInfoSet = PersistenceUnitProcessor.getPersistenceUnits(puInfo.getClassLoader(), predeployProperties, puInfo.getJarFileUrls());
HashMap<String, SEPersistenceUnitInfo> memberPuInfoMap = new HashMap(memeberPuInfoSet.size());
for (SEPersistenceUnitInfo memberPuInfo : memeberPuInfoSet) {
// override transaction type with composite's transaction type
memberPuInfo.setTransactionType(puInfo.getTransactionType());
// override properties that should be overridden by composit's properties
overrideMemberProperties(memberPuInfo.getProperties(), puInfo.getProperties());
if (isComposite(memberPuInfo)) {
Map<String, SEPersistenceUnitInfo> containedMemberPuInfoMap = <b>getCompositeMemberPuInfoMap(memberPuInfo, memberPuInfo.getProperties())</b>;
Iterator<Map.Entry<String, SEPersistenceUnitInfo>> it = containedMemberPuInfoMap.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String,
....................................
<b>wiki.eclipse.org/EclipseLink/Examples/JPA/Composite</b>
<persistence xmlns="://java.sun.com/xml/ns/persistence" xmlns:xsi="://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="://java.sun.com/xml/ns/persistence persistence_1_0.xsd" version="1.0">
<persistence-unit name="compositePu" transaction-type="JTA">
<provider>
org.eclipse.persistence.jpa.PersistenceProvider
</provider>
<jar-file>member1.jar</jar-file>
<jar-file>member2.jar</jar-file>
<properties>
<property name="eclipselink.composite-unit" value="true"/>
<property name="eclipselink.target-server" value="None"/>
</properties>
</persistence-unit>
</persistence>
Error:
Caused by: java.lang.StackOverflowError
at java.util.ArrayList.get(ArrayList.java:322)
at sun.misc.URLClassPath.getLoader(URLClassPath.java:312)
at sun.misc.URLClassPath.findResource(URLClassPath.java:144)
at java.net.URLClassLoader$2.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findResource(URLClassLoader.java:359)
at java.lang.ClassLoader.getResource(ClassLoader.java:978)
at java.lang.ClassLoader.getResource(ClassLoader.java:973)
at java.lang.ClassLoader.getResource(ClassLoader.java:973)
at org.eclipse.core.runtime.internal.adaptor.ContextFinder.getResource(ContextFinder.java:149)
at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1168)
at javax.xml.parsers.SecuritySupport$4.run(SecuritySupport.java:96)
at java.security.AccessController.doPrivileged(Native Method)
at javax.xml.parsers.SecuritySupport.getResourceAsStream(SecuritySupport.java:89)
at javax.xml.parsers.FactoryFinder.findJarServiceProvider(FactoryFinder.java:250)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:223)
at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:128)
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processPersistenceXML(PersistenceUnitProcessor.java:547)
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processPersistenceArchive(PersistenceUnitProcessor.java:536)
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.getPersistenceUnits(PersistenceUnitProcessor.java:444)
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.getPersistenceUnits(PersistenceUnitProcessor.java:350)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.getCompositeMemberPuInfoMap(EntityManagerSetupImpl.java:2881)
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05163 seconds