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
2

2 Answers 2

4

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.

Sign up to request clarification or add additional context in comments.

3 Comments

What about the "caused by" section?
This is underlying exception that was thrown in reflection call. It's returned as cause in InvocationTargetException
So the "13 more" would simply be repeats of what was already printed before?
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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.