Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » EclipseLink JPA: Composite Persistence Units Example(EclipseLink JPA: Composite Persistence Units Example stackoverflow error)
EclipseLink JPA: Composite Persistence Units Example [message #827188] Fri, 23 March 2012 01:43 Go to next message
Brian Zou is currently offline Brian ZouFriend
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)
Re: EclipseLink JPA: Composite Persistence Units Example [message #827574 is a reply to message #827188] Fri, 23 March 2012 14:21 Go to previous messageGo to next message
Andrei Ilitchev is currently offline Andrei IlitchevFriend
Messages: 5
Registered: July 2009
Junior Member
Eclipselink jpa tests run every day several Composite persistence unit examples that follow the pattern described in wiki.eclipse.org/EclipseLink/Examples/JPA/Composite.

Could it be that your Composite persistence unit's persistence.xml is packaged in one of the jars it is referencing? That would explain stack overflow.
Re: EclipseLink JPA: Composite Persistence Units Example [message #827751 is a reply to message #827574] Fri, 23 March 2012 18:58 Go to previous message
Brian Zou is currently offline Brian ZouFriend
Messages: 5
Registered: March 2012
Junior Member
Please close this. I change the jar with directory. It works.
Previous Topic:Persistence.getPersistenceUtil
Next Topic:IntegrityChecker with PostgreSQL
Goto Forum:
  


Current Time: Tue Apr 23 14:28:36 GMT 2024

Powered by FUDForum. Page generated in 0.03026 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top