2

I'm currently running an application that can only be run through a program/s commandline which uses java. When I get my error print out, how do I view the full print out?

i.e. how do i see the "13 more"

Exception:
        java.lang.reflect.InvocationTargetException
        (rethrown as com.comsol.util.exceptions.FlException)
Messages:
        Error running java class
        - Detail: Error_running_java_class

Stack trace:
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.comsol.util.application.CsBaseApplication.runExternalClassStat(Unknown Source)
        at com.comsol.util.application.CsBaseApplication.runExternalClass(Unknown Source)
        at com.comsol.util.compile.a$a.a(Unknown Source)
        at com.comsol.util.compile.a$a.call(Unknown Source)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IndexOutOfBoundsException: Index: 4, Size: 4
        at java.util.ArrayList.RangeCheck(Unknown Source)
        at java.util.ArrayList.get(Unknown Source)
        at Enviornment.makeNextGen(Enviornment.java:269)
        at Enviornment.main(Enviornment.java:44)

        ... 13 more
Cœur
  • 37,241
  • 25
  • 195
  • 267
randomafk
  • 783
  • 1
  • 8
  • 13

2 Answers2

3

This stack trace contains everything you need to know and is not related to console output. It just skips repeating lines.


Update.

Suppose your method call a() calls b() and b() catches exception thrown from some other method foobar(), wraps it in another exception and rethrows it. Here is how stack traces will look:

void b() {
   try {
     foobar();
   } catch(Exception e) {
     // Stack trace for e:
     // foobar()
     // b()
     // a()
     throw new RuntimeException("error",e); 
  }
}

void a() {
  try {
    b(); 
  } catch(Exception e) {
   // Stack trace for e
   // b()
   // a() 
   // Cause:
   // foobar()
   // b() - repeating line
   // a() - repeating line
   e.printStackTrace();
  } 
}

So code that prints exception just skips repeating lines as they carry no additional value. In your question there is InvocationTargetException being thrown in place of RuntimeException in my example. InvocationTargetException is exception typically used by reflection.

Alex Gitelman
  • 24,429
  • 7
  • 52
  • 49
1

See http://www.docjar.com/html/api/java/lang/Throwable.java.html#671 for the code that generates the 13 more in your case.

It counts the stack trace elements that this exception has in common with the previously printed exception. So you know that you have to add the last 13 lines (which in this case means all) from the exception above to the truncated trace.

Roland Illig
  • 40,703
  • 10
  • 88
  • 121