Sun Java Solaris Communities My SDN Account Join SDN
 
Article

Run 2001 J2EE Deployathon Online! With Java 2 SDK, Enterprise Edition 1.2.1 for Solaris

 
 

Articles Index

Deployathon Online!

by MDE Enterprise Java APIs Team

Introduction

Step 1: Download and Install Java 2 SDK, Standard Edition for Solaris
Step 2: Download J2EE SDK 1.2.1 for Solaris
Step 3: Install and Configure J2EE SDK 1.2.1 for Solaris
Step 4: Start the J2EE SDK Server
Step 5: Download the Java Pet Store Application
Step 6: Install and Configure the Java Pet Store Application
Step 7: Run the Java Pet Store Application
Notes
Running 2001 J2EE Deployathon Online! With an Oracle Database
Support

Step 1: Download and Install Java 2 SDK, Standard Edition for Solaris

Java 2 SDK, Enterprise Edition 1.2.1 (J2EE SDK) requires Java 2 SDK, Standard Edition v1.3 or v1.2.2. If Java 2, Standard Edition v1.3 or v1.2.2 for Solaris is not already installed, you need to install it now. To download and install Java 2 SDK, Standard Edition v1.3 for Solaris, follow the instructions on the Java 2 SDK, Standard Edition v1.3 for Solaris download page. To download and install Java 2 SDK, Standard Edition v1.2.2 for Solaris, follow the instructions on the Java 2 SDK, Standard Edition v1.2.2 for Solaris download page.

Step 2: Download J2EE SDK 1.2.1 for Solaris

To download J2EE SDK 1.2.1 for Solaris:

  • Follow the instructions in the section "Download Java 2 SDK, Enterprise Edition Software v 1.2.1" on the Java 2 SDK, Enterpise Edition download page
  • Decide how you want the software downloaded: as one large bundle or in multiple, smaller files. Click the appropriate radio button. Your choice here depends on the reliability of your Internet connection. Try downloading as one large bundle. If this fails, try downloading in multiple files. Because these multiple files cannot be installed individually, you will have to concatenate them together when you install J2EE SDK 1.2.1. This is described in the instructions for "Installing the Solaris Software Bundle" (see Step 3: Install and configure J2EE SDK 1.2.1 for Solaris).
  • Click the Select a Platform button and select Solaris SPARC.

The Pet Store 1.1.2 application also deploys and runs on Java 2 SDK, Enterprise Edition v. 1.3 Beta. This version can be downloaded from the Java 2 SDK, Enterpise Edition download page

Step 3: Install and Configure J2EE SDK 1.2.1 for Solaris

Follow the instructions in the section "Installing the Solaris Software Bundle" on the J2EE SDK Installation page. You can ignore number 5 "Install the documentation" and number 6 "See where do I go from here".

Step 4: Start the J2EE SDK Server

To start J2EE SDK server, execute the following command from a terminal window:

j2ee -verbose

When startup is complete, you should see the message:

J2EE server startup complete

Step 5: Download the Java Pet Store Application

You can download the Java Pet Store Application version 1.1.2 from the Java 2 Platform, Enterprise Edition Download and Specification page. Go to the section "J2EE Blueprints" and the subsection "Java Pet Store sample application". You can download the application in zip format.

To unzip the downloaded application:

  • Change your directory to the directory that contains the download, for example: cd /home/j2dep
  • Unzip the file: unzip jps-1_1_2.zip or jar -xvf jps-1_1_2.zip

Step 6: Install and Configure the Java Pet Store Application

  • Set the environment variable J2EE_HOME to the base directory of the J2EE SDK. For example, if you installed the J2EE SDK in /home/j2dep~/j2sdkee1.2, set J2EE_HOME to /home/j2dep/~/j2sdkee1.2. 
  • Set the environment variable JAVA_HOME to the base directory where you installed the Java 2 SDK. For example, set JAVA_HOME to ~/jdk1.3.
  • Start the Cloudscape database manager (in the J2EE SDK):
    • Change the directory to $J2EE_HOME/bin
    • Enter the command: run cloudscape -start
  • Start the deploy tool (in the J2EE SDK):
    • Change the directory to $J2EE_HOME/bin
    • Enter the command: deploytool
  • Open the application. In the deploy tool:
    • Select the File menu.
    • Select Open Application
    • Enter file name: /home/j2dep/jps1.1.2/petstore.ear
  • Deploy the application. In the deploy tool:
    • Select the Tools menu.
    • Select Deploy Application
    • Go through the dialog boxes to complete the deployment. You can use the default settings.

Step 7: Run the Java Pet Store Application

  • Open your Web browser.
  • Specify the URL: http://localhost:8000/estore/index.html
  • Follow the instructions provided with the application to populate Java Pet Store database tables.

Notes

  • It might take a while for a page to appear for the first time after you you deploy the Java Pet Store application or when a J2EE server is restarted. Please be patient. JSP pages are compiled to servlets on demand, so an initial access to a web page that invokes JSPs incurs some extra latency. Subsequent access to the web page should be faster.
  • You do not have to access the Java Pet Store application to check that the J2EE SDK server is running. Simply point your browser to http://hostname:port, where hostname is the host on which the J2EE SDK server is running, and port is the port number to which the J2EE SDK server is listening. For example, point to: http://localhost:8000/index.html
  • The best way to shut down the cloudscape database and ensure proper cleanup is to:
    • Change the directory to $J2EE_HOME/bin
    • Enter: cloudscape -stop
  • There are two ways to uninstall the application from the J2EE SDK server. You can use the uninstall feature of the deploy tool, or you can:
    • Shutdown the J2EE SDK server .
    • Shutdown the database.
    • Change the directory to $J2EE_HOME/bin
    • Run the cleanup script.
  • The deployment tool can leave files in temp directories. To delete these files, examine the system temp directories and your home directory. Remove files that start with "j2ee", such as .j2eedeploytoolfile.
  • You can use a database other than cloudscape. For example, you can use an Oracle database (see Running Deployathon Online! With an Oracle Database). If you use another database, you need to ensure that its JDBC drivers are in the J2EE_CLASSPATH of userconfig.bat file or userconfig.sh file in the J2EE SDK. You must also ensure that the default.properties file (in the config directory of your J2EE SDK installation) is set up to use the data sources in your new database. You also need to populate your database with the data for the sample application.

Running 2001 J2EE Deployathon Online! With an Oracle Database

  • Include the Oracle JDBC driver in the J2EE classpath. You should do this before you start the J2EE SDK server.
    • On UNIX systems:
      • In the $J2EE_HOME/bin/userconfig.sh file:
        • Uncomment the line J2EE_CLASSPATH=, and add your driver archive to the line, as follows:
          J2EE_CLASSPATH=/home/yourhome/oracle.zip
        • Uncomment the line EXPORT J2EE_CLASSPATH
    • On Windows systems:
      • In the %J2EE_HOME%\bin\userconfig.bat file, uncomment the line J2EE_CLASSPATH=, and add your driver archive to the line, as follows:
        J2EE_CLASSPATH=c:\oracle.zip
  • Change the jdbc.drivers and jdbc.datasources properties in the default.properties file to include a reference to the Oracle database. If you have a standard version of Oracle installed on your machine and you are using the default ORCL database, specify the following for the jdbc.drivers and jdbc.datasources properties on one line:
    jdbc.drivers=oracle.jdbc.driver.OracleDriver
    jdbc.datasources=jdbc/EstoreDB|jdbc:oracle
    :thin:@localhost:1521:ORCL|jdbc/InventoryDB|
    jdbc:oracle:thin:@localhost:1521:ORCL
  • Change the user name and password for each enterprise bean resource reference. Alternatively, you can create a new user account in your target Oracle database. To change the user name and password:
    • In the deploytool, select each enterprise bean.
    • Select theResourceReference tab.
    The default username is set to estoreuser and the password is set to estore.
    If you create a new user account, create a new user called estoreuser with the password of estore in the your target database.
  • The Java Pet Store 1.1.2 application comes with specific instructions for setting up with a database other than the default database. You can follow the instructions for using Java Pet Store with another database at the installation directory [installation_dir]/docs/jps/otherdatabases.html

Support

The j2eeblueprints interest list is the place to get answers to questions about running the Deployathon with Java 2 SDK, Enterprise Edition 1.2.1 for Solaris. To join the interest list, send an email to listserv@java.sun.com. Specify subscribe j2eeblueprints-interest yourlastname yourfirstname in the body of the email.

Back to Top
Introduction