scott@selikoff.net

Java Exception when run as Windows Task

Discussion created by scott@selikoff.net on Aug 18, 2011
Latest reply on Aug 24, 2011 by TomLUX
I have a Java program that uses ArcObjects (v10 /w SP2).  It works fine when I execute it via command line (cmd.exe) in Windows, but if I try to execute it as a Windows Task, it throws an Java exception.  There's a lot of information in the exception but nothing that indicates why it failed. 

Below is a snippet of the exception:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_UNCAUGHT_CXX_EXCEPTION (0xe06d7363) at pc=0x759dc83b, pid=4396, tid=4380
#
# JRE version: 6.0_26-b03
# Java VM: Java HotSpot(TM) Client VM (20.1-b02 mixed mode windows-x86 )
# Problematic frame:
# C  [kernel32.dll+0x1c83b]
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

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

Current thread (0x00239400):  JavaThread "main" [_thread_in_native, id=4380, stack(0x00190000,0x001e0000)]

......

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.esri.arcgis.interop.NativeObjRef.nativeVtblInvokeNative(Lcom/esri/arcgis/interop/Rpc;[BLjava/lang/String;ILjava/lang/String;[Lcom/esri/arcgis/interop/Param;[Ljava/lang/Object;I)V+0
j  com.esri.arcgis.interop.NativeObjRef.nativeVtblInvoke(Lcom/esri/arcgis/interop/Rpc;[BLjava/lang/String;ILjava/lang/String;[Lcom/esri/arcgis/interop/Param;[Ljava/lang/Object;I)V+111
j  com.esri.arcgis.interop.NativeObjRef.invoke(Lcom/esri/arcgis/interop/Rpc;Lcom/esri/arcgis/interop/Uuid;Lcom/esri/arcgis/interop/AuthInfo;)V+82
j  com.esri.arcgis.interop.Dispatch.vtblInvoke(Ljava/lang/String;I[Ljava/lang/Object;)V+97
j  com.esri.arcgis.carto.IActiveViewProxy.output(IILcom/esri/arcgis/system/tagRECT;Lcom/esri/arcgis/geometry/IEnvelope;Lcom/esri/arcgis/system/ITrackCancel;)V+65
j  com.esri.arcgis.carto.PageLayout.output(IILcom/esri/arcgis/system/tagRECT;Lcom/esri/arcgis/geometry/IEnvelope;Lcom/esri/arcgis/system/ITrackCancel;)V+33


I've tried with more recent versions of Java 1.6 without any difference.  I've also tried setting Xmx/Xmx/Xss values but with no change.  Any suggestions?

As I said, it works without issue if I execute it from a command line.  I've checked the permissions on the Windows Task and its set to execute with highest permissions.

Outcomes