Borland®
Shop
Products Downloads Services Support Partners News & Events Company Community
Borland Enterprise Server
AppServer Edition
VisiBroker Edition
Web Edition
Documentation
Platforms
Support

AppServer 4.5
Documentation
Platforms
Support

Run J2EE™ Pet Store Application 1.1.2 with the Borland® AppServer™ 4.5

<
Introduction
 
To host the Pet Store Application on a J2EE server you must provide the server-specific deployment meta-data for that server. This document walks you through this with the Borland AppServer as the target server using the accompanying collateral.
 Download and Install Borland AppServer
 

If you do not already have Borland AppServer then you can download a fully functional trial copy of Borland AppServer from http://www.borland.com/appserver.

Follow the instruction in the Installation Guide.

 Download and Install J2EE Pet Store
 

Download the Sun's Java(TM) Pet Store 1.1.2 from http://java.sun.com/j2ee/download.html#blueprints and unzip it, or use the provided EAR in the Borland Pet Store collateral.

The remainder of this document will refer to the unzipped jps1.1.2 directory as <jps1.1.2>.

 Download and Install Borland Pet Store Collateral
 

Download the Borland Pet Store collateral from http://www.borland.com/devsupport/appserver/downloads/4_5/borland_petstore112.zip and extract into <jps1.1.2>.

This will result in a the creation of a <jps1.1.2>\borland directory and a <jps1.1.2>\src\petstore\src\borland_build.bat file.

 

 Deploy Datasource Definitions for Pet Store

 

Datasource definitions and an Oracle JDBC driver have been provided in the accompanying collateral:

  • <jps1.1.2>\borland\jndi-definitions.xml.
  • <this_download>\lib\classes12_01.zip (you must use this version of the Oracle Driver!)

The datasources are configured to use Oracle driver datasources (soon will be JDatastore, but not today). Edit the <driver-datasource> entries to match your Oracle configuration.

First deploy the Oracle driver and restart the server to get it on the server's classpath:

  • Run up the Borland AppServer Console, select the Wizards menu and select the J2EE Deployment Wizard.
  • On Step 1 browse to <jps1.1.2>\borland\lib and select classes12_01.zip then Next
  • On Step 2 just Next to Step 3
  • On Step 3 just Next to Step 4
  • On Step 4:
    • If you only have one server running then simply click on Add All Targets then Next.
    • Otherwise:
      • Click on Add AppServer and select the your target server
      • Click Next
  • Once the archive has been deployed to the server you will be able to select Finish. The server should be automatically restarted.

Then deploy the jndi-definitions to the server:

  • Run up the Borland AppServer Console, select the Wizards menu and select the J2EE Deployment Wizard.
  • On Step 1 browse to <jps1.1.2>\borland and select jndi-definitions.xml then Next
  • On Step 2 just Next to Step 3
  • On Step 3 just Next to Step 4
  • On Step 4 check the "Deploy jndi objects to the Name Service" option then Next.
  • Once the archives have been deployed to the server you will be able to select Finish
 Deploy Pet Store To Borland AppServer
 

You can either just deploy the borland_petstore.ear provide in <jps1.1.2>\borland\borland_petstore.ear or take a virgin Sun Pet Store and deploy that.

Deploying the provided borland_petstore.ear:

Run up the Borland AppServer Console, select the Wizards menu and select the J2EE Deployment Wizard.

  • On Step 1 browse to <jps1.1.2>\borland and select borland_petstore.ear then Next
  • On Step 2 just Next to Step 3
  • On Step 3 just Next to Step 4
  • On Step 4:
    • If you only have one server running then simply click on Add All Targets then Next.
    • Otherwise:
      • Click on Add AppServer and select the your target server
      • Click Next
  • Once the archives have been deployed to the server you will be able to select Finish

Deploying a virgin Sun Pet Store:

  • Add the Inprise deployment descriptors:
    • cd to <jps1.1.2>\src\petstore\src
      • Set the environment variable BAS_INSTALL to path for your Borland AppServer installation directory.
      • Run "borland_build.bat". to produce a <jps1.1.2>\src\petstore\src\borland_petstore.ear.
        The script simply builds the Pet Store and adds Borland AppServer deployment descriptors.

        Note: Ignore the following errors, these are a result of the Sun Pet Store build system attempting to build an EAR for the Sun J2EE Reference Edition platform.
        Executing Target: ear
        [error] java.lang.NoClassDefFoundError: com/sun/enterprise/tools/packager/Main
        [error] Exception in thread "main"
        [exec] Result: 1
        Executing Target: runtime
        [error] java.lang.NoClassDefFoundError: com/sun/enterprise/tools/packager/Main
        [error] Exception in thread "main"
        [exec] Result: 1
        [error] java.lang.NoClassDefFoundError: com/sun/enterprise/tools/packager/Main
        [error] Exception in thread "main"
        [exec] Result: 1             
  • Use the Borland Deployment Descriptor Editor to configure the resulting borland_petstore.ear to target Oracle to change an informational environment variable from "Sun Reference" to "Borland AppServer":
    • Run up the Borland Deployment Descriptor Editor (ddeditor)
      • Open <jps1.1.2>\src\petstore\src\ borland_petstore.ear
      • Select customerEjb.jar module, select TheOrder EJB then on its Environment tab change the ejb/order/OrderDAOClass property value from com.sun.j2ee.blueprints.customer.order.dao.OrderDAOCS to com.sun.j2ee.blueprints.customer.order.dao.OrderDAOOracle (i.e. You can do this by simply replacing the string OrderDAOCS with OrderDAOOracle. )
      • Select petstore.war module and on its Environment tab change the server/ServerType property value to Borland AppServer 4.5.
      • Save and Exit
    • Deploy the resulting EAR file to the server as for "Deploying the provided borland_petstore.ear" above
 Access Pet Store
 

Browse to http://localhost:8080/estore

 

 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.

 
Site Map Search Contact