Installing and Configuring a Web Server

From Wiki

Jump to: navigation, search
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

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 8080 by default. If you have multiple server configurations installed under the server directory, you can specify which one to start using the run.sh -c ConfigName command line option. Without the -c option, the default configuration is started.
  • You can deploy an application into the server by copying it's archive file into the server/default/deploy directory.

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/deploy directory. The server works out with the default configuration.
  • The ejb3.deployer/META-INF/persistence.properties file configures the default database for all entity beans and EntityManager in this server. The default is the server's embedded HSQLDB database.

Creating a MyApplication.ear file

  1. To build the MyApplication application, use Ant.
  2. After obtaining MyApplication.ear just copy it to your JBoss AS's server/default/deploy directory and you are done.


  • An EAR it is just a JAR file with the .ear file name extension.
  • Usually the .ear file contains a beans.jar file for EJBs, and a web.war file for servlets and JSP pages.
  • The EAR file may also contains two configuration files in the META-INF directory: the application.xml file and the jboss-app.xml file. The application.xml file simply lists the nested JAR files contained in this .ear file.
<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.xml file defines a class loader for this application. It makes it simpler for EJB 3.0 to find the default EntityManager.
<!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

Configure The Persistence Context

To be completed
Personal tools