JBoss: Difference between revisions
| Line 12: | Line 12: | ||
* Hibernate? | * Hibernate? | ||
* Tomcat | * Tomcat | ||
==Installation== | ==Installation== | ||
Revision as of 11:32, 2 December 2011
Introduction
JBoss 7
JBoss Application Server 7, is a fast, powerful, implementation of the Java Enterprise Edition 6 specification. The state-of-the-art architecture built on the Modular Service Container enables services on-demand when your application requires them. There two modes: standalone and domain, which is a group of servers.
Overview of implemented Standards
see https://docs.jboss.org/author/display/AS7/Getting+Started+Guide
JBoss <7
The following components are part of the JBoss application server:
- Hibernate?
- Tomcat
Installation
E.ON IS Laptop
Productive
- Installed via ant script of SeamInAction to C:\Uwes\eclipse\workspace\seaminaction\opt\jboss-as-4.2.2.GA and registered as service.
- Logs in C:\Uwes\eclipse\workspace\seaminaction\opt\jboss-as-4.2.2.GA\server\default\log\.
- Shutdown by C:\Uwes\eclipse\workspace\seaminaction\opt\jboss-as-4.2.2.GA\bin\shutdown -s localhost:1499, because 1499 is configured C:\Uwes\eclipse\workspace\seaminaction\opt\jboss-as-4.2.2.GA\server\default\conf\jboss-service.xml
JBoss 7 Installation
C:\Uwes\java\jboss\jboss-as-web-7.0.2.Final
jBPM Testinstallation
Installation of Release 4.1 including eclipse to C:\Uwes\java\jbpm-4.1 by http://docs.jboss.com/jbpm/v4/userguide/html_single/#installation.
Home PC
see here
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
- copy the ear file to <JBOSS_HOME>/server/<CONFIGURATION>/ directory
- it will be expanded to <JBOSS_HOME>/server/<CONFIGURATION>/tmp/deploy/...
My own adjustments
- in <JBOSS_HOME_423> and <JBOSS_HOME_422>\server\default\conf\jboss-service.xml from 1099 to 1499 because of exception at startup
- mysql-connector-java-5.1.5-bin.jar nach <JBOSS_HOME>\server\default\lib kopiert
- mysql-ds.xml in <JBOSS_HOME>\server\default\deploy kopiert
- 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
- copy <JBOSS_HOME_423>\bin\run.bat to <JBOSS_HOME_423>\bin\run_debug.bat and decomment line 93 with debug options and suspend=n
- 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
- change port in <JBOSS_HOME_422>\server\default\deploy\jboss-web.deployer\server.xml 8080 -> 8088
Operation
Start the server
JBoss < 7
- on Windows systems <JBOSS_HOME>/bin/run.bat
- the jBPM test environment:
- set JBOSS_HOME=C:\Uwes\java\jbpm-4.1\jboss-5.0.0.GA
- C:\Uwes\java\jbpm-4.1\install\ant start.hsqldb.server
- C:\Uwes\java\jbpm-4.1\install\ant start.jboss
- on Linux systems <JBOSS_HOME>/bin/run.sh > /dev/null &
JBoss 7
- <JBOSS_HOME>\bin\standalone.bat or domain.bat
Start the server for debugging
- <JBOSS_HOME>/bin/run_debug.bat
Stop the server
- Windows-Standard is <JBOSS_HOME>/bin/shutdown.bat --server=localhost:1499 Port (see C:\Uwes\Batches\ShutDownJBoss.bat), wegen Anpassung
- Linux-Standard is <JBOSS_HOME>/bin/shutdown.sh --server=localhost
- on HOME PC because of service installation: manual start or stop in terminal with sudo /etc/init.d/jboss [start|stop]
- on jBPM test environment:
- C:\Uwes\java\jbpm-4.1\install\ant stop.jboss
- on standard productive installation on EIS laptop <JBOSS_HOME>\bin\MyShutdown.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. Entries for Hibernate Logging are added.
| javax.servlet.GenericServlet.log(String) | <JBOSS_HOME>/server/default/log/server.log |
Output goes to <JBOSS_HOME>\server\default\log\server.log
JBoss applications
EJB Trail Tutorial
- download EJB3Trail.ear from http://www.jboss.com/docs/trailblazer and copied to deploy directory
TestWebApplication
- jsf
TestEJBApplication
- 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 In Action Example
- C:\Uwes\eclipse\workspace\seaminaction>ant quickstart
- C:\Uwes\eclipse\workspace\seaminaction>ant -f stages/projects-part3/open18/build.xml explode
- runs as open18
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