Instructions for using Jboss - PowerPoint PPT Presentation

About This Presentation
Title:

Instructions for using Jboss

Description:

Write your beans and package them in an ejb-jar file. ... An ear file is a jar archive which contains: Your jar files. Your war files ... – PowerPoint PPT presentation

Number of Views:174
Avg rating:3.0/5.0
Slides: 25
Provided by: utda
Learn more at: https://www.utdallas.edu
Category:

less

Transcript and Presenter's Notes

Title: Instructions for using Jboss


1
Instructions for using Jboss
  • User Manual

2
How to Deploy on JBoss
  • Write your beans and package them in an ejb-jar
    file.
  • Write your servlets/JSPs and package them in a
    war file.
  • Add a Class-Path attribute to your war files
    MANIFEST.MF file to reference your beans package.
    for detailed information on that see J2EE
    Deployment specification.

3
How to Deploy in JBoss
  • 4. Package your application in an ear file.
  • An ear file is a jar archive which contains
  • Your jar files
  • Your war files
  • A deployment descriptor for your application.
  • This file must be named "application.xml", and
    must be
  • located in the META-INF directory in the ear
    archive. This
  • file tells JBoss which modules are EJBs, which
    ones are
  • web modules, and the context paths for the
    web-modules.

4
Sample Application.xml file
  • lt?xml version"1.0" encoding"ISO-8859-1"?gt
  • ltapplicationgt ltdisplay-namegtMy applicationlt/displa
    y-namegt
  • ltmodulegt
  • ltwebgt
  • ltweb-urigtwebmodule.warlt/web-urigt ltcontext
  • rootgt/servletslt/context-rootgt
  • lt/webgt
  • lt/modulegt
  • ltmodulegt
  • ltejbgtbeans.jarlt/ejbgt
  • lt/modulegt
  • lt/applicationgt

5
Deploying in JBoss
  • 5. Deploy your ear file.
  • Option 1 Copy your ear file to JBOSS_HOME/deploy
    (wow!)
  • Write once Deploy AnyWhere!!

6
Steps A
  • Log on to the system
  • using username and password of UTD
  • Log on to
  • ssh root_at_jboss
  • Password root123
  • Screen shot on next page

7
(No Transcript)
8
Step B
  • To set path and start the Jboss and cloudscape
    run the following command (every time server goes
    down)
  • export J2EE_HOME/usr/j2sdkee1.3/
  • export ANT_HOME/usr/Ant/
  • PATHPATH/usr/Cloudscape_3.6//usr/j2sdkee1.3/bi
    n/
  • nohup cloudscape1098 -start
  • cd /usr/jboss/JBoss-2.4.1_Jetty-3.1.RC9-1
  • nohup sh run.sh

9
Steps for Pet store Application
  • Download the Pet Store
  • You can get the source from
  • Sun's J2EE Download Page. It's in
  • the "J2EE Blueprints" package.
  • Download the 1.1.2 version. Unpack
  • it anywhere. The root directory of
  • the Pet Store demo is referred to below
  • as PETSTORE (stan/petstore1.1.2/jps1.1.2/)

10
Step 2 For Pet store Application
  • 2.Download the JBoss Pet Store patch file
  • Running the Pet Store demo in Jboss
  • requires several minor changes to
  • deployment files in the Pet Store
  • application (.ear) file. The current patch
  • file, jps112-01.zip is currently available in
  • the documentation files section of the
  • manual.

11
Step 3
  • 3. Configure JBoss
  • You need a servlet container to run the Java Pet
  • Store. If you're using the JBoss-Jetty or Jboss
  • Tomcat releases, the server is preconfigured.
  • DO not need to do do this step

12
Step 4
  • 4. Rebuild the Pet Store application
    (petstore.ear)
  • The following step overwrites several files
  • in the Pet Store application sources. You
  • may want to make a separate copy of the
  • JBoss version of the Pet Store.
  • This step adds the file jboss-web.xml to
  • the WEB-INF directory in petstore.war,
  • modifies the serverType in the web.xml
  • file of that directory to identify the Jboss
  • server to the application, and modifies
  • the application.xml file in the META-INF
  • directory of petstore.ear.

13
Step 4A
  • 4A. Copy the jps112-01.zip file to the root
  • directory (PETSTORE) of your Pet Store
  • distribution. Change to this directory and
  • unzip the file.
  • Note This will overwrite the original web.xml
    file.
  • gtcd PETSTORE (stan/petstore1.1.2/jps1.1.2/)
  • unzip jps1.1.2-01.zip

14
Logged on and directory having petstore example
15
Step 4B
  • 4B. Rebuild the Pet Store application.
  • Run build.sh or build.bat in the
  • PETSTORE/src/petstore/build directory.
  • The result is a new petstore.ear in the
  • PETSTORE/src/petstore/build directory.
  • This is the file you deploy by copying it to
  • JBOSS_HOME/deploy

16
Build directory having all three war, jar and ear
files
17
Step 5
  • 5. Prepare the Database
  • Modify the Cloudscape startup command to use
  • port 1098.
  • You do this by adding -port port_number. For
  • example
  • java ... RmiJdbc.RJJdbcServer -port 1098
  • COM.cloudscape.core.JDBCDriver
  • Start Cloudscape.

18
Deploy directory in JBoss home path
19
Step 6
  • 6. Add JARS to JBoss
  • Copy your DB driver JAR to the lib/ext
  • directory of your JBoss installation
  • (JBOSS_HOME).
  • For Cloudscape, copy client.jar and
  • RmiJdbc.jar to the lib/ext directory.
  • Copy tools.jar from the J2 SDK to the
  • lib/ext directory of your JBoss installation
  • (JBOSS_HOME).

20
Step 7
  • 7. Start Jboss
  • Already done by doing Step B
  • Start JBoss and copy the new
  • petstore.ear to the deploy directory.
  • You should see JBoss deploy the Pet
  • Store EJBs.

21
Step 8
  • 8.Run the Pet Store
  • Point your browser to
  • http//jboss.utdallas.edu8080/estore
  • To start pet store example

22
Problems faced
  • 1.When user logged off the system, initially the
    JBoss application was stopped and the application
    can not be displayed.
  • In order to solve this problem, use nohup command
  • For Jboss nohup sh run.sh
  • For cloudscape usr/cloudscape_3.6 nohup
    cloudscape start
  • Output of nohup in nohup.out file
  • gt Tail f nohup.out

23
Problems faced
  • 2. Cloudscape and JBoss were both using same port
    number 1099 and as a result it was not possible
    for application to run
  • We changed the java commands in the cloudscape
  • executable file as per the new java command and
    saved it
  • as 'cloudscape1098' so that whenever we type
  • 'cloudscape1098 -start', cloudscape starts on
    port 1098.
  • Even then JBoss couldn't connect to Cloudscape.
    The
  • reason was that there is a jboss.jcml
    configuration file in
  • /usr/jboss/JBoss-2.4.1_Jetty-3.1.RC9-1/jboss/conf/
    jetty
  • directory. It contains a section where JDBC tries
    to connect
  • to Hypersonic database. This had to be changed to
    make
  • JDBC connection to Cloudscape.

24
Problems Faced
  • 3.Application is killed when server restarted
  • To restart the pet-store anytime, all need to be
    done is run the following commands export
    J2EE_HOME/usr/j2sdkee1.3/ export
    ANT_HOME/usr/Ant/PATHPATH/usr/Cloudscape_3.6/
    /usr/j2sdkee1.3/bin/nohup cloudscape1098
    -startcd /usr/jboss/JBoss-2.4.1_Jetty-3.1.RC9-1
    nohup sh run.sh
Write a Comment
User Comments (0)
About PowerShow.com