JBoss

From Wiki RB4

Introduction

The following components are part of the JBoss application server:

  • Hibernate?
  • Tomcat

Databases

The data sources a configured via files e.g. mysql-ds.xml in the deploy directory. The datasource is bound to the JNDI name e.g. java:/DefaultDS.

Installation

4.2.3

Many downloads are ending in 'GA'. This abbreviation stands for General Availability, a fancy way of saying that it is the final release. The 4.2.x series of JBoss AS is a partial implementation of Java EE 5, with support for EJB 3, allowing you to take advantage of all of Seam’s features.

  1. exctract jboss-4.2.3.GA.zip to C:/Uwes/jboss/
  2. set JBOSS_HOME to C:\Uwes\jboss\jboss-4.2.3.GA


4.2.2

Installed via ant script of SeamInAction to C:\Uwes\eclipse\workspace\seaminaction\opt\jboss-as-4.2.2.GA

Configuration

The JBoss Enterprise Application Platform ships with four different server configurations. Within the jboss-4.2.2.GA/server directory, you will find four subdirectories: minimal, default, production and all - one for each server configuration. Each of these configurations provide a different set of services. The default configuration is the one used if you don’t specify another one when starting up the server. If you want to know which services are configured in each of these instances, look at the jboss-service.xml file in the jboss-4.2.2.GA/server/<instance-name>/conf/ directory and also the configuration files in the jboss-4.2.2.GA/server/<instance-name>/deploy directory. The directory server configuration you’re using, is effectively the server root while JBoss is running. It contains all the code and configuration information for the services provided by the particular server configuration. It’s where the log output goes, and it’s where you deploy your applications.

Deployment of Applications

  1. copy the ear file to <JBOSS_HOME>/server/<CONFIGURATION>/ directory
  2. it will be expanded to <JBOSS_HOME>/server/<CONFIGURATION>/tmp/deploy/...

My own adjustments

  1. in <JBOSS_HOME_423>\server\default\conf\jboss-service.xml line 253 RmiPort from 1098 to 1498 because of exception at startup
  2. in <JBOSS_HOME_423>\server\default\conf\jboss-service.xml line 247 Port from 1098 to 1498 because of exception at startup
  3. mysql-connector-java-5.1.5-bin.jar nach <JBOSS_HOME>\server\default\lib kopiert
  4. mysql-ds.xml in <JBOSS_HOME>\server\default\deploy kopiert
  5. in <JBOSS_HOME_423>\bin\run.bat Zeile 66 JAVA_OPTS um -XX:+CMSPermGenSweepingEnabled -XX:MaxPermSize=128m ergänzt um die OutOfMemory Exception des PermGen aufzuschieben
  6. rename jboss-log4j.xml in jboss-log4j.xml.sik and copy jboss-log4j.xml from C:\Uwes\jboss\jboss-4.2.3.GA\server\default\conf to C:\Uwes\eclipse\workspace\seaminaction\opt\jboss-as-4.2.2.GA\server\default\conf

Operation

Start the server

  • <JBOSS_HOME>/bin/run.bat

Start the server for debugging

  • <JBOSS_HOME>/bin/run_debug.bat

Stop the server

  • <JBOSS_HOME>/bin/shutdown.bat

Database configuration

  • copy corresponding jar file to <JBOSS_HOME>\server\<used configuration>\lib
  • copy <dbname>-ds.xml to <JBOSS_DEPLOY_DIR>

Start the Hypersonic (HSQL) Database Manager

  • start JBoss JMX Console
  • follow link database=localDB,service=Hypersonic
  • search startDatabaseManager() and press Invoke
  • new client start after some seconds

Logging

Configuration is located in <JBOSS_HOME>\server\default\conf\jboss-log4j.xml.

javax.servlet.GenericServlet.log(String) <JBOSS_HOME>/server/default/log/server.log

JBoss applications

EJB Trail Tutorial

  1. download EJB3Trail.ear from http://www.jboss.com/docs/trailblazer and copied to deploy directory

TestWebApplication

  1. jsf

TestEJBApplication

  1. EJBs

ticket2rock

  • download from http://www.ejb3buch.de/
  • ant
  • copy /build/ticket2rock.ear to <JBOSS_HOME_DEPLOY_DIR>
  • läuft nicht unter 4.2.3

Seam Registration Example

  • cd C:\Uwes\eclipse\workspace\jboss-seam-2.0.2.SP1\examples\registration
  • ant
    • copies C:\Uwes\eclipse\workspace\jboss-seam-2.0.2.SP1\examples\registration\dist\jboss-seam-registration.ear to <JBOSS_HOME_DEPLOY_DIR>
  • runs

Seam Messages Example

  • cd C:\Uwes\eclipse\workspace\jboss-seam-2.0.2.SP1\examples\messages
  • ant
    • copies C:\Uwes\eclipse\workspace\jboss-seam-2.0.2.SP1\examples\messages\dist\jboss-seam-messages.ear to <JBOSS_HOME_DEPLOY_DIR>
  • runs

Seam Booking Example

  • cd C:\Uwes\eclipse\workspace\jboss-seam-2.0.2.SP1\examples\booking
  • ant
    • copies C:\Uwes\eclipse\workspace\jboss-seam-2.0.2.SP1\examples\booking\dist\jboss-seam-booking.ear to <JBOSS_HOME_DEPLOY_DIR>
  • runs

Seam Todo List Example

  • cd C:\Uwes\eclipse\workspace\jboss-seam-2.0.2.SP1\examples\todo
  • ant
    • copies C:\Uwes\eclipse\workspace\jboss-seam-2.0.2.SP1\examples\todo\dist\jboss-seam-todo.ear to <JBOSS_HOME_DEPLOY_DIR>
  • runs

Seam Numberguess Example

  • cd C:\Uwes\eclipse\workspace\jboss-seam-2.0.2.SP1\examples\numberguess
  • ant
    • copies C:\Uwes\eclipse\workspace\jboss-seam-2.0.2.SP1\examples\numberguess\dist\jboss-seam-numberguess.ear to <JBOSS_HOME_DEPLOY_DIR>
  • runs

State

  • Version 5 installed but uweheuer doesn't work => deinstalled
  • Version 4.2.2 installed but WebTestApplication doesn't work => deinstalled
  • Version 4.2.3: Seam Examples, WebTestApplication, TestEJBApplication, uweheuer work, ticket2rock does not