What to do? An unexpected exception ...outside the VM

B

bdobby

Hi.
I have an ant build file which uses xdoclet to generate various
artefacts (EJB interfaces, config files, etc). Several of the xdoclet
steps use custom templates. One of these steps (always the same one)
occasionally (about one in every ten times) crashes the build with the
following error:
"An unexpected exception has been detected in native code outside the
VM"
(full info below).

Can anyone suggest how I could go about preventing this?
TIA
Brian

java -version
java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

OS is Windows XP

The xdoclet template is:

<XDTComment:comment>
--------------------------------------------------------------------------
Generate a dwr.xml that references all methods in the specified
classes.
--------------------------------------------------------------------------
</XDTComment:comment><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC
"-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
"http://www.getahead.ltd.uk/dwr/dwr10.dtd">
<!-- Generated by XDoclet; do not modify! -->
<dwr>
<allow>
<XDTClass:forAllClasses>
<create creator="new" javascript="<XDTClass:className/>">
<param name="class" value="<XDTClass:fullClassName/>"/>
</create>
</XDTClass:forAllClasses>

<convert converter="bean" match="com.kallik.assetManager.api.*" />
<convert converter="bean" match="com.kallik.common.helpers.Page" />
<convert converter="bean" match="com.kallik.common.helpers.Range"
/>
<convert converter="bean"
match="com.kallik.assetManager.helpers.Criterion" />
<convert converter="bean"
match="com.kallik.assetManager.helpers.SimpleSearchResultBean" />
</allow>
</dwr>

The full error info is:
..
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at
PC=0x7C92AE22
Function=RtlImpersonateSelf+0x3A5
Library=C:\WINDOWS\system32\ntdll.dll

Current Java thread:
at java.util.zip.ZipFile.getEntry(Native Method)
at java.util.zip.ZipFile.getEntry(ZipFile.java:146)
- locked <0x105b6570> (a java.util.zip.ZipFile)
at
org.apache.tools.ant.AntClassLoader.getResourceStream(AntClassLoader.java:745)
at
org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1133)
at
org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1090)
at
org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:960)
- locked <0x105878d0> (a org.apache.tools.ant.loader.AntClassLoader2)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
- locked <0x105878d0> (a org.apache.tools.ant.loader.AntClassLoader2)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at
org.apache.tools.ant.loader.AntClassLoader2.defineClassFromData(AntClassLoader2.java:76)
at
org.apache.tools.ant.AntClassLoader.getClassFromStream(AntClassLoader.java:1073)
at
org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1137)
at
org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1090)
at
org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:960)
- locked <0x105878d0> (a org.apache.tools.ant.loader.AntClassLoader2)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
- locked <0x105878d0> (a org.apache.tools.ant.loader.AntClassLoader2)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:219)
at xjavadoc.XJavaDoc.getClass(XJavaDoc.java:733)
at xjavadoc.XJavaDoc.getXClass(XJavaDoc.java:413)
at xjavadoc.SourceClass.qualify(SourceClass.java:376)
at
xjavadoc.AbstractClass.resolveImportedClasses(AbstractClass.java:822)
at
xjavadoc.SimpleParser.ClassOrInterfaceDeclaration(SimpleParser.java:533)
at xjavadoc.SimpleParser.TypeDeclaration(SimpleParser.java:472)
at xjavadoc.SimpleParser.CompilationUnit(SimpleParser.java:322)
at xjavadoc.SimpleParser.populate(SimpleParser.java:264)
at xjavadoc.SourceClass.parse(SourceClass.java:757)
at xjavadoc.SourceClass.<init>(SourceClass.java:124)
at xjavadoc.XJavaDoc.scanAndPut(XJavaDoc.java:885)
at xjavadoc.XJavaDoc.getXClass(XJavaDoc.java:406)
at xjavadoc.SourceClass.qualify(SourceClass.java:376)
at
xjavadoc.AbstractClass.resolveImportedClasses(AbstractClass.java:822)
at
xjavadoc.SimpleParser.ClassOrInterfaceDeclaration(SimpleParser.java:533)
at xjavadoc.SimpleParser.TypeDeclaration(SimpleParser.java:472)
at xjavadoc.SimpleParser.CompilationUnit(SimpleParser.java:322)
at xjavadoc.SimpleParser.populate(SimpleParser.java:264)
at xjavadoc.SourceClass.parse(SourceClass.java:757)
at xjavadoc.SourceClass.<init>(SourceClass.java:124)
at xjavadoc.XJavaDoc.scanAndPut(XJavaDoc.java:885)
at xjavadoc.XJavaDoc.getXClass(XJavaDoc.java:406)
at xjavadoc.XJavaDoc.getOuterSourceClasses(XJavaDoc.java:760)
at xjavadoc.XJavaDoc.getSourceClasses(XJavaDoc.java:323)
at
xdoclet.tagshandler.AbstractProgramElementTagsHandler.getAllClasses(AbstractProgramElementTagsHandler.java:101)
at
xdoclet.tagshandler.ClassTagsHandler.forAllClasses(ClassTagsHandler.java:374)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at xdoclet.template.TemplateEngine.invoke(TemplateEngine.java:641)
at
xdoclet.template.TemplateEngine.invokeMethod(TemplateEngine.java:567)
at
xdoclet.template.TemplateEngine.invokeBlockMethod(TemplateEngine.java:965)
at
xdoclet.template.TemplateEngine.handleBlockTag(TemplateEngine.java:932)
at xdoclet.template.TemplateEngine.handleTag(TemplateEngine.java:472)
at xdoclet.template.TemplateEngine.generate(TemplateEngine.java:348)
at xdoclet.template.TemplateEngine.start(TemplateEngine.java:415)
at xdoclet.TemplateSubTask.startEngine(TemplateSubTask.java:573)
at
xdoclet.TemplateSubTask.startProcessForAll(TemplateSubTask.java:629)
at xdoclet.TemplateSubTask.startProcess(TemplateSubTask.java:610)
at xdoclet.TemplateSubTask.execute(TemplateSubTask.java:498)
at xdoclet.XDocletMain.start(XDocletMain.java:49)
at xdoclet.DocletTask.start(DocletTask.java:468)
at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:105)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
at org.apache.tools.ant.Main.runBuild(Main.java:673)
at org.apache.tools.ant.Main.startAnt(Main.java:188)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)

Dynamic libraries:
0x00400000 - 0x0040B000 C:\j2sdk1.4.2_05\bin\java.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
0x77C10000 - 0x77C68000 C:\WINDOWS\system32\MSVCRT.dll
0x08000000 - 0x08139000 C:\j2sdk1.4.2_05\jre\bin\client\jvm.dll
0x77D40000 - 0x77DD0000 C:\WINDOWS\system32\USER32.dll
0x77F10000 - 0x77F57000 C:\WINDOWS\system32\GDI32.dll
0x76B40000 - 0x76B6D000 C:\WINDOWS\system32\WINMM.dll
0x10000000 - 0x10007000 C:\j2sdk1.4.2_05\jre\bin\hpi.dll
0x00390000 - 0x0039E000 C:\j2sdk1.4.2_05\jre\bin\verify.dll
0x003B0000 - 0x003C9000 C:\j2sdk1.4.2_05\jre\bin\java.dll
0x003D0000 - 0x003DD000 C:\j2sdk1.4.2_05\jre\bin\zip.dll
0x76C90000 - 0x76CB8000 C:\WINDOWS\system32\imagehlp.dll
0x59A60000 - 0x59B01000 C:\WINDOWS\system32\DBGHELP.dll
0x77C00000 - 0x77C08000 C:\WINDOWS\system32\VERSION.dll
0x76BF0000 - 0x76BFB000 C:\WINDOWS\system32\PSAPI.DLL

Heap at VM Abort:
Heap
def new generation total 576K, used 343K [0x10010000, 0x100b0000,
0x104f0000)
eden space 512K, 54% used [0x10010000, 0x10055c30, 0x10090000)
from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000)
to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000)
tenured generation total 2208K, used 1421K [0x104f0000, 0x10718000,
0x14010000)
the space 2208K, 64% used [0x104f0000, 0x106535c0, 0x10653600,
0x10718000)
compacting perm gen total 7168K, used 6994K [0x14010000, 0x14710000,
0x18010000)
the space 7168K, 97% used [0x14010000, 0x146e4880, 0x146e4a00,
0x14710000)

Local Time = Thu Jan 19 15:40:45 2006
Elapsed Time = 3
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_05-b04 mixed mode)
#
 
C

Carl Burke

Hi.
I have an ant build file which uses xdoclet to generate various
artefacts (EJB interfaces, config files, etc). Several of the xdoclet
steps use custom templates. One of these steps (always the same one)
occasionally (about one in every ten times) crashes the build with the
following error:
"An unexpected exception has been detected in native code outside the
VM"
(full info below).

Can anyone suggest how I could go about preventing this?

You're getting this error because one of the libraries you're using uses
native code,
and that DLL has a bug which causes it to use a bad pointer. The only
solution
that I know of, unfortunately, is to either (1) change whatever templates
you have
that invoke the buggy feature, (2) fix the native code (if you have access
to it),
or (3) stop using that component. It looks like a problem with the
java.util.zip.ZipFile
class, so I'd submit a bug report at Sun and hope they can fix it or point
you in the
right direction. It's possible that the zipped file (probably a jar file) is
corrupted
in some way that the native code isn't prepared to handle.

This isn't really a Java issue per se, which may explain why nobody else has
bothered to reply to it. I haven't done anything with doclets, and I haven't
encountered this particular problem. I do get native code exceptions and
other HotSpot crashes, and my remedies are basically to fix it myself if I
have
the native source, or change solutions entirely.

Sorry I don't have a more palatable answer.
 
B

bdobby

Thanks for your reply. I didn't reply earlier because I'd stopped
watching this post :-(

You pretty well confirm what I thought. Unfortunately, the 'native
code' is Windows! I guess we'll just have to live with it. It is, after
all, intermittent.

Thanks again
Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,961
Messages
2,570,131
Members
46,689
Latest member
liammiller

Latest Threads

Top