Running JBoss AS 7 as a Windows service

Java EE, JBoss, Web
This tutorial shows you how to run a JBoss AS 7 server as a Windows Service. First of all, grab the appropriate native connectors from http://www.jboss.org/jbossweb/downloads/jboss-native-2-0-10 (x86 for 32bit host, x64 for 64bit). If you are not sure, use the 32bit version since they will work on 64bit systems also but the reverse is not true. Unzip the archive in the JBoss main folder. Then make some modifications to the service.bat file Rename the SVCNAME, SVCDISP and SVCDESC to something more meaningful. This is optional but if you plan to install multiple servers (e.g. test and production, you want different names. Modify the JAVA_OPTS to increase memory, service.bat doesn't read any other conf.bat file so it will use default memory settings and will die of memory loss for a mid-sized…
Read More

How to make a JBoss AS/EAP accessible from remote locations.

Java EE, JBoss, Web
This tutorial shows how to make a JBoss AS/EAP accessible from remote locations. Per default, a newly installed JBoss AS or EAP is only accessible from the machine it is installed on. This is done to prevent access to the Application Server before security settings are applied. Once the server is properly configured, you need to make the following changes in order to access the server from a remote address: Go to the Application Server Management page on http://127.0.0.1:9990 on the machine the server is running on (or the machine ip address if remote management is enabled) Login with the administrator account Select the "Profile" View Go to section "General Configuration > Interfaces" Select Interface "public" Change the Inet Address to "${jboss.bind.address:0.0.0.0}" Press save Restart the server. The server log…
Read More

How to install a database driver on JBoss EAP 6 or JBoss AS 7

Java EE, JBoss, Web
This tutorial describes how to install a database driver on a JBoss EAP 6 or JBoss AS 7 Application Server. 1. Installation In this document {JBOSS_HOME} refers to the root folder of the JBoss Application Server installation. First create a module Go to {JBOSS_HOME}\modules. Create following directory structure. JBOSS_HOME}\modules\com\oracle\ojdbc6\main (the "main" as last folder is crucial!) In that folder put the oracle jdbc jar. For example ojdbc6-11.2.0.3.jar. In the same folder create a file module.xml Add this content to the file: [crayon-5bf28eb629af8543899262/] - The name in line 2) "com.oracle.ojdbc6" must match the directory structure created in step 2. (omit the "main" part). - In line 4) the resource-root path must point to the jar file in the main folder. 2. Next install the database driver module     If JBoss…
Read More

Configurable data-source references in persistence.xml with JBoss properties

Java EE, JBoss, Web
This tutorial shows you how to make the data-source references in your persistence.xml configurable. Why should I do this? Hard-coding your data-sources in your persistence.xml is not always the best option. You may need to deploy your application on a server which has a data-source with the specific name configured to a different database. Or you might want to deploy several instances of the same application on the same server. That is why it can be useful to make your data-source references configurable. 1. Edit your persistence.xml Initially your persistence.xml may look like this [crayon-5bf28eb629e93542218119/] Where jdbc/MyDataSource maps to a configured data-source on the JBoss Application server. Now change this jdbc/MyDataSource in java:comp/env/jdbc/MyDataSource. [crayon-5bf28eb629e99755013295/] 2. Add resource references to your web.xml The WEB-INF/web.xml file becomes the link between the reference…
Read More