scala/collection/mutable/ArrayBuffer + IntelliJIDea ClassFormatException

17 views
Skip to first unread message

Edmondo Porcu

unread,
Oct 12, 2011, 3:29:49 AM10/12/11
to scala-user
Dear All,

I am trying to launch a scala executable from Intellij Idea 10.5.2. Normally Idea wraps the execution around its CommandLineWrapper, but since I want to do some profiling I have removed the dynamic classpath option from the ide.

Now, when I launch my program I obtain the following exception

Exception in thread "main" java.lang.ClassFormatError: Invalid index 3 in LocalVariableTable in class file scala/collection/mutable/ArrayBuffer
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)


Do you have any idea on what does it mean and how to solve it?
Thank you for your unvaluable help.

Best Regards

Jason Zaugg

unread,
Oct 12, 2011, 3:34:29 AM10/12/11
to Edmondo Porcu, scala-user
You should be able to see the command line, including a references to the scala-library.jar. Run this directly from the command line to reproduce the problem independently from the IDE. Be explicity about which 'java' executable you are using. Then you should post a transcript of that session, showing the command line and the error together.

-jason




Edmondo Porcu

unread,
Oct 12, 2011, 3:39:34 AM10/12/11
to Jason Zaugg, scala-user
I got it guys...it is because of javaagent

-javaagent:D:\JRat\shiftone-jrat-1-beta1\shiftone-jrat.jar

which I attached for profiling....

Now the question changed: can you suggest a method of profiling a scala app ?:)) With VisualVM, for example, is there a way to start a java/scala app and attach it from the beginning? Or you can just attach to a running instance?

Best Regards




2011/10/12 Jason Zaugg <jza...@gmail.com>

Jason Zaugg

unread,
Oct 12, 2011, 3:48:05 AM10/12/11
to Edmondo Porcu, scala-user
On Wed, Oct 12, 2011 at 9:39 AM, Edmondo Porcu <edmond...@gmail.com> wrote:
I got it guys...it is because of javaagent

-javaagent:D:\JRat\shiftone-jrat-1-beta1\shiftone-jrat.jar

which I attached for profiling....

Now the question changed: can you suggest a method of profiling a scala app ?:)) With VisualVM, for example, is there a way to start a java/scala app and attach it from the beginning? Or you can just attach to a running instance?

I use and recommend YourKit [1]. It can connect to a running application that is started with the correct command line; or more conveniently, it integrates into IntelliJ so you can execute 'Profile' in addition to 'Run' and 'Debug'.

-jason

Reply all
Reply to author
Forward
0 new messages