Benutzer:Krogmann/SPECjAppServer-JOnAS/Original JOnAS Tutorial

Aus SDQ-Wiki

SEE SOURCE OF THIS PAGE

Original page: https://wiki.objectweb.org/jonas/Wiki.jsp?page=SPECjAppServer2004 Attachments: Image:JOnAS_AppServer_Config.zip


SPECjAppServer2004
SPECjAppserver2004

Introduction
SPECjAppServer2004 (Java Application Server) is a multi-tier benchmark for measuring the performance of Java 2 Enterprise Edition (J2EE) technology-based application servers see.
The purpose of this Wiki page is to explain how to port and run this bench with JOnAS.
This document does not replace the SPECjAppServer2004 User's Guide it's a add-on that explain JOnAS specificities.
It is certainly not the place where results will be published.
We make the assomption that the bench has been installed in accordance with the SPECjAppServer2004 User's Guide.
Warning: in the following some configuration information are relative to my own environment N°port,path etc...
Configuration
JAS_HOME is an environment variable pointing to the root of SPECjApp installation
$JAS_HOME/config/appserver file has been update with a line that contains : jonas
$JAS_HOME/config/jonas.env file is a copy of default.env modified with specific information related to the building and running environment like:

    * JAS_HOME,JAVA_HOME
    * J2EE_HOME that points to the JONAS_ROOT
    * JAVAX_JAR that points to $JONAS_ROOT/lib/client.jar (containing its implementation of the J2EE specification)
    * JDBC_CLASSPATH that points to the JDBC driver used (usually instlled under $JONAS_BASE/lib/ext)
    * JAS_HOST,JAS_PORT,EMULATOR_HOST,EMULATOR_PORT

Database configuration and creation
First of all choose the type of the database you want to use
For Oracle9i

    * Create a single database (for all the domains) nammed specdb:

createdb.sh specdb /ora920/app/oracle/oradata/specdb 

    * Create the schema for the benchmark:

schema_U.sh specdb /ora920/app/oracle/oradata/specdb
schema_C.sh specdb /ora920/app/oracle/oradata/specdb
schema_M.sh specdb /ora920/app/oracle/oradata/specdb
schema_O.sh specdb /ora920/app/oracle/oradata/specdb
schema_S.sh specdb /ora920/app/oracle/oradata/specdb

    * Modify $JAS_HOME/config/XX.properties:

for XX= corp,mfgdb,ord,supp,util the properties for Cloudscape must be commented and the following uncommented:

dbURL = jdbc:oracle:thin:@wallis:1521:specdb
dbDriver = oracle.jdbc.driver.OracleDriver
jdbcVersion = 2

dbUser = spec
dbPassword = spec

(the corpdb.properties is attached as example for all the XX.properties file)

    * Populate the database

ant -f $JAS_HOME/build.xml loaddb

For Postgres 8

    * Create a single database (for all the domains) nammed specdb:

su - postgres $ createuser -P user Enter password for new role: user Enter it again: jonas Shall the new role be a superuser? (y/n) n Shall the new role be allowed to create databases? (y/n) y Shall the new role be allowed to create more new roles? (y/n) y

$ createdb -O user specdb

    * Create the schema for the benchmark:

psql -U spec specdb -f $JAS_HOME/schema/sql/schema_C.sql
psql -U spec specdb -f $JAS_HOME/schema/sql/schema_M.sql
psql -U spec specdb -f $JAS_HOME/schema/sql/schema_O.sql
psql -U spec specdb -f $JAS_HOME/schema/sql/schema_U.sql
psql -U spec specdb -f $JAS_HOME/schema/sql/schema_S.sql

    * Modify $JAS_HOME/config/XX.properties:

for XX= corp,mfgdb,ord,supp,util the properties for Cloudscape must be commented and the following uncommented:

dbUser = spec
dbPassword = spec
dbURL = jdbc:postgresql://wallis:5432/specdb
dbDriver = org.postgresql.Driver
jdbcVersion = 3

    * Populate the database

ant -f $JAS_HOME/build.xml loaddb

Build and Deployment Process
Building process
Several steps that must be accomplished prior running the bench can be done via ant. It's the case for:

    * loadding databases
    * building ear files
    * building the driver

$JAS_HOME/build.xml file has been modified in order to introduce JOnAS specific ant task( see build.xml attached file)[1]


    * building and installing the application

ant -f $JAS_HOME/build.xml jAppServer-ear
ant -f $JAS_HOME/build.xml  emulator-ear


Deployment Process
The standard deployment descriptors aren't changed.
The current version of the JOnAS specific deployment descriptors are attached to the current page

Configuring JOnAS
Be sure to have your JONAS_BASE/JONAS_ROOT set
Depending on you want to work with jdbc rar or not, joram_for_jonas_ra.rar or not, the old jms and dbm services or not the configuration will be different:
Using resource adapters only:
Set the jonas.services property of $JONAS_BASE/conf/jonas.properties to
jonas.services registry,jmx,jtm,security,resource,ejb,ws,web,ear
Be sure to have built the resource adapter JDBC corresponding to the database you have chosen and installed under $JONAS_BASE/rars/autoload (see)
Be sure to have installed joram_for_jonas_ra.rar under $JONAS_BASE/rars/autoload

Using resource adapter JDBC and the old service jms:
Set the jonas.services property of $JONAS_BASE/conf/jonas.properties to
jonas.services registry,jmx,jtm,jms,security,resource,ejb,ws,web,ear
Be sure to have built the resource adapter JDBC corresponding to the database you have chosen and installed under $JONAS_BASE/rars/autoload
Verify there is no joram_for_jonas_ra.rar under $JONAS_BASE/rars/autoload
Using the old service jms and the old service dbm:
Set the jonas.services of $JONAS_BASE/conf/jonas.properties to
jonas.services registry,jmx,jtm,dbm,jms,security,ejb,ws,web,ear
Be sure to have the $JONAS_BASE/conf/XX.properties file correctly configured for your database (see here) and set the jonas.service.dbm.datasources property in JONAS_BASE/conf/jonas.properties
Running the Web application
Before running the bench the web application must be deployed and run
Starting JOnAS

jonas start 
JONAS_BASE set to /home/coqp/jb43
main : PolicyProvider.init : Using JOnAS PolicyConfigurationFactory provider and JOnAS Policy provider
main : TraceCarol.infoCarol : Name service for jrmp is started on port 1951
main : ServiceManager.startRegistry : registry service started
main : ServiceManager.startJmx : jmx service started
main : ServiceManager.startServices : jtm service started
.....
.....
main : ServiceManager.startServices : web service started
main : JContainer.addBean : SequenceEnt is loaded and using rdb.oracle
main : JContainer.addBean : SequenceEnt available
main : JContainer.addBean : SequenceSes available
main : JContainer.addBean : CustomerSes available
main : JContainer.addBean : CustomerInventoryEnt is loaded and using rdb.oracle
main : JContainer.addBean : CustomerInventoryEnt available
main : JContainer.addBean : CorpAuditSes available
main : JContainer.addBean : CustomerEnt is loaded and using rdb.oracle
main : JContainer.addBean : CustomerEnt available
main : JContainer.addBean : OrderLineEnt is loaded and using rdb.oracle
main : JContainer.addBean : OrderLineEnt available
main : JContainer.addBean : OrderEnt is loaded and using rdb.oracle
main : JContainer.addBean : OrderEnt available
main : JContainer.addBean : OrderAuditSes available
main : JContainer.addBean : ItemBrowserSes available
main : JContainer.addBean : OrderSes available
main : JContainer.addBean : FulfillOrderMDB available
main : JContainer.addBean : ItemEnt is loaded and using rdb.oracle
main : JContainer.addBean : ItemEnt available
main : JContainer.addBean : PartEnt is loaded and using rdb.oracle
main : JContainer.addBean : PartEnt available
main : JContainer.addBean : WorkOrderSes available
main : JContainer.addBean : MfgAuditSes available
main : JContainer.addBean : LargeOrderSes available
main : JContainer.addBean : BomEnt is loaded and using rdb.oracle
main : JContainer.addBean : BomEnt available
main : JContainer.addBean : WorkOrderEnt is loaded and using rdb.oracle
main : JContainer.addBean : WorkOrderEnt available
main : JContainer.addBean : ReceiveMDB available
main : JContainer.addBean : ComponentEnt is loaded and using rdb.oracle
main : JContainer.addBean : ComponentEnt available
main : JContainer.addBean : LargeOrderMDB available
main : JContainer.addBean : InventoryEnt is loaded and using rdb.oracle
main : JContainer.addBean : InventoryEnt available
main : JContainer.addBean : AssemblyEnt is loaded and using rdb.oracle
main : JContainer.addBean : AssemblyEnt available
main : JContainer.addBean : LargeOrderEnt is loaded and using rdb.oracle
main : JContainer.addBean : LargeOrderEnt available
main : JContainer.addBean : SupplierEnt is loaded and using rdb.oracle
main : JContainer.addBean : SupplierEnt available
main : JContainer.addBean : POLineEnt is loaded and using rdb.oracle
main : JContainer.addBean : POLineEnt available
main : JContainer.addBean : ReceiverSes available
main : JContainer.addBean : POEnt is loaded and using rdb.oracle
main : JContainer.addBean : POEnt available
main : JContainer.addBean : SupplierCompEnt is loaded and using rdb.oracle
main : JContainer.addBean : SupplierCompEnt available
main : JContainer.addBean : SupplierAuditSes available
main : JContainer.addBean : SComponentEnt is loaded and using rdb.oracle
main : JContainer.addBean : SComponentEnt available
main : JContainer.addBean : BuyerMDB available
main : AbsJWebContainerServiceImpl.registerWar : War .../supplier.war available at the context /Supplier on the host localhost.
main : AbsJWebContainerServiceImpl.registerWar : War .../web.war available at the context /SPECjAppServer.
main : EarServiceImpl.deployEar : Ear file: .../SPECjAppServer.ear available.
main : AbsJWebContainerServiceImpl.registerWar : War .../emulator.war available at the context /Emulator.
main : EarServiceImpl.deployEar : Ear file: .../emulator.ear available.
main : ServiceManager.startServices : ear service started
The JOnAS Server 'jonas' version 4.3.4 is ready
main : Server.start : JOnAS server 'jonas' started on  rmi/jrmp

Running the web application
You can access to the web application via a web browser
example of a url for accessing tha application:
http://localhost:19510/SPECjAppServer/
you must get something like:


SPECjAppServer2004%


then it is advisable to click in the left menu in Atomicity Tests item and verify that in the result page there is
Atomicity Test One: PASSED
Atomicity Test Two: PASSED
Atomicity Test Three: PASSED

Running the bench

A first step may be to run all the stuff on a single machine. Despite, it is not realistic to have correct results, it may show some problems of configuration or deployment.
we will see different scenarii:

   1. scenario 1: driver + SUT on the same host (localhost)
   2. scenario 2: driver on localhost SUT on another (host1)
   3. scenario 3: driver on localhost,Supplier Emulator on localhost, SUT on another (host1)

Scenario 1: driver + SUT on the same host (localhost)

    * Modification of $JAS_HOME/config/jonas.env:

JAS_HOST=localhost
EMULATOR_HOST=localhost
NAMING_PROVIDER=rmi://localhost:1951

    * Modification of $JAS_HOME/config/run.properties:

Url=http://localhost:19510/SPECjAppServer/app?

    * reloading the database

ant -f $JAS_HOME/build.xml loaddb

    * Start the application server

Be sure the two ears SPECjAppServer.ear and emulator.ear are installed under $JONAS_BASE/apps/autoload

jonas start

    * Start the driver

run the driver in a special directory [2]

ant -f $JAS_HOME/build.xml driver
cd $JAS_HOME/runtest
$JAS_HOME/bin/driver.sh 

Scenario 2: driver on localhost, SUT on another (host1)

    * Modification of $JAS_HOME/config/jonas.env:

JAS_HOST=localhost
EMULATOR_HOST=host1
NAMING_PROVIDER=rmi://host1:1951

    * Modification of $JAS_HOME/config/run.properties:

Url=http://host1:19510/SPECjAppServer/app?

    * Rebuild the SPECjAppServer.ear and emulator.ear

This phase is mandatory because the supplier.xml and emulator_web.xml must be pre-processed with the values of JAS_HOST/JAS_PORT, EMULATOR_HOST/EMULATOR_PORT

ant -f $JAS_HOME/build.xml jAppServer-ear
ant -f $JAS_HOME/build.xml  emulator-ear

    * reloading the database

ant -f $JAS_HOME/build.xml loaddb

    * Start the application server

On host1 be sure that the two ears SPECjAppServer.ear and emulator.ear are installed under $JONAS_BASE/apps/autoload

jonas start

    * Start the driver

run the driver in a special directory [2]

cd $JAS_HOME/runtest
$JAS_HOME/bin/driver.sh 

scenario 3: driver on localhost,Supplier Emulator on localhost [3], SUT on another (host1)

Modification of $JAS_HOME/config/jonas.env:
JAS_HOST=localhost
EMULATOR_HOST=frec445361.frec.bull.fr
NAMING_PROVIDER=rmi://host1:1951

    * Modification of $JAS_HOME/config/run.properties:

Url=http://host1:19510/SPECjAppServer/app?

    * Rebuild the SPECjAppServer.ear and emulator.ear

This phase is mandatory because the supplier.xml and emulator_web.xml must be pre-processed with the values of JAS_HOST/JAS_PORT, EMULATOR_HOST/EMULATOR_PORT

ant -f $JAS_HOME/build.xml jAppServer-ear
ant -f $JAS_HOME/build.xml  emulator-ear

    * reloading the database

ant -f $JAS_HOME/build.xml loaddb

    * Start the application server on localhost

On localhost be sure that the emulator.ear is installed under $JONAS_BASE/apps/autoload

jonas start

    * Start the application server on host1

On host1 be sure that the SPECjAppServer.ear is installed under $JONAS_BASE/apps/autoload

jonas start

    * Start the driver

run the driver in a special directory [2]

cd $JAS_HOME/runtest
$JAS_HOME/bin/driver.sh 

Known problems

All bugs that were opened has been fixed in JOnAS 4.7.x version

Footnotes
[#1] Note that in a first step I have duplicated, modified and renamed some initial targets (for example for creating the corp.jar I have written the new target jcorp
Note also that the jAppServer-ear target build the corresponding ear AND install it under $JONAS_BASE/apps/autoload.
[#2] The driver creates some html files in the working directory so I run the driver always in a directory runtest that I have created under $JAS_HOME
[#3] Note that the name of localhost is for me frec445361.frec.bull.fr

sdqinternal:Category:SDQ-Internal