Java Exception when run as Windows Task

3560
3
08-18-2011 08:45 PM
ScottSelikoff
New Contributor
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.
0 Kudos
3 Replies
TomSchuller
Occasional Contributor III
Hy,
how did you configured it to run as WindowsTask? Same user?

You could try to force using the JRE provide by your ArcGIS software (Desktop, Engine, Server)

Tom
0 Kudos
ScottSelikoff
New Contributor
Originally it was set with the same user, whether logged in or not.  When it started having issues I tried a variety of users and permissions with no change.

I don't think I installed a JRE when I installed the Engine.  Either way I tried with a variety of 1.6 JREs, old and new, without any change.
0 Kudos
TomSchuller
Occasional Contributor III
Hy,
could you try this solution:
http://stackoverflow.com/questions/4615213/confusing-issue-with-batch-as-a-scheduled-task

When setting up the scheduled task in Windows Vista/7 consider choosing the check-box for "Run with highest privileges" from the general tab, as this removes the need to always provide administrator privileges and may resolve other issues as well.

Tom
0 Kudos