You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by vnjaldawar <vn...@gmail.com> on 2017/11/13 11:06:17 UTC

OpenJPA 2.3.0 StackOverflow Error for the entities.

https://issues.apache.org/jira/browse/OPENJPA-2722

I am facing StackOverflow error in my application. I am inserting large
amount of data approx 20000 entities. Around 6 entities are involved with
different relationship like one to many, many to one, one to one.
Version: OpenJPA 2.4.2
persistence.xml
<property name="openjpa.RuntimeUnenhancedClasses" value="supported"/>
<property name="openjpa.DataCache" value="true(CacheSize=1000)"/>
<property name="openjpa.QueryCache" value="true(CacheSize=1000)" />
<property name="openjpa.ConnectionProperties"
value="MaxActive=25,MaxIdle=10,MinIdle=5,MaxWait=60000" />
Running it on Tomcat 8.0.43, JDK1.8.0_144
Error:
java.lang.StackOverflowError
java.security.AccessController.doPrivileged(Native Method)
org.apache.openjpa.enhance.Reflection.getDeclaredField(Reflection.java:280)
org.apache.openjpa.enhance.Reflection.findField(Reflection.java:259)
org.apache.openjpa.enhance.xx$xxx$xxxxxxx$xx$entity$TableModDPSet$pcsubclass.pcProvideField(Unknown
Source)
org.apache.openjpa.kernel.StateManagerImpl.provideField(StateManagerImpl.java:3240)
org.apache.openjpa.kernel.SaveFieldManager.isFieldEqual(SaveFieldManager.java:189)
org.apache.openjpa.kernel.StateManagerImpl.dirtyCheck(StateManagerImpl.java:939)
org.apache.openjpa.kernel.ManagedCache.dirtyCheck(ManagedCache.java:302)




--
Sent from: http://openjpa.208410.n2.nabble.com/OpenJPA-Users-f208411.html

Re: OpenJPA 2.3.0 StackOverflow Error for the entities.

Posted by vnjaldawar <vn...@gmail.com>.
I found the solution. I have implemented build time enhancement and removed
the runtime enahcement from the persistence.xml file

<build>
                  <plugins>
                        ..
                        <plugin>
					        <groupId>org.apache.openjpa</groupId>
					        <artifactId>openjpa-maven-plugin</artifactId>
					        <configuration>
					            <includes>**/entity/*.class</includes>
					            <addDefaultConstructor>true</addDefaultConstructor>               
					           
<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
					        </configuration>
					        <executions>
					            <execution>
					                <id>enhancer</id>
					                <phase>process-classes</phase>
					                <configuration>
						              	<tasks>
						                  	<taskdef name="openjpac"
classname="org.apache.openjpa.ant.PCEnhancerTask"
classpathref="maven.compile.classpath"/>
						                  	<openjpac>
						                      	<classpath refid="maven.compile.classpath"/>
						                  	</openjpac>
						              	</tasks>
						            </configuration>
					                <goals>
					                    <goal>enhance</goal>
					                </goals>
					            </execution>
					        </executions>
					        <dependencies>
					            <dependency>
					                <groupId>org.apache.openjpa</groupId>
									<artifactId>openjpa-maven-plugin</artifactId>
									
									<version>2.3.0</version>
					            </dependency>
					        </dependencies>
					    </plugin>
                  </plugins>
      </build>



-----
Thanks and Regards,
Vishal Jaldawar
--
Sent from: http://openjpa.208410.n2.nabble.com/OpenJPA-Users-f208411.html