Installing and Configuring a Web Server
From Wiki
(Redirected from Installing and configuring the JBoss Application Server)
This article is a stub. You can help us by expanding it.
Contents |
XAMPP
- XAMPP. You have to install at least Apache 2.2.x, PHP 5.x.x and MySQL 5.x.x.
Tomcat as XAMPP Addon
JBoss Application Server
Install JBoss AS
- Install JBoss-4.2.2.GA.
In the installer UI, you can choose a server installation directory.
- The installer allows you to select a server configuration.
- Choose portal to benefit from all components or default for a standard server.
- You can also customize the individual components installed in each server configuration (for example dropping the old EJB 2.1 libraries if you don't run old Java enterprise code).
- The installer also allows you to set password to secure the management console and the database support.
Run Jboss AS
To run the EJB 3.0 server, you can just run the bin/run.sh script (or the bin/run.bat script under Windows) inside the server installation directory.
- The Tomcat server runs at port
8080by default. If you have multiple server configurations installed under the server directory, you can specify which one to start using therun.sh -c ConfigNamecommand line option. Without the-coption, the default configuration is started. - You can deploy an application into the server by copying it's archive file into the
server/default/deploydirectory.
You should be able to see the deployment messages on the command console.
Configure the EJB 3.0 server
- All the EJB 3.0 libraries and server-wide configuration files are located in the
[server_installation]/server/default/deploydirectory. The server works out with the default configuration. - The
ejb3.deployer/META-INF/persistence.propertiesfile configures the default database for all entity beans andEntityManagerin this server. The default is the server's embedded HSQLDB database.
Creating a MyApplication.ear file
- To build the MyApplication application, use Ant.
- After obtaining
MyApplication.earjust copy it to your JBoss AS'sserver/default/deploydirectory and you are done.
- An EAR it is just a JAR file with the
.earfile name extension. - Usually the
.earfile contains abeans.jarfile for EJBs, and aweb.warfile for servlets and JSP pages. - The EAR file may also contains two configuration files in the
META-INFdirectory: theapplication.xmlfile and thejboss-app.xmlfile. Theapplication.xmlfile simply lists the nested JAR files contained in this.earfile.
<application xmlns="http://java.sun.com/xml/ns/j2ee" version="1.4"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com /xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
<display-name>MyApplication</display-name>
<description>A short description</description>
<module>
<ejb>beans.jar</ejb>
</module>
<module>
<web>
<web-uri>web.war</web-uri>
<context-root>MyApplication</context-root>
</web>
</module>
</application>
- The
jboss-app.xmlfile defines a class loader for this application. It makes it simpler for EJB 3.0 to find the defaultEntityManager.
<!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD J2EE Application 1.4//EN"
"http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd">
<jboss-app>
<loader-repository>
myApplication:app=ejb3
</loader-repository>
</jboss-app>
See Also: Creating an EJB3 Eclipse project

