Bug 48 : ArrayIndexOutOfBoundsException: 0 ... at CallStack.getFirstStackTraceElement(CallStack.java:59)
Priority 
Medium
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
1.0.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
24/10/2008
Updated 
24/10/2008
Type 
Bug
 
Attachments 
No attachments

java.lang.ArrayIndexOutOfBoundsException: 0
at com.avaje.ebean.bean.CallStack.getFirstStackTraceElement(CallStack.java:59)
at com.avaje.ebean.bean.ObjectGraphOrigin.getFirstStackElement(ObjectGraphOrigin.java:76)
at com.avaje.ebean.server.autofetch.TunedQueryInfo.getLogOutput(TunedQueryInfo.java:169)
at com.avaje.ebean.server.autofetch.DefaultAutoFetchManagerLogging.logNew(DefaultAutoFetchManagerLogging.java:99)
at com.avaje.ebean.server.autofetch.DefaultAutoFetchManager.updateTunedQueryInfo(DefaultAutoFetchManager.java:346)
at com.avaje.ebean.server.autofetch.DefaultAutoFetchManager.collectUsageViaGC(DefaultAutoFetchManager.java:302)
at com.avaje.ebean.server.autofetch.DefaultAutoFetchManager.shutdown(DefaultAutoFetchManager.java:270)
at com.avaje.ebean.server.core.DefaultServer$Shutdown.run(DefaultServer.java:193)
at com.avaje.ebean.server.lib.ShutdownManager.shutdown(ShutdownManager.java:169)
at com.avaje.ebean.server.lib.ShutdownHook.run(ShutdownHook.java:47)

 
Rob 24 Oct 02:01
This occurs when... Autofetch is logging query tuning... and this occurs in a static void main() ...

Workaround:
Put the code in a method... and call that method from the static void main(). In this way the call stack then has 1 entry.

The bug is that when the code is directly in a public static void main(). Ebean trims the call stack back to the non-ebean 'interesting' part of the call stack. This ends up to be nothing when the code is called directly in a main() method.

Rob 05 Nov 08:48
Fixed in version 1.0.0

Fixed this and next release will be 1.0.0.

woResponse

Upload a file