Starting JBoss from inside IDEA
From Shrubbery
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:
- You can't make a runtime configuration that works: In the runtime configuration editor -
Run Configuration Error: JNDI port configuration not found - 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:
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:
- Move
server/default/deploy/naming.sar/META-INF/jboss-service.xmltoserver/default/deploy/naming-service.xml. - Delete the directory
server/default/deploy/naming.sar. - Start the default configuration of JBoss using the run script (outside IDEA) to make sure you got it right.
- 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:
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:
- Set JAVA_HOME in the runtime configuration in the Startup/Connection tab.
- Make your own startup script and set JAVA_HOME in it before launching the JBoss 'run' script.
- 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:
After setting this, JBoss should start. You are now ready to
deploy some code from inside IDEA!

