I&C School of Computer and Communication Sciences
Ecole Polytechnique Fédérale de Lausanne    
   

Content of this page

Loading the Package
Enabling the Hypersonic database
Enabling the mySQL database
Starting the JBoss server

Loading the Package

Load the JBoss server from the JBoss downloads (JBoss Application Server, version 5.1.0.GA).

JBoss uses either the jre (Java runtime library) or JDK. If you use JSPs, you need the JDK. Set the JAVA_HOME variable to the location that contains bin/javac.exe. This reference is used by JBoss to compile the JSP (and the Struts) pages.

Enabling the Hypersonic database

The JBoss package contains the Hypersonic database, but by default it is configured as in-process and cannot be accessed over TCP. In order to enable TCP mode, you must modify the file jboss/server/default/deploy/hsqldb-ds.xml, namely moving the commands that enable the database out of the comments, reproducing the following blocks.

The easiest way to edit this file is to select the File > New > Folder > Advanced >> and to set a link to the JBoss folder. It is then easy to get to the file and to edit it within Eclipse.

Enable and modify the following three xml blocks and disable the in-process ones, marked as comment and italic in the following lines -> hsqldb-ds.xml (JBoss 5.x) - hsqldb-ds.xml (JBoss 4.x)

  <!-- For server mode db, allowing other processes to use hsqldb over tcp.
This requires the org.jboss.jdbc.HypersonicDatabase mbean.
-->
<connection-url>jdbc:hsqldb:hsql://${jboss.bind.address}:1701</connection-url>
<!-- For in-process persistent db, saved when jboss stops.
The org.jboss.jdbc.HypersonicDatabase mbean is required for proper db shutdown

<connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB</connection-url>
-->
...
<!-- When using in-process (standalone) mode
<depends>jboss:service=Hypersonic,database=localDB</depends>
-->

<!-- Uncomment when using hsqldb in server mode -->
<depends>jboss:service=Hypersonic</depends> ...
<!-- Uncomment if you want hsqldb accessed over tcp (server mode)-->
<mbean code="org.jboss.jdbc.HypersonicDatabase" name="jboss:service=Hypersonic">
<attribute name="Port">1701</attribute>
<attribute name="BindAddress">${jboss.bind.address}</attribute>
<attribute name="Silent">true</attribute>
<attribute name="Database">default</attribute>
<attribute name="Trace">false</attribute>
<attribute name="No_system_exit">true</attribute>
<!--attribute name="Port"><value-factory bean="ServiceBindingManager" method="getIntBinding" parameter="jboss:service=Hypersonic"/></attribute>
<attribute name="BindAddress"><value-factory bean="ServiceBindingManager" method="getStringBinding" parameter="jboss:service=Hypersonic"/></attribute-->

</mbean>
</mbean>
<!-- For hsqldb accessed from jboss only, in-process (standalone) mode
<mbean code="org.jboss.jdbc.HypersonicDatabase" name="jboss:service=Hypersonic,database=localDB">
<attribute name="Database">localDB</attribute>
<attribute name="InProcessMode">true</attribute>
</mbean>
-->

Enabling the mySQL database

My thanks to Jacques Pasquier from Uni Fribourg for this paragraph (Only tested on JBoss 4.x).

MySQL must be loaded from the site http://dev.mysql.com. In the following, we assume that the database mysql is used as it is installed and thus without any password requirement.

A password could be introduced by duplicating the line above that contains username and changing username by password.

Starting the JBoss server

Set variable JAVA_HOME to point to the JSDK directory (for example):
   set JAVA_HOME to c:\j2sdk1.4.2 in the environment variables    // for Windows 

   setenv JAVA_HOME /usr/JAVA                                     // or for Linux

Notes for Eclipse:
In order to start the server from Eclipse, click Window > Show view > other... > Server > Servers
Right-click in the new window > New > Server. Enter the hostname, the kind of server you are using and its folder in Installed Runtime.
You can then click on the server in the Servers view and examine the full start command in Open launch configuration or some details in Edit

Starting from
a terminal window
:
The server can also be started by setting the current directory to jboss/bin and typing either run.sh -c default (for UNIX) or run -c default (for Windows).
The server is stopped by typing CTRL-C in the start window or shutdown -S in another terminal window.

Notes for Windows:
In order to start JBoss in the specific server environment default, enter run -c default. This environment is referenced in the @@deploypath WebLang statement in the examples or in the parameters reachable from Window > Preferences... > Code Generator.
It is comfortable to create a shortcut from the run.bat located in the bin directory and to click it to start JBoss.

 

Laboratoire de téléinformatique
C. Petitpierre