Sunday, February 27, 2011

Why can't I start JBoss on my Linux machine

So, I've been fiddling about JBoss recently with the intention of doing things with EJBs. To do so, I installed the JBoss 6 application server on Windows 7 and Linux (Ubuntu). JBoss starts fine on both environments via the standalone
$JBOSS_HOME/bin/run.sh
script. I think I had to set the JBOSS_HOME variable on Windows, on Ubuntu, either JBoss knows to look in /usr/local/jboss (where I installed it) or it doesn't care about the JBOSS_HOME variable.


What I am having a problem with is the inability to start JBoss from Eclipse on my Linux environment. For whatever reason, JBoss 6 is not one of the server options in Eclipse, so I used JBoss 5 instead. Doing this sorted out the startup and shutdown of JBoss from Eclipse on my Windows environment. No such luck on the Linux one.

It kept trying to start up and I get this error:


In the Console, the only error I see is this:

02:49:50,294 ERROR [AbstractKernelController] Error installing to Instantiated: name=PostEjbJarMetadataDeployer state=Described: java.lang.NoSuchMethodError: javax.annotation.Resource.lookup()Ljava/lang/String;
    at org.jboss.metadata.annotation.creator.AbstractResourceProcessor.createResourceEnvRef(AbstractResourceProcessor.java:394) [:2.0.0.Alpha24]
    at org.jboss.metadata.annotation.creator.AbstractResourceProcessor.process(AbstractResourceProcessor.java:237) [:2.0.0.Alpha24]
    at org.jboss.metadata.annotation.creator.AbstractResourceProcessor.process(AbstractResourceProcessor.java:163) [:2.0.0.Alpha24]



I tried changing the timeout for startup (double click on the JBoss Server in the Servers tab > Timeout > Start (in seconds) to 120) and that seemed to have done the trick. If you run into this, give that a try. It boggles my mind that JBoss takes longer than 50 seconds to start!