Applicable Plans: Standard Max VPS, All Advanced VPS, All Premier VPS (not Plesk or cPanel)
User Guide – JBoss Installation and Tuning
JBoss Application Server is a full featured, royalty free, Open Source, Sun certified J2EE application server. For more information on the providers of this software, please visit http://www.jboss.org.
The JBoss server package that is available to you in your eApps VPS service includes the embedded Tomcat application server, which is used to serve JSP pages and Java servlets. For more information on this open source, royalty free software please see The Apache Software Foundation's web site at http://jakarta.apache.org/tomcat/index.html.The eApps Hosting service is designed to make it easy to use JBoss for serving J2EE applications in your Virtual Private Server (VPS). This User Guide is not intended as a reference source for JBoss. See the Links to other information at the end of this document if you need detailed information about JBoss.The purpose of this User Guide is to explain how to install JBoss in your VPS on the eApps Hosting service, and perform basic tuning if necessary. An overview of how to upload your JBoss application to your VPS is also offered. Instructions on how to deploy your JBoss applications using the three supported approaches are found in their respective User Guides:
Please refer to the User Guide that references your deployment method of choice. The vast majority of eApps customers will need to use the Deployment with mod_jk and mod_proxy_ajp User Guide. The Deployment in Standalone Mode(without Apache) approach is generally only used when deploying an application that specifically needs that approach as a requirement. If you follow the guidelines explained in this User Guide you will remain safely inside the eApps Support envelope. If you choose to use a custom configuration that is outside of the guidelines contained in this document, you may be subject to service fees if you need assistance from the eApps Support department. JBoss is not available in the Standard and Standard Plus plans due to memory requirements. The Standard Max plan does have enough memory to run JBoss and serves as our entry level plan for JBoss users. However, it is important that you select a plan that has enough memory for your application during peak usage. If you do not need the advanced features of JBoss, and just need support for JSP and Servlets, we recommend that you uninstall JBoss and install Tomcat instead, as Tomcat uses less resources and is not as complex as JBoss to configure and use. JBoss is a very complex and powerful application that is intended for advanced users who are deploying enterprise grade applications. Before deploying your applications with JBoss, make sure that you really need all the complexity that JBoss provides.
Prerequisites
How to Use JBoss
How to upload your JBoss applications
Three approaches for deploying JBoss applications
Tuning JBoss
Common Issues and Solutions
Links to other information
Prerequisites
JBoss requires that JBoss and Java are installed. Depending on how you are going to deploy your JBoss application, you may also need to install the mod_jk module for Apache.
JBoss
To use JBoss you will have to install JBoss from the Control Panel. Only one version of JBoss is allowed, meaning that you can not install both JBoss4 and JBoss5 in your VPS. Unless your existing code base requires a specific version of JBoss, it is recommended that you install the latest version of JBoss available in your VPS.To install JBoss, follow these steps:Login to your Control Panel, and click on the System Tab. If necessary, click the Select Another System (Subscription) link on the left and choose the correct Virtuozzo container.Go to Applications, and click on the Add Application link. Select the box next to the version of JBoss that you wish to install, and then scroll down and click the Next button. This takes you back to the All Applications screen. Wait for five minutes, then click on the Refresh link at the upper right, just under the word Parallels. The application should now show as installed. If it is still in a Scheduled state, wait another five minutes, and click Refresh again. If you see it in Error state, or it still shows as Scheduled, please contact eApps Technical Support.
Java
Please install the newest version of Java available to you unless your existing code base requires an older version.To install Java, follow these steps:Login to your Control Panel, and click on the System Tab. If necessary, click the Select Another System (Subscription) link on the left and choose the correct Virtuozzo container. Go to Applications, and click on the Add Application link. Select the box next to the version of the Java libraries you wish to install, and then scroll down and click the Next button. Newer plans will have either Java-SE-5 or Java-SE-6, older plans will have J2SE or Java6.This takes you back to the All Applications screen. Wait for five minutes, then click on the Refresh link at the upper right, just under the word Parallels. The application should now show as installed. If it is still in a Scheduled state, wait another five minutes, and click Refresh again. If you see it in Error state, or it still shows as Scheduled, please contact eApps Technical Support.
mod_jk
mod_jk is an Apache module that serves as a front end to JBoss. mod_jk allows you to pass requests for JBoss through Apache on port 80.To install mod_jk, follow these steps:Login to your Control Panel, and click on the System Tab. If necessary, click the Select Another System (Subscription) link on the left and choose the correct Virtuozzo container.Go to Applications, and click on the Add Application link. Select the box next to mod_jk, and then scroll down and click the Next button.This takes you back to the All Applications screen. Wait for five minutes, then click on the Refresh link at the upper right, just under the word Parallels. The application should now show as installed. If it is still in a Scheduled state, wait another five minutes, and click Refresh again. If you see it in Error state, or it still shows as Scheduled, please contact eApps Technical Support.
mod_proxy_ajp
mod_proxy_ajp is only available on CentOS 5 plans. Because it is an Apache module, it is added as part of the Apache application when JBoss is installed.
How to Use JBoss
NOTE – in this User Guide, the X in JBossX or jbossX refers to the version of JBoss you have installed. The domain of http://example.com is used as the default place holder domain to show how the URL or code example should look. You are expected to replace JBossX and jbossX and example.com with the correct version and domain for your specific setup.
Understanding JBoss configuration files and directories
There are four main configuration files for JBoss. To edit these files, you will need root access to the VPS. You will also need to use a plain text editor, such as Notepad or vi. Do not use an application such as Word or Wordpad, because those applications insert control characters into the text that can cause problems with the JBoss service starting. For information on how to access/download these files, see the SFTP and SSH User Guides. NOTE – eApps uses the Java Service Wrapper to run JBoss as a Linux daemon. This means that configurations that would normally go in the run.sh file go in the /etc/jbossX/jboss.conf file instead. If you put your configurations in run.sh, they will not be used by the JBoss server. More information about the Java Service Wrapper, including links to the documentation, can be found here - http://wrapper.tanukisoftware.org/doc/english/introduction.html
JBoss Configuration Files
The files server.xml, users.properties and roles.properties are located in the /opt/jbossX directory. The jboss.conf file is located in the /etc/jbossX directory.The standard deploy directory is located at /opt/jbossX/server/default/deploy
- server.xml - This is the primary file used to configure the JBoss server. This file is located in /opt/jbossX/server/default/deploy/jboss-web.deployer for JBoss 4.2.x users.
- users.properties - Located in /opt/jbossX/server/default/conf/props/, this file is where the user name and the password for the web-console and jmx-console are set.
- roles.properties - located in /opt/jbossX/server/default/conf/props/, this file the user roles for the web-console and jmx-console are set.
- jboss.conf - located in directory /etc/jbossX, this is the configuration file for the Java Service Wrapper. eApps uses the Java Service Wrapper to run JBoss as a Linux Daemon/Service. This configuration file is used to set your parameters for JBoss and Java instead of run.sh.
How JBoss handles requests
JBoss uses a Host and a Context to determine what application to serve. Upon installation, there is one Host already created, called 'localhost', which is also set as the default host. Since having a default host is mandatory, do not edit or remove the localhost entry. Instead, create new hosts for your applications as needed.Please note that to JBoss, http://example.com and http://www.example.com are seen as two completely different Host names, and each can serve completely different content. If you want your application to listen on both Hosts, you have to set one as the actual Host, and the other as an Alias in the same Host block. This will be covered in the Deployment examples. When JBoss receives a request, it first looks to see if there is a Host configured that matches the domain name in the URL that was requested. It then looks inside each Host to see if there is an Alias that matches the domain name in the URL. If JBoss doesn't find a matching Host block or a matching Alias inside a Host block, then it will serve the default Host block, which is localhost.
After JBoss identifies the correct Host, it then looks at the rest of the URL to get the path of the application and tries to match that with a Context inside the jboss-web.xml file of one of the applications that are deployed.
Starting and stopping JBoss
JBoss can be stopped or started from either the Command line or the Control Panel.Command lineJBoss can be stopped, started or restarted from the command line. All these commands have to be run as the root user.
[root@example]# service jbossX stop [root@example]# service jbossX start [root@example]# service jbossX restart [root@example]# service jbossX status |
(the last command will show the current status of the JBoss server)Control PanelLogin to your Control Panel, and click on the System Tab. If necessary, click the Select Another System (Subscription) link on the left and choose the correct Virtuozzo container.Go to Applications, and either click on the All Applications link and then the JBoss link, or click directly on the application link for JBoss (if available). There will be a radio button to either Stop or Start the JBoss server, depending on its current status.JBoss can also be stopped or started from the Services link on the System Tab. Click on the link for JBoss, and there will be a radio button to Stop or Start the JBoss server, depending on its current status.
Server Configurations
Starting with JBoss 4.2.x, the instance of JBoss provided by eApps supports 3 server configurations. The configuration that is used depends on the -c option that is passed to the startup script. Each configuration is in /opt/Jboss4/server/[config-name]. The configuration you use will determine the default services JBoss will make available to your application.
- Minimal Configuration (/opt/jbossX/minimal): The configuration starts the core server without any enterprise services.
- Default Configuration (/opt/jbossX/default): This is the most common configuration use. It provides support for J2EE 1.4 and most common Java EE 5.0 API's such as EJB3 and JSF.
- All Configuration (/opt/jbossX/all): The configuration provides clustering support and extensions.
While all three configurations are available to you, eApps only provides support for the Default Configuration. If you are interesting in using either the Minimal or All server configurations, you will need to read and fully understand the JBoss documentation for those configurations. The Help section with links to the official JBoss documentation can be found here – http://www.jboss.org/help
How to use the JBoss jmx-console and web-console
Using the JBoss Jmx-ConsoleAfter JBoss has been installed you can access the Jmx-console at http://example.com://8080/jmx-console. The default user name and password is admin/example.com (the VPS host name at the time JBoss was installed.) The JMX console provides a raw view into the microkernel of the JBoss application server. It lists all registered services (MBeans) that are active in the application server and that can be accessed either through the JMX console itself or programmatically from Java code.Using The JBoss web-consoleAfter JBoss has been installed you can access the web-console at http://example.com:8080/web-console. The default user name and password is admin/example.com (the VPS host name at the time JBoss was installed) The web console provides a tree like view of management statistics on several things such as servlets, ejb, user defined domains and Mbeans.Securing The jmx-console and web-consoleThe default user name and password for the jmx-console and the web-console are the same and are managed by the user.properties files. The file is located in /opt/jbossX/server/default/conf/props.To change the user name and password to something other than the default values, here is what to do. This assumes you are going to change the user name to eapps and the password to hosting.Note – the following must be done from the command line of the VPS while logged in via SSH as the root user. Do not edit these files from the Control Panel.
[root@example ~]# cd /opt/jbossX/server/default/conf/props [root@example props]# vi users.properties
|
Using a text editor (in this example the vi editor) edit users.properties and change this line:
admin=example.com (use your VPS hostname) |
to
and save and exit the file. Next change the roles.properties file in the same directory to set the new user with the correct role. Again, this assumes you are editing the file in the vi editor. Change this line:
to
and save and exit the file.
Restart JBoss for the changes to take effect. Multiple users can be added in the format above for access to jmx-console and web-console.
How to upload your JBoss applications
Uploading application files – an overview
To upload your JBoss application, place the files in the JBoss deployment directory, and then restart JBoss. You can upload your files using the File Manager in the System Tab of the Control Panel if they are under 5 MB in size, or you can use SFTP to upload the files to the correct directory. Once you have uploaded your files, make sure they have the correct owner and group for their location.
Using SFTP
SFTP allows you to upload files of any size to your deployment directories, and is much faster than using the Control Panel. If you are going to be frequently uploading/changing/working with your JBoss applications, SFTP is the best choice. For more information on SFTP, please see the SFTP User Guide.
Using the Control Panel
You can use the File Manager to upload your application to your deployment directory if your application is less than 5MB in size.
To use the File Manager, login to your Control Panel, and click on the System Tab. If necessary, click the Select Another System (Subscription) link on the left and choose the correct Virtuozzo container.
Then, click on File Manager. Using the File Manager, navigate to the directory you are using for your JBoss application files. Once you are in that directory, click on Upload File. In the Upload File screen, you can Browse for the file to be uploaded on your local computer, and also specify a New file name if necessary. You also can set the Permissions for the files, and the Ownership. Make sure you choose Permissions and Ownership that match the other files where you are uploading your applications. Once you have everything ready, click OK to upload your files.
Once you have uploaded your JBoss application files, restart JBoss as per the instructions in Starting and Stopping JBoss using either the Control Panel or the command line.Using the File Manager in the Control Panel is the slowest and most restrictive way to upload your files. If you are going to be frequently working with your JBoss application files, you will be better served by using SFTP to connect to your VPS and upload your files. For example, you cannot upload a file over 5 MB using the Control Panel, while there is no such restriction using SFTP. It is not uncommon for the WAR file for a complex JBoss application to be larger than 5 MB, which means that you will not be able to use the Control Panel to upload that file.
Three approaches for deploying JBoss applications
Overview of three approaches for deployment
Your eApps Virtual Private Server includes the Apache web server as part of the base environment. Apache is designed to serve static content, perl scripts, php scripts, and other types of content that requires a web server. JBoss is designed primarily to serve JBoss specific applications, J2EE applications, JSP pages and servlets.
One of the decisions you will need to make when deploying your JBoss application is how you want JBoss and Apache to interact. In most cases you will want to use Apache as a front end to JBoss. In some cases you may want to run JBoss without Apache.
eApps Hosting supports three approaches to deploy your JBoss application. Before you proceed you will need to determine which of the three approaches below is appropriate for you. The three supported approaches for deployment are:
- Using mod_jk – the most common way of configuring JBoss and Apache. This approach is available in both CentOS 4 and CentOS 5 plans. This is the most common approach.
- Using mod_proxy_ajp – similar to using mod_jk, in that you have to specify directives to forward requests from Apache to JBoss. This approach is only available on CentOS 5 plans.
- Using JBoss in standalone mode – this approach should only be used if your application specifically requires this method. Generally, this approach is only used when your VPS does nothing but run a JBoss application. In other words, it is not used for e-mail, or any other function other than the JBoss application. This approach is for advanced users who are already very familiar with configuring JBoss and Apache. The vast majority of JBoss users do not need this approach.
Using mod_jk
Apache as a front end to JBoss using mod_jk - this approach allows you to control what content is served by JBoss and what content (if any) is served by the Apache web server. You will need to specify directives that tell Apache what content to pass on to JBoss. Mod_jk is mature, widely used, and also has advanced features for load balancing and other techniques. The majority of eApps customers use this approach.
Using mod_proxy_ajp
Apache as a front end to JBoss using mod_proxy_ajp - this approach is similar to mod_jk but is simpler to use and allows you to take better advantage of Apache's capabilities, such as mod_rewrite. It provides features for load balancing as well, but is not as sophisticated as mod_jk. Mod_proxy_ajp is a new approach and in fact does not work with Apache versions prior to 2.2. This approach can only be used by eApps customers running on the CentOs 5 or later version of operating system. To verify what OS you are on login to your control panel, click on the My Account tab, then the Subscription for your VPS. You will see the operating system version at the top.
Using JBoss in standalone mode
JBoss standalone (without Apache) - this approach allows you to run JBoss without Apache. JBoss has a built in web server so Apache is not strictly needed even if web pages need to be served. Since all requests are directed to JBoss, it theoretically is more efficient than approaches that use Apache as a front end, although the difference is not meaningful for most deployments. One major shortcoming is that the eApps Hosting service uses the Apache web server to serve all web based applications such as AWStats, Web mail, PHP applications, etc. Running JBoss standalone results in these applications being unavailable to you, by default, in your eApps VPS. This approach is generally used when deploying a commercial or open source application for a specific purpose and that is all that the VPS is intended to be used for. For instructions on how to use each of the three supported approaches, please see the User Guide for that specific approach:
Tuning JBoss
Set the Java Heap correctly
Java Heap Settings - an overview
The most important part of tuning JBoss for better performance is to optimize the Java Heap settings. The Java Heap size is the amount of memory allocated to the Java Virtual Machine (JVM). The heap is where Java objects live, and there must be enough memory allocated to the JVM to support the needs of the deployed JBoss applications. The most common issue with JBoss, by far, is a lack of available resources. In many cases, this is due to the Java Heap size either not being configured at all, or not being configured correctly. In other cases, the VPS is simply too small for the type of application being run on it. For example, while it is possible to run JBoss on the Standard Max plan, that plan does not have the resources for a true enterprise application or a site that receives a high volume of traffic.
How to find the correct Java Heap settings
By default JBoss is configured to use a maximum of 64 MB of RAM allocated to the heap. This setting will have to be changed in order to correctly optimize JBoss. To find the correct heap size , you will have to stop JBoss, and use the Linux ‘free’ command to see the available memory, and then multiple that value by two, and then subtract that result from the total RAM available for your plan. This number will be roughly what you need to set for the maximum heap size. Note – the following must be done from the command line of the VPS while logged in via SSH as the root user. Also remember to substitute your version of JBoss for the X in JBossX.
[root@example]# service jbossX status JBoss Application Server is running (19626). [root@example]# service jbossX stop Stopping JBoss Application Server... Waiting for JBoss Application Server to exit... Stopped JBoss Application Server. [root@example]# service jbossX status JBoss Application Server is not running [root@example]# free -m total used free shared buffers cached Mem: 800 250 550 0 0 0 -/+ buffers/cache: 250 550 Swap: 0 0 0 |
In this example, with JBoss stopped, the VPS plus all other applications and services running consume 250 MB of RAM. Multiply this value by two giving a total of 500, and subtract that from the total available RAM on the VPS for a value of 300 MB for the maximum heap. Remember, this is just a rough estimate. You may find that you need to adjust this number up or down as necessary, depending on how your application is configured and what other services your VPS is running.Generally, the maximum heap size should be just under half the amount of memory available to your VPS. You can of course adjust this value higher or lower, but you may have to experiment to determine the true optimum heap size. See the chart below for the eApps recommendations for the maximum heap size broken down by Plan.
This chart shows the recommended maximum heap size per plan.
Plan |
Allocated Memory for Plan |
Max Java Heap size (do not exceed) |
Standard Max |
432 MB |
192 MB |
Advanced |
800 MB |
384 MB |
Advanced Plus |
1200 MB |
576 MB |
Advanced Max |
1600 MB |
768 MB |
Premier |
2048 MB |
960 MB |
Premier Plus |
2560 MB |
1152 MB |
Premier Max |
4096 MB |
1700 MB |
Dedicated Servers |
start with the 'total memory - (free memory x2)' formula and increase as necessary |
If your JVM runs out of heap space, the message java.lang.OutOfMemoryError may appear in the /opt/jbossX/server/default/deploy/logs/server.log file. This message lets you know that you need to either adjust your heap settings, consider upgrading your plan, or optimize your application to use less memory and resources. You can also use the same ‘free -m’ command as shown above, but with JBoss still running. This will show you if you are hitting memory limits in your plan. If your ‘free’ memory drops below 100 MB, that is a sign that you may be pushing the resource limits in your plan. If this is the case, you should monitor the memory usage for several days to see if that number is consistent, or was just an anomaly due to peak load condition.
Adjusting the Java Heap settings
To set the Java Heap for JBoss you must modify the wrapper.java.initmemory and the wrapper.java.maxmemory settings in your /etc/jbossX/jboss.conf file. It is best to set the init parameter lower than the maximum parameter to ensure that Java does not initialize more memory than is actually needed. This will optimize memory for non-Java processes.Note – the following must be done from the command line of the VPS while logged in via SSH as the root user. Also remember to substitute your version of JBoss for the X in jbossX.
[root@example ~]# cd /etc/jbossX/ [root@example jbossX]# vi jboss.conf |
Using a text editor (in this example the vi editor), edit the jboss.conf file and change the settings below to your desired heap size valuesThe default values for the Java Heap Size are 64 MB for Initial and Maximum. This is the same no matter which plan you have.
# Initial Java Heap Size (in MB) wrapper.java.initmemory=64 # Maximum Java Heap Size (in MB) wrapper.java.maxmemory=64 |
In this example, the defaults are changed to 256 MB for the Initial Heap Size and 432 for the Maximum Heap Size
# Initial Java Heap Size (in MB) wrapper.java.initmemory=256 # Maximum Java Heap Size (in MB) wrapper.java.maxmemory=432 |
Save and exit the jboss.conf file, and restart JBoss for the new Heap settings to take effect.
Turn off Debug Information in JSP Classes
The JSP compiler will compile JSP classes in debug mode. In production systems you should turn this off to increase the resources available to your application. Note – the following must be done from the command line of the VPS while logged in via SSH as the root user. Also remember to substitute your version of JBoss for the X in jbossX. First, make a backup of the web.xml file before making any changes.
[root@example ~]# cd /opt/jbossX/server/default/deploy/jboss-web.deployer/conf [root@example conf]# cp web.xml{,.back} [root@example conf]# vi web.xml |
Using a text editor (in this example the vi editor), edit the web.xml file and add the section in bold.
<servlet>
<servlet-name>jsp</servlet-name> <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param> <param-name>fork</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>xpoweredBy</param-name> <param-value>false</param-value> </init-param>
<init-param> <param-name>classdebuginfo</param-name> <param-value>false</param-value> </init-param>
</servlet> |
Turn Development Mode off
For performance reasons, we have changed the default mode for JBoss's JSP Development Mode setting to False. What this means is that changes to JSP pages will not be picked up automatically by JBoss. If Development mode set to true, JBoss will check for a new version of a jsp every time it is accessed from the client side and will attempt to reload the JSP pages. This can create a large performance hit on a busy productions system, so this option should be set to false especially in production systems.Note – the following must be done from the command line of the VPS while logged in via SSH as the root user. Also remember to substitute your version of JBoss for the X in jbossX. First, make a backup of the web.xml file before making any changes.
[root@example ~]# cd /opt/jbossX/server/default/deploy/jboss-web.deployer/conf [root@example conf]# cp web.xml{,.back} [root@example conf]# vi web.xml
|
Using a text editor (in this example the vi editor), edit the web.xml file and add the section in bold.
<servlet>
<servlet-name>jsp</servlet-name> <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param> <param-name>fork</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>xpoweredBy</param-name> <param-value>false</param-value> </init-param>
<init-param> <param-name>development</param-name> <param-value>false</param-value> </init-param>
</servlet> |
Use Database Connection Pool (DBCP) When Necessary
Database Connection Pooling – an overviewDatabase connection pooling can reduce connection creation time and resource usage, especially on sites with a high load. The steps below can help you implement Database Connection Pooling for your application deployed with JBoss. Install the correct JDBC driverLogin to your Control Panel, and click on the System Tab. If necessary, click the Select Another System (Subscription) link on the left and choose the correct Virtuozzo container.Go to Applications, and click on the Add Application link. Select the box next to either MySQL-connector-J or PostgreSQL-JDBC-Driver, and then scroll down and click the Next button.This takes you back to the All Applications screen. Wait for five minutes, then click on the Refresh link at the upper right, just under the word Parallels. The application should now show as installed. If it is still in a Scheduled state, wait another five minutes, and click Refresh again. If you see it in Error state, or it still shows as Scheduled, please contact eApps Technical Support.
Create a Datasource ds.xml File
In the jbossX/server/default/deploy directory, create a data source file named yourappname-ds.xml. The file name must end with the characters ds.xml so that the JBoss server can recognize it as a data source file; however, the file name can be prefixed with any set of characters. In this example, substitute the name of your application for "yourappname". For MySQL
<datasources>
<!-- Data Source --> <local-tx-datasource>
<jndi-name>appnameDS</jndi-name> <connection-url> jdbc:mysql://localhost:3306/appdb?autoReconnect=true </connection-url> <driver-class> com.mysql.jdbc.Driver </driver-class>
<user-name>dbuser</user-name> <password>dbpassword</password>
<!-- Driver Specific Options --> (optional) <connection-property name="sendStringParametersAsUnicode"> false </connection-property>
<!--pooling parameters--> <min-pool-size>5</min-pool-size> <max-pool-size>100</max-pool-size>
<blocking-timeout-millis>5000</blocking-timeout-millis> <idle-timeout-minutes>15</idle-timeout-minutes>
</local-tx-datasource>
</datasources> |
For PostgreSQL
<datasources>
<!-- Data Source --> <local-tx-datasource> <jndi-name>appnameDS</jndi-name>
<connection-url> jdbc:postgresql://127.0.0.1:5432/appdb </connection-url> <driver-class> org.postgresql.Driver </driver-class> <user-name>dbuser</user-name> <password>dbpassword</password>
<!-- Driver Specific Options --> (optional) <connection-property name="sendStringParametersAsUnicode"> false </connection-property>
<!--pooling parameters--> <min-pool-size>5</min-pool-size> <max-pool-size>100</max-pool-size>
<blocking-timeout-millis>5000</blocking-timeout-millis> <idle-timeout-minutes>15</idle-timeout-minutes>
</local-tx-datasource>
</datasources> |
jboss-web.xml ConfigurationYou now need to configure your application WEB-INF/jboss-web.xml file to use the database resource. In your jboss-web.xml file add a resource reference like the one below for both MySQL and PostgreSQL
<resource-ref> <res-ref-name>jdbc/appnameDS</res-ref-name> <jndi-name>java:appnameDS</jndi-name> </resource-ref> |
There are several other things that can be done to tune JBoss which are out of the scope of this documentation. Please see the Links to other information section for external resources.
Common Issues and Solutions
Question: Why am I getting a "jdbc error"?Answer: This is an indication that your application is having problems connecting to the database. Make sure your database server is installed and running. Make sure you have installed the JDBC driver, as explained in the user guide for the database server you are using. Make sure your jdbc connection string url is correct. Try to connect to the database with the user name and password you are using in your application.Question: Why am I getting a "class not found error"?Answer: This is an indication that you are trying to use a lib that is not in your class path. Check that the jar file is in /opt/jbossX/server/default/lib or in your application WEB-INF/lib directory.Question: JBoss is not starting after I added a host. What can it be?Answer: If JBoss fails to start after you added a Host there is most likely a configuration error in your server.xml file. Check and make sure all tags are properly closed and that there are no syntax errors.Question: JBoss is not starting and never has, what am I doing wrong?Answer: If JBoss fails to start right from the start, you probably do not have the Java language application installed. You will see an error "cannot initialize JVM" in the catalina.out error file. Go to the All Applications area on the System tab of your control panel and make sure you have the J2SE (java 5) or Java 6 application installed in your VPS.
Links to other information
JBoss Home Page: http://jboss.org/JBoss wiki: http://www.jboss.org/wiki/Wiki.jspApache 2.2 Documentation: http://httpd.apache.org/docs/2.2/Mod_jk Home Page: http://tomcat.apache.org/connectors-doc/eApps mod_proxy User Guide: http://support.eapps.com/hsp/mod_proxy_balancereApps Apache User Guide: http://support.eapps.com/apache