How to run JBoss 5.1 within Netbeans 6.5 and Netbeans 6.7

  1. Download JBoss 5.x and extract it to C: (Don't put it inside 'Program Files')
  2. In the Services tab, select Servers..Add Server and select JBoss


  3. Leave everything at the default setting
  4. JBoss should be registered with netbeans
  5. Right click on JBoss and click start server
  6. If there were no issues, JBoss will start within Netbeans BUT it is never that simple is it? :)
Ok so here are some of the issues I encountered and how I went about solving them.
  1. First make sure your JBOSS_HOME environment variable is pointing to the correct path. I upgraded from JBoss 4.05 and had to update this. Check your PATH variable as well
  2. On trying to register JBoss with Netbeans I kept getting this error:
    ALL [null]: Cannot rename file J2EE/InstalledServers/.nbattrs~ in C:\Documents and Settings\g\.netbeans\6.7\config to J2EE/InstalledServers/.nbattrs
    This is basically netbeans trying to create a file called .nbattrs but not being able to do so. In XP a file name cannot begin with a dot. Go ahead try it! But Netbeans tries to create one. Slopppy implementation by Netbeans (or Netbeans engineers are not big windows fans!). Here's what I did. Went to DOS (cmd) and renamed it. Yeah Microsoft, consistency is not thy forte! (No pun intended - Netbeans used to be called Forte)
  3. Close Netbeans and start is again. You should be able to see JBoss listed under servers
  4. When I tried to start Netbeans, the first error I got was:
    Port already in use: 8080
  5. To fix this, I went to C:\jboss-5.1.0.GA\server\default\deploy\jbossweb.sar\server.xml and changed the port from 8080 to 7075 (select any unused port).
  6. Once that was fixed the next error on a restart was:
    java.rmi.server.ExportException: Port already in use: 1098; nested exception is: java.net.BindException: Address already in use: JVM_Bind

  7. To fix this, I edited C:\jboss-5.1.0.GA\server\default\conf\bindingservice.beans\META-INF\bindings-jboss-beans.xml and updated 1098 to 11098
  8. In the same xml file I updated Remote classloading service port as well as this too was giving a port already in use error
  9. Now a restart of JBoss was successful!

You are welcome!

0 comments:

Post a Comment