Problems with IntelliJ 12 and OSX ? - JPLISAgent.c


I've posted a support question, but I thought I'd also ask here.

To make a long story short, I can't use IntelliJ 12 on OSX for Grails development.  Upon loading a bare/new Grails 2.2 project that was created on the command line, I receive the following error:

/Library/Java/JavaVirtualMachines/jdk1.7.0_10.jdk/Contents/Home/bin/java -Dgrails.home=/Users/michaelmorett/grails-2.2.0 -Dbase.dir=/Users/michaelmorett/work/test-grails-2-2 -Dtools.jar=/Library/Java/JavaVirtualMachines/jdk1.7.0_10.jdk/Contents/Home/lib/tools.jar -Dgroovy.starter.conf=/Users/michaelmorett/grails-2.2.0/conf/groovy-starter.conf -Xmx768M -Xms768M -XX:MaxPermSize=256m -XX:PermSize=256m "-javaagent:/Applications/IntelliJ IDEA" -Dprint.grails.settings=true -Dfile.encoding=UTF-8 -classpath /Users/michaelmorett/grails-2.2.0/lib/org.codehaus.groovy/groovy-all/jars/groovy-all-2.0.5.jar:/Users/michaelmorett/grails-2.2.0/dist/grails-bootstrap-2.2.0.jar --main org.codehaus.groovy.grails.cli.GrailsScriptRunner --conf /Users/michaelmorett/grails-2.2.0/conf/groovy-starter.conf help
Exception: java.lang.StackOverflowError thrown from the UncaughtExceptionHandler in thread "main"
*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at ../../../src/share/instrument/JPLISAgent.c line: 844

Exception: java.lang.StackOverflowError thrown from the UncaughtExceptionHandler in thread "Thread-0"


This is not new to IntelliJ 12.  I've been having that JPLISAgent.c error for years, since IntelliJ 10.  I saw it on Snow Leopard, then Lion, now Mountain Lion.  I saw it on Grails 2.0, then 2.1, now 2.2.

I'm fine with IntelliJ 12 on Windows 7 (it works beautifully), but I'm trying to move to OSX.  This single problem is keeping me from doing so.  The only alternative I can think of is to put a Windows 7 VM inside OSX.

Complicating matters (maybe) is the fact that I can't seem to "control" the JVMs in use.  I have JDK7 installed, but when I removed all JDK6 JVMs, IntelliJ itself could not even start and asked me to install Java 6 SE.  I resisted and fought that for hours trying to troubleshoot, but in the end, I gave up and let IntelliJ install the JDK6 (JRE6?).

Complicating matters even more (maybe), is that there are various places JVMs like to live.  One is /System/Library.  The other is /Library.  Another is /usr/libexec/java_home (?).  Maybe there are other spots.  Then there are symlinks from /usr/bin pointing into one of these (/System/Library).

Then there are plists (which IntelliJ 12 stopped using?).  And then there is launchd.

Yes, I am confused.  All I want for Christmas is to be able to start IntelliJ 12, on Mountain Lion, and work with a Grails 2.2 project.  I am going in circles with this Java spaghetti on OSX.

Any help is appreciated.   Thanks....


Comment actions Permalink

I wanted to report back on this issue in case others face this.  It's solved, but the solution is brutal.

Basically, I used the nuclear option:  I wiped the HD and reinstalled OSX (Mountain Lion) from scratch.  Fortunately, this laptop was fairly expendable as a test machine so that was an option for me.

Once wiped and with a virgin Mountain Lion install, I did the following:

1.  Download IntelliJ 12.0.1.

2.  Installed IntelliJ.

3. Tried to run IntelliJ, at which point it noted that I did not have a JDK installed and asked would I like to download/install one?  I said yes.  It goes on to install a JDK 6.

4.  Downloaded Grails 2.2.

5.  Extracted Grails to my home directory

6.  With IntelliJ up and running, I created a new Grails project *from IntelliJ* (i.e. not using a Grails command line from Terminal).

7.  During project creation wizard, at some point, IntelliJ will mention I don't have a JDK.  I point it to the JDK 6 installed as part of step 3 above.

8.  IntelliJ creates the Grails project and the error mentioned earlier is never shown.  Basically, problem solved.

But I had to use brute force to solve it.  Not having enough OSX time under my belt, my troubleshooting just wasn't working.  As I suspected, the problem was entirely JDK related.  That was the one difference.  Somehow, during my first few weeks with OSX a few years ago, I installed a JDK or two in such a way that I created a mess.  Disappointingly, I could not just start fresh by wiping out only the JDKs.  I tried that and it didn't work (or I didn't do that correctly). Maybe I tweaked a symlink somewhere, or installed it in a non-standard place. I just don't know or remember.

Since there's only 3 pieces to the puzzle (IntelliJ, Grails and a JDK), I opted to wipe the HD and truly start from scratch.  Had I not achieved success so quick, I would have downgraded IntelliJ and/or Grails in a methodical manner until something worked.  Some combination *had* to work....I had just finished watching a Youtube video and saw someone using IntelliJ and Grails on OSX.  Surely this was possible.

It is.  Just tread carefully with the JDK.  Or be very experienced with OSX, which I was not.

Hope this helps someone one day.


Comment actions Permalink


I ran into a very similar problem.  When launching IntelliJ from the dock I couldn't run any Grails commands, it simply hangs when trying to execute "create-app", when I imported a project that I created from the command line it would get the same error around the JPLISAgent.c which was driving me nuts.  Not a lot of people had this problem and I think I know why.

The problem had to do with a file that I had created, the /etc/launchd.conf for setting the global path (which I'm assuming isn't the correct thing to do).  Once I had removed that file my IntelliJ started working again.
One quick way to see if this will solve the problem for you or anyone else is to execut the "open -a /Applications/IntelliJ ProjectHere/" instead of opening IntelliJ from your launch dock.

Anyway, hope this solves someones headaches.



Please sign in to leave a comment.