Accessibility
Home / DevNet / Pet Market Application Center
DevNet
DevNet Article
Deploy the Java™ Pet Store on a local copy of JRun 4

Introduction
Step 1: Download J2EE™ SDK 1.3.1 for your OS
Step 2: Copy cloudscape.jar to JRun
Step 3: Download the Java Pet Store application
Step 4: Extract the Java Pet Store JRun server and application
Step 5: Configure the Java Pet Store JRun server
Step 6: Start the Java Pet Store JRun server
Step 7: Run the Java Pet Store Application
Notes
Support

Introduction
These instructions explain how to deploy the Java Pet Store Blueprints application on Macromedia JRun 4. They assume that you have already installed JRun 4 and the Java 2 SDK, Standard Edition (J2SE) v 1.3 or higher. You can download JRun 4 from the Macromedia website and can download J2SE from the Sun website.

Step 1: Download J2EE SDK 1.3.1 for your operating system
If the J2EE SDK version 1.3 or higher is not already installed on your computer, download it using the instructions in the section "Download Java 2 SDK, Enterprise Edition Software v 1.3.1" on the Java 2 SDK, Enterpise Edition download page.

Step 2: Copy cloudscape.jar to JRun
Copy cloudscape.jar from the j2eesdk_root/lib/system directory to the jrun_root/servers/lib directory.

Step 3: Download the Java Pet Store JRun Server and Application
Download the Java Pet Store application (version 1.3.1) pre-configured in a JRun server now: http://www.macromedia.com/go/blueprint_dl_jrun.zip

Step 4: Extract the Java Pet Store JRun Server and application
Use the WinZip, Zip, or tar utilities as appropriate to uncompress and extract the files. When extracting the files, place them in the jrun_root/servers directory. This creates a directory named jrunpetstore.

The jrunpetstore server directory contains the following:

  • Java Pet Store EAR files, which are exactly the same as those in the Pet Store download from the Java Blueprints website. Feel free to delete these EAR files and copy in EAR files dowloaded from the Java Blueprints website.
  • Configuration files, which are all located in the SERVER-INF directory. In particular, the SERVER-INF/jrun-resources.xml file contains definitions for JDBC data sources, JMS queues, and factories. Click here if you want to manually configure a JRun server to run the Java Pet Store.

Step 5: Configure the Java Pet Store JRun server
Define the server to JRun by opening the jrun_root/lib/servers.xml file in a text editor and adding the following lines:

...

<server>

	<name>jrunpetstore</name>

	<directory>{jrun.home}/servers/jrunpetstore</directory>

</server>

...
Be sure to add the server definition inside the <servers>...</servers> root element.

Step 6: Start the Java Pet Store JRun server
Start the Java Pet Store JRun server from a console. For example, use the following command:

jrun_root/bin> jrun -start jrunpetstore

Step 7: Run the Java Pet Store application
To run the Pet Store application:

  1. Open your Web browser.
  2. Specify the following URL:
    http://localhost:8300/petstore

  3. To populate the databases and start the Pet Store application, click the "enter the store" link on the Pet Store demo start page.

Notes
To access the Pet Market application on the server, browse from your client machine to http://localhost:8500/petmarket/store.html, where "localhost" is replaced with the server's domain name.

  • JRun requires no edits to the Pet Store deployment descriptors.

  • There may be a delay when the JRun server starts up for the first time. JRun creates the tables used for the CMP 2.0 EJBs. Subsequent server startups should not experience this delay.

  • The jrunpetstore server uses the following ports:
    • 8300 - JRun web server port, specified in SERVER-INF/jrun.xml.
    • 2912 - JNDI port, specified in SERVER-INF/jndi.properties (also named in SERVER-INF/jrun-jms.xml).

    If port conflicts occur when starting JRun, change these to unused port numbers.

  • When starting the Pet Store application, JRun logs benign errors and uncaught exceptions thrown by the Pet Store application, including JMC, CMP, and authentication errors. You can ignore these errors.
  • When you start the JRun server, JRun creates a database under jrun_root/bin/petstore. If you get an error during start-up, try deleting the jrun_root/bin/petstore directory and starting the server again.
  • If you start the JRun server from the Launcher and get an error, try starting the server from the command line. The Launcher imposes a 30-second time limit on starting JRun servers. If a server takes longer than that to start up, JRun assumes there is a problem and aborts the start-up. Depending on the speed of your machine, the server running Pet Store might take longer than 30 seconds to start up.
  • To undeploy the Java Pet Store application, delete the EAR files from the jrun_root/servers/jrunpetstore directory.
  • To delete the Java Pet Store JRun server, either remove the server definition in the jrun_root/lib/servers.xml file with a text editor or use the Remove Server button in the JMC's Available Servers pane.
Support
To get answers to questions about running the Deployathon with Java 2 SDK Enterprise Edition, subscribe to the j2eeblueprints interest list by sending an email to listserv@java.sun.com. Specify "subscribe j2eeblueprints-interest your_last_name your_first_name" in the body of the email.

Back to top
Introduction