Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » EclipseLink JPA: Composite Persistence Units Example (Stackoverflow in the example provided)
icon4.gif  EclipseLink JPA: Composite Persistence Units Example [message #827170] Fri, 23 March 2012 01:05 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 #827178 is a reply to message #827170] Fri, 23 March 2012 01:14 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 3/22/2012 7:05 PM, Brian Zou wrote:
> Has anyone used this example? I have member1, member2 working fine.
> Using this I keep getting error.
> [snip]


If you don't get help here, try rather the Eclipse data tools forum.
Re: EclipseLink JPA: Composite Persistence Units Example [message #827183 is a reply to message #827178] Fri, 23 March 2012 01:31 Go to previous messageGo to next message
Brian Zou is currently offline Brian ZouFriend
Messages: 5
Registered: March 2012
Junior Member
I'll try .
Re: EclipseLink JPA: Composite Persistence Units Example [message #827750 is a reply to message #827183] Fri, 23 March 2012 18:57 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:photran - compiler warnings can't find atom
Next Topic:Emulator is not launching while running midlets in Eclipse ME
Goto Forum:
  


Current Time: Fri Apr 26 01:24:13 GMT 2024

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

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

Back to the top