Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » An unexpected error > EXCEPTION_ACCESS_VIOLATION(This issue occurs when two entities refers each other)
An unexpected error > EXCEPTION_ACCESS_VIOLATION [message #552826] Fri, 13 August 2010 16:25 Go to next message
Dzmitry [zmicer] Harachka is currently offline Dzmitry [zmicer] Harachka
Messages: 9
Registered: August 2010
Junior Member
Hi, All!
Please would you provide your ideas on what could cause such behavior.

I have very simple model, and orm mapping. Two classes, Book and Writer, one Book contains reference to Writer, and Writer contains collection of books he wrote:

<orm:entity-mappings xmlns:orm="http://www.eclipse.org/eclipselink/xsds/persistence/orm" version="2.1">
  <orm:access>FIELD</orm:access>
  <orm:entity class="org.eclipse.emf.texo.test.model.samples.library.Book" name="Book">
    <orm:attributes>
      <orm:basic name="title" optional="true"/>
      <orm:basic name="pages" optional="true"/>
      <orm:basic name="category" optional="true">
        <orm:enumerated>STRING</orm:enumerated>
      </orm:basic>
      <orm:many-to-one name="author" optional="false" target-entity="org.eclipse.emf.texo.test.model.samples.library.Writer">
        <orm:cascade>
          <orm:cascade-persist/>
          <orm:cascade-merge/>
          <orm:cascade-refresh/>
        </orm:cascade>
      </orm:many-to-one>
    </orm:attributes>
  </orm:entity>
  <orm:entity class="org.eclipse.emf.texo.test.model.samples.library.Writer" name="Writer">
    <orm:attributes>
      <orm:basic name="name" optional="true"/>
      <orm:one-to-many name="books" target-entity="org.eclipse.emf.texo.test.model.samples.library.Book">
        <orm:order-column/>
        <orm:join-table name="Writer_books"/>
        <orm:cascade>
          <orm:cascade-persist/>
          <orm:cascade-merge/>
          <orm:cascade-refresh/>
        </orm:cascade>
      </orm:one-to-many>
    </orm:attributes>
  </orm:entity>


Then I just try to get EntityManager to be used later, the following code is performed:

    Map properties = new HashMap();
    EntityManagerFactory emf = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME,
        properties);

    EntityManager em = emf.createEntityManager();


and I have the exception provided below.

Be noticed when I commented reference to Writer from Book entity - everything works ok for me. Another thing is when I tried to debug - everything again works nice. So this is an issue I have when running this code in runtime e.g. under tomcat in servlet environment, as junit test and as java standalone application.

Eclipse helios is used, and last (2.1.0.v20100614-r7608) version of EclipseLink.

Also EclipseLink is installed as plugin to Eclipse environment.

#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0093daa3, pid=4088, tid=1896
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_13-b05 mixed mode)
# Problematic frame:
# j org.eclipse.persistence.mappings.CollectionMapping.addDescen dingOrdering(Ljava/lang/String;)V+11
#

--------------- T H R E A D ---------------

Current thread (0x0035c7f8): JavaThread "main"

siginfo: ExceptionCode=0xc0000005, reading address 0x0e000031

Registers:
EAX=0x072a5c59, EBX=0x0e000001, ECX=0x0007f0ec, EDX=0x70800001
ESP=0x0007f0bc, EBP=0x0007f0e0, ESI=0x071d9933, EDI=0x0007f0ec
EIP=0x0093daa3, EFLAGS=0x00010246

Top of Stack: (sp=0x0007f0bc)
0x0007f0bc: 00932aba 0007f0ec 0007f0c4 071d9933
0x0007f0cc: 0007f0ec 074a0db0 00000000 071d9968
0x0007f0dc: 0007f0e8 0007f108 00932b3b 032b2db8
0x0007f0ec: 0007f0ec 072a5c59 0007f110 074b13a8
0x0007f0fc: 00000000 072a5c70 0007f110 0007f148
0x0007f10c: 00a6295c 032b2db8 02a1c700 0007f138
0x0007f11c: 073797a0 00000000 02a1c8f8 02a1c8a8
0x0007f12c: 02a1c700 02a1c8a8 02a1c750 00000001

Instructions: (pc=0x0093daa3)
0x0093da93: 00 3b 01 ff 63 30 8b 41 04 8b 9c 98 18 01 00 00
0x0093daa3: 8b 53 30 8b c3 ff e2 90 90 00 00 00 00 f0 00 00


Stack:
V
V
V
V
C
j sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Objec t;[Ljava/lang/Object;)Ljava/lang/Object;+87
j sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/O bject;[Ljava/lang/Object;)Ljava/lang/Object;+6
j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lan g/Object;)Ljava/lang/Object;+111
j org.junit.runners.model.FrameworkMethod$1.runReflectiveCall( )Ljava/lang/Object;+15
j org.junit.internal.runners.model.ReflectiveCallable.run()Lja va/lang/Object;+1
j org.junit.runners.model.FrameworkMethod.invokeExplosively(Lj ava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+10
j org.junit.internal.runners.statements.InvokeMethod.evaluate( )V+12
j org.junit.runners.BlockJUnit4ClassRunner.runChild(Lorg/junit /runners/model/FrameworkMethod;Lorg/junit/runner/notificatio n/RunNotifier;)V+31
j org.junit.runners.BlockJUnit4ClassRunner.runChild(Ljava/lang /Object;Lorg/junit/runner/notification/RunNotifier;)V+6
j org.junit.runners.ParentRunner$3.run()V+12
j org.junit.runners.ParentRunner$1.schedule(Ljava/lang/Runnabl e;)V+1
j org.junit.runners.ParentRunner.runChildren(Lorg/junit/runner /notification/RunNotifier;)V+40
j org.junit.runners.ParentRunner.access$000(Lorg/junit/runners /ParentRunner;Lorg/junit/runner/notification/RunNotifier;)V+ 2
j org.junit.runners.ParentRunner$2.evaluate()V+8
j org.junit.runners.ParentRunner.run(Lorg/junit/runner/notific ation/RunNotifier;)V+20
j org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(Lorg/eclipse/jdt/internal/junit/runner/TestExecution;)V+7 2
j org.eclipse.jdt.internal.junit.runner.TestExecution.run([Lor g/eclipse/jdt/internal/junit/runner/ITestReference;)V+17
j org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts([Ljava/lang/String;Ljava/lang/String;Lorg/eclipse/jdt/in ternal/junit/runner/TestExecution;)V+61
j org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(Lorg/eclipse/jdt/internal/junit/runner/TestExecution;)V+ 10
j org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run() V+70
j org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( [Ljava/lang/String;)V+14
v ~StubRoutines::call_stub
V
V
V
V
C
C
C


--------------- P R O C E S S ---------------

Java Threads: ( => current thread )
0x0ae6f218 JavaThread "MySQL Statement Cancellation Timer" daemon
0x0ae71008 JavaThread "ReaderThread"
0x00914790 JavaThread "Low Memory Detector" daemon
0x009134c0 JavaThread "CompilerThread0" daemon
0x00912900 JavaThread "Signal Dispatcher" daemon
0x009087f8 JavaThread "Finalizer" daemon
0x00907388 JavaThread "Reference Handler" daemon
=>0x0035c7f8 JavaThread "main"

Other Threads:
0x0035f970 VMThread [id=3028]
0x00911ae8 WatcherThread [id=2436]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
def new generation total 896K, used 460K [0x029b0000, 0x02aa0000, 0x02e90000)
eden space 832K, 52% used [0x029b0000, 0x02a1d638, 0x02a80000)
from space 64K, 36% used [0x02a80000, 0x02a85ca0, 0x02a90000)
to space 64K, 0% used [0x02a90000, 0x02a90000, 0x02aa0000)
tenured generation total 11344K, used 7441K [0x02e90000, 0x039a4000, 0x069b0000)
the space 11344K, 65% used [0x02e90000, 0x035d4590, 0x035d4600, 0x039a4000)
compacting perm gen total 14080K, used 13913K [0x069b0000, 0x07770000, 0x0a9b0000)
the space 14080K, 98% used [0x069b0000, 0x07746558, 0x07746600, 0x07770000)
No shared spaces configured.

Dynamic libraries:
0x00400000 - 0x0040d000 E:\program_files\isdk_1_5\bin\javaw.exe
0x7c900000 - 0x7c9b0000 C:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c8f4000 C:\WINDOWS\system32\kernel32.dll
0x77dd0000 - 0x77e6b000 C:\WINDOWS\system32\ADVAPI32.dll
0x77e70000 - 0x77f01000 C:\WINDOWS\system32\RPCRT4.dll
0x77d40000 - 0x77dd0000 C:\WINDOWS\system32\USER32.dll
0x77f10000 - 0x77f56000 C:\WINDOWS\system32\GDI32.dll
0x77c10000 - 0x77c68000 C:\WINDOWS\system32\MSVCRT.dll
0x76390000 - 0x763ad000 C:\WINDOWS\system32\IMM32.DLL
0x6d740000 - 0x6d8dd000 E:\program_files\isdk_1_5\jre\bin\client\jvm.dll
0x76b40000 - 0x76b6d000 C:\WINDOWS\system32\WINMM.dll
0x6d300000 - 0x6d308000 E:\program_files\isdk_1_5\jre\bin\hpi.dll
0x76bf0000 - 0x76bfb000 C:\WINDOWS\system32\PSAPI.DLL
0x6d710000 - 0x6d71c000 E:\program_files\isdk_1_5\jre\bin\verify.dll
0x6d380000 - 0x6d39d000 E:\program_files\isdk_1_5\jre\bin\java.dll
0x6d730000 - 0x6d73f000 E:\program_files\isdk_1_5\jre\bin\zip.dll
0x6d540000 - 0x6d553000 E:\program_files\isdk_1_5\jre\bin\net.dll
0x71ab0000 - 0x71ac7000 C:\WINDOWS\system32\WS2_32.dll
0x71aa0000 - 0x71aa8000 C:\WINDOWS\system32\WS2HELP.dll
0x20b00000 - 0x20b46000 C:\WINDOWS\system32\imon.dll
0x71ad0000 - 0x71ad9000 C:\WINDOWS\system32\WSOCK32.dll
0x20c00000 - 0x20c0c000 C:\Program Files\nod32\pr_imon.dll
0x77690000 - 0x776b1000 C:\WINDOWS\system32\NTMARTA.DLL
0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll
0x774e0000 - 0x7761c000 C:\WINDOWS\system32\ole32.dll
0x71bf0000 - 0x71c03000 C:\WINDOWS\system32\SAMLIB.dll
0x10000000 - 0x1000f000 C:\WINDOWS\system32\dcsws2.dll
0x71a50000 - 0x71a8f000 C:\WINDOWS\system32\mswsock.dll
0x662b0000 - 0x66308000 C:\WINDOWS\system32\hnetcfg.dll
0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll
0x76f20000 - 0x76f47000 C:\WINDOWS\system32\DNSAPI.dll
0x76fb0000 - 0x76fb8000 C:\WINDOWS\System32\winrnr.dll
0x76fc0000 - 0x76fc6000 C:\WINDOWS\system32\rasadhlp.dll

VM Arguments:
jvm_args: -Dfile.encoding=Cp1251 -Xbootclasspath:E:\program_files\isdk_1_5\jre\lib\endorsed\s erializer-2.7.0.jar;E:\program_files\isdk_1_5\jre\lib\endors ed\xercesImpl-2.8.1.jar;E:\program_files\isdk_1_5\jre\lib\en dorsed\xml-apis-2.8.1.jar;E:\program_files\isdk_1_5\jre\lib\ rt.jar;E:\program_files\isdk_1_5\jre\lib\jsse.jar;E:\program _files\isdk_1_5\jre\lib\jce.jar;E:\program_files\isdk_1_5\jr e\lib\charsets.jar
java_command: org.eclipse.jdt.internal.junit.runner.RemoteTestRunner -version 3 -port 4689 -testLoaderClass org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime -classNames org.eclipse.emf.texo.json.Tester
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=E:\program_files\isdk_1_6
CLASSPATH=.;C:\Program Files\Java\jre1.5.0\lib\ext\QTJava.zip;E:\projects\remote\sp ringsite\yageo\dev\YageoRD\install\lucene\lucene-2.4.0\lucen e-core-2.4.0.jar;E:\projects\remote\springsite\yageo\dev\Yag eoRD\install\lucene\lucene-2.4.0\lucene-demos-2.4.0.jar;E:\p rojects\remote\springsite\yageo\dev\YageoRD\trunk\Lucene\lib \Multivalent20060102.jar;C:\welcome\java\pdfbox\lib\apache-p dfbox-0.8.0-incubator-dev.jar;C:\welcome\java\pdfbox\externa l\FontBox-0.2.0-dev.jar;C:\welcome\java\pdfbox\external\bcpr ov-jdk14-132.jar;
PATH=C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:/Program Files/Java/jre6/lib/i386;I:\Program Files\Delphi7\Bin;I:\Program Files\Delphi7\Projects\Bpl\;E:\PROGRA~1\CBUILD~1\Bin;E:\PROG RA~1\CBUILD~1\Projects\Bpl;C:\WINDOWS\system32;C:\WINDOWS;C: \WINDOWS\system32\WBEM;E:\program_files\perl\bin\;C:\WINDOWS \system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI.ACE\;E:\program_files\ant\bin\;D:\program_f iles\svn_server\bin\;E:\program_files\maven_2.0.7\bin\;E:\pr ogram_files\isdk_1_5\bin\;C:\Program Files\QuickTime\QTSystem\;E:\aidoss\installed\maven-1.0.2\bi n\;E:\program_files\jwsdp\jaxrpc\bin\;E:\aidoss\install\ecli pse\;E:\program_files\cygwin\bin;c:\Program Files\TortoiseCVS\;E:\program_files\jad\;D:\program_files\sa msung\;E:\projects\R_D\setx;E:\program_files\OpenSSL\bin\;E: \Alfresco\bin\;C:\Program Files\TortoiseSVN\bin;E:\projects\research\libxslt\;C:\Progr am Files\MySQL\MySQL Server 5.0\bin;C:\welcome\java\jboss-seam-2.1.0.GA\;H:\.\common;G:\ Program Files\common;E:\program_files\appserv\Apache2.2\bin;E:\progr am_files\appserv\php5;E:\program_files\appserv\MySQL\bin
USERNAME=zmicer
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 6, GenuineIntel



--------------- S Y S T E M ---------------

OS: Windows XP Build 2600 Service Pack 2

CPU:total 2 (cores per cpu 2, threads per core 1) family 6 model 15 stepping 6, cmov, cx8, fxsr, mmx, sse, sse2

Memory: 4k page, physical 2095480k(765040k free), swap 4033520k(2452716k free)

vm_info: Java HotSpot(TM) Client VM (1.5.0_13-b05) for windows-x86, built on Sep 25 2007 19:11:52 by "java_re" with MS VC++ 6.0



www.zmicer.com
Re: An unexpected error > EXCEPTION_ACCESS_VIOLATION [message #552832 is a reply to message #552826] Fri, 13 August 2010 16:43 Go to previous messageGo to next message
Dzmitry [zmicer] Harachka is currently offline Dzmitry [zmicer] Harachka
Messages: 9
Registered: August 2010
Junior Member
Another thing to mention. As it was stated, it was not about debug. But, if at debug just have a breakpoint at some line, and then jyst press f8 (continue to run) - then again this thing appears.

But if continue to debug line by line - all is ok.

I have such impression it is something related to speed of running, and could related class loaders (which are changed inside eclipse link widely) or may be asm framework manipulations?


www.zmicer.com
Re: An unexpected error > EXCEPTION_ACCESS_VIOLATION [message #552838 is a reply to message #552826] Fri, 13 August 2010 17:03 Go to previous messageGo to next message
Dzmitry [zmicer] Harachka is currently offline Dzmitry [zmicer] Harachka
Messages: 9
Registered: August 2010
Junior Member
Another thing I have mentioned is if to see at exception trace

j org.eclipse.persistence.mappings.CollectionMapping.addDescen dingOrdering(Ljava/lang/String;)V+11
j org.eclipse.persistence.mappings.ObjectReferenceMapping.hasC onstraintDependency()Z+1
J org.eclipse.persistence.internal.sessions.CommitOrderDepende ncyNode.recordMappingDependencies()V
v ~RuntimeStub::alignment_frame_return Runtime1 stub
j org.eclipse.persistence.internal.sessions.CommitOrderCalcula tor.calculateMappingDependencies()V+-33508
j org.eclipse.persistence.internal.sessions.CommitManager.init ializeCommitOrder()V+121
j org.eclipse.persistence.internal.sessions.DatabaseSessionImp l.initializeDescriptors(Ljava/util/Ma

and study sources - then it is seen CollectionMapping.addDescendingOrdering can not be invoked on the heap of ObjectReferenceMapping.hasConstraintDependency - it looks like it is called from another thread or something like that.

Very strange thing.

And as I could see if google "eclipse link + EXCEPTION_ACCESS_VIOLATION" then there are lots of search results...

Would appreciate for a help.


www.zmicer.com
Re: An unexpected error > EXCEPTION_ACCESS_VIOLATION [message #552942 is a reply to message #552826] Sat, 14 August 2010 21:50 Go to previous messageGo to next message
Chris is currently offline Chris
Messages: 97
Registered: July 2009
Member
I would suspect a bug in the JIT compiler. I had a situation in the past
with an IBM JVM, where it worked in debug mode, but not in normal mode.
The code also worked if I added a System.out.println() in the middle of
the problem area.
It turned out to be one of the optimizations in the JIT compiler
generated some bad machine code. Fortunately, the IBM jvm was really
well instrumented, so I was able to turn off the optimizations bit by
bit till I tracked down the method call causing the problem. IBM fixed
it pretty quick.

In your case, you are using a pretty old Sun JVM 1.5.0_13-b05, which
will now be maintained by Oracle (if at all).
Are you using it because you have to? Have you tried a newer JVM, just
to see if the exception still happens?
I don't know if you can selectively turn off the JIT compiler for the
method that fails with that JVM. Worth investigating tho.

Regards
Chris
Re: An unexpected error > EXCEPTION_ACCESS_VIOLATION [message #553075 is a reply to message #552942] Mon, 16 August 2010 10:38 Go to previous message
Dzmitry [zmicer] Harachka is currently offline Dzmitry [zmicer] Harachka
Messages: 9
Registered: August 2010
Junior Member
Hi, Chris!

Thanks for your detailed answer, and sharing your experience with IBM JVM.

I my case I should use Java 5 as requirement.

But your post helped to me - I downloaded newest version of 1.5 Java - it is update 22, and this problem fixed.

The problem I had is I was thinking this is something related to EclipseLink (as it uses Asm and some classloading manipulations) but seems to be it is a combination of EclipseLink advanced java techniques + Java worked not in a proper way mixing byte code execution from various streams.

Thus, thanks a lot, Chris, for an idea to update JRE.

Dzmitry


www.zmicer.com
Previous Topic:NamedQuery generates invalid SQL
Next Topic:query with JoinTable
Goto Forum:
  


Current Time: Thu Oct 23 03:13:21 GMT 2014

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

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