How to Deploy JBoss Application Server on NetBeans

First of all, you need to download the JBoss Application Server from JBoss Downloads Website: http://www.jboss.org/jbossas/downloads/. Unzip the .zip file into a location on your hard drive. For instance, c:\jboss-4.0.4.GA\. Now do the following:
  • Open NetBeans and go to Services on the left Pane of the IDE.
  • Right click on drivers, and select 'New Driver'.
  • A window titled 'New JDBC Driver' will appear, Click on 'Add' Button.
  • Browse to ...\jboss-4.0.4.GA\server\default\lib and select 'hsqldb.jar'.
  • The Driver class should be "org.hsqldb.jdbcDriver" and choose a name for the Driver.
Before making a connection to the Database, you have to make some configurations:

Environment Variables:
  • Create a variable named "JBOSS_HOME" and set the value pointing to the JBoss Installation Directory, i.e. ..\jboss-4.0.4.GA
  • Add or append "...\jboss-4.0.4.GA\server\default\lib\hsqldb.jar" to the CLASSPATH variable.
These environment variable reduce the effort of modifying the XML configuration file of the JBoss Server. Now, get back to NetBeans again, go to the Databases->Drivers and right click on the driver you created and select connect using:
  • A window titled "New Database Connection" should appear.
  • Enter "sa" as username and "" empty password. These are the default username/password for JBoss Server.
  • To get the JDBC URL, open the XML file, "...\jboss-4.0.4.GA\server\default\deploy\hsqldb-ds.xml".
  • Look for the tag:
    <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDBconnection-url>
  • The parameter "jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB" is the JDBC URL, copy it and paste into the "New Database Connection" window in NetBeans.
The reason for setting the JBOSS_HOME variable is that you can easily access the JBoss classes by referring them like given above. After you've entered the username, password and JDBC URL, press OK, and the DataBase should be connected and should show up in the Tree Heirarchy of Databases in NetBeans. It should be something like:
"jdbc:hsqldb:... /jboss-4.0.4.GA/server/default/data/hypersonic/localDB[sa on Public]".

I hope, it helps.

Comments

Popular posts from this blog

Type casting problem while unmarshalling XML objects using JAXB

Second Interview at Seattle, Microsoft HQ (Part I)

My J2EE/Component Based Software Design Projects