Starting JBoss from inside IDEA

From Shrubbery

Jump to: navigation, search


Starting up JBoss 4.x from IDEA 6.0.1


Out of the box, there will be two problems that will prevent IDEA 6.0.1 from being able to start JBoss 4.x properly:

  1. You can't make a runtime configuration that works: In the runtime configuration editor -
    Run Configuration Error: JNDI port configuration not found
  2. JBoss won't start up: In the console -
    Error: no `server' JVM at `C:\Program Files\Java\jre1.5.0_09\bin\server\jvm.dll'

This is what it looks like when it's broken:

Broken config

IDEA needs to know the JNDI port for the JBoss instance it's going to manage and the location of this port in the configuration files has changed recently.   This should be fixed in IDEA 6.0.2 (according to [href="http://intellij.net/forums/message.jspa?messageID=5170511 this page</a></span>), but until then there is an easy modification to the configuration files that will allow it to work:

  1. Move server/default/deploy/naming.sar/META-INF/jboss-service.xml to server/default/deploy/naming-service.xml.
  2. Delete the directory server/default/deploy/naming.sar.
  3. Start the default configuration of JBoss using the run script (outside IDEA) to make sure you got it right.
  4. See that the little red 'x' in the JBoss runtime configuration is gone and the "Run Configuration Error: JNDI port configuration not found" message has cleared.

This is what it looks like when it's fixed:

Working config


The standard JBoss 'run' script also needs JAVA_HOME, so you will have to set it somehow.  There are a few ways this can be done:

  1. Set JAVA_HOME in the runtime configuration in the Startup/Connection tab.
  2. Make your own startup script and set JAVA_HOME in it before launching the JBoss 'run' script.
  3. Set JAVA_HOME globally outside of IDEA.   I'm not a big fan of this one, as this leads to 'works on my machine' situations.

For example:

JAVA_HOME config

After setting this, JBoss should start.   You are now ready to deploy some code from inside IDEA!

Personal tools