Wednesday, January 07, 2009

NetBeans 6.5 and JBoss 5

The current release of NetBeans 6.5 doesn't support(yet) the newly released JBoss 5. Although the bug has already been reported in the dev team and the fix is on the development trunk (and the soon to be released patch2 pack for NetBeans 6.5), for those of you who don't want to install a daily build, you can do the following: (Thanks to Adrigan from the JBoss forum for giving us the tip!)

1. Append the following in the file "/home/YOURUSERNAME/.netbeans/6.5/config/J2EE/InstalledServers/.nbattrs".


<fileobject name="instance_X">
<attr name="deploy-dir" stringvalue="/opt/jboss-5.0.0.GA/server/default/deploy"/>
<attr name="displayName" stringvalue="JBoss Application Server 5.0.0.GA"/>
<attr name="host" stringvalue="localhost"/>
<attr name="password" stringvalue=""/>
<attr name="port" stringvalue="8080"/>
<attr name="registeredWithoutUI" stringvalue="false"/>
<attr name="root-dir" stringvalue="/opt/jboss-5.0.0.GA"/>
<attr name="server" stringvalue="default"/>
<attr name="server-dir" stringvalue="/opt/jboss-5.0.0.GA/server/default"/>
<attr name="url" stringvalue="jboss-deployer:localhost:8080#default&amp;/opt/jboss-5.0.0.GA"/>
<attr name="username" stringvalue=""/>
</fileobject>

Replace the appropriate entries with your environment, that is the deploy-dir to the path where you have installed the JBoss server, and so on.

2. In the same folder you will find files with names starting with instance_[1,2...]. Choose the maximum and create a new empty file. In my case the file will be instance_3 (touch instance_3). After that replace the "instance_X" from the previous XML with that name.

One advice though, be carefully with the editing of the XML, because a small XML error(forgotten / at the end!), will result of your existing server list to be wiped out by NetBeans. Make a backup of the file prior editing!

That's all, save, restart NetBeans and enjoy!

2 comments:

javapapo said...

nice one! thanks mate!

Anonymous said...

I got a "| was unexpected at this time".
Then I uncheck "Use IDE Proxy Settings" and it works.