|
Contents
WebDepOT (Web Deployment on Sun ONE Technology) demonstrates the use of Sun ONE technology to construct m-commerce solutions that implement the architecture described in the accompanying article on Sun's Wireless Developer site. It is an extension of an earlier application, m-RMS, now built using Sun ONE and iPlanet. WebDepOT demonstrates the use of several Sun ONE technologies: J2EE, J2ME (both CLDC and MIDP), XML, WML/WAP, iPlanet Application Server, iPlanet Web Server, and Forte Tools.
WebDepOT comprises a client application
and a server application. The client can run on PDAs, JavaPhones, and desktop
browsers. Except for a trivial difference it is identical to m-RMS.This
read-me file will focus on the server application, called here a wireless
portal server, and will demonstrate how to use the iPlanet Application
Server and iPlanet Web Server, the associated development toolkits, and
the Forte tools to develop and deploy the WebDepOT wireless portal server
on the Sun ONE platform. For details on the WebDepOT client application,
please refer to m-RMS at
http://wireless.java.sun.com/midp/articles/mcommerce/readme.html.
For details on the design and description of the WebDepOT server-side J2EE
components (JSP pages, servlets, EJB components), refer to http://developer.java.sun.com/developer/technicalArticles/J2EE/rms/.
The WebDepOT Wireless Portal Server The WebDepOT wireless portal server is a J2EE and XML implementation and consists of three tiers:
The web server constitutes the web tier in the four-tier end-to-end architecture described in the accompanying article. It hosts the following:
All sets of JSP pages and servlets use the same JavaBeans components, EJB components, and database. RequirementsTo install and run the WebDepOT wireless portal software, you need:
The iPlanet Application Server and Web Server software include various configuration and deployment tools. The instructions below for installing and running the WebDepOT portal server assume you are using these tools and an Oracle database. You can configure and deploy the WebDepOT server to run with another database or with another application server, such as BEA WebLogic 5.1, however. Of course you will need to use appropriate deployment tools, and follow instructions specific to them. Installing and Running the WebDepOT Wireless Portal ServerTo install the WebDepOT portal, perform the following steps: Step 1. Download the demonstration portal software. Download the archive containing the server-side software, WebDepOT-server.zip. Step 2. Extract the portal software from the archive. Issue the following command: unzip WebDepOT-server.zip The utility will extract files into these directories:
Two more files will be extracted from the portal archive:
Step 3. Install, configure, and run the web server and application server. Download iPlanet Web Server 6.0 and iPlanet Application Server 6.0 from\ http://www.iplanet.com Follow the associated documentation to install the servers. The iPlanet documentation also includes detailed documentation on running the servers, but starting them up is usually a simple matter of executing five commands in the right order. Try these:
Shutting the servers down is equally easy. As you might expect, you stop the servers in the reverse of the order you started them. Execute these commands:
iPlanet_appserver_HOME is the
home directory for iPlanet Application Server; for example,
/usr/iplanet/ias6
Step 4. Download and Install Forte for Java Enterprise edition. If you wish to use the Forte Tools for compiling, assembling, packaging, and deploying the WebDepOT application software, download Forte for Java Enterprise Edition 3.0 from http://www.sun.com/forte. Install and configure the IDE, following the instructions in the associated documentation. Step 5. Download and install Oracle RDBMS. Install Oracle RDBMS 8i or 9i, following instructions provided by Oracle, and start it. Step 6. Set up the database and register it with the application server. Using the SQL scripts you extracted from the sqlscripts.zip earlier, create the tables WebDepOT needs for storing information about proposals, projects, and resources:
WebDepOT.sql
Verify that the SQL scripts generated no significant errors. (You may ignore errors about dropping nonexistent tables. To make the application work under different sets of conditions, the scripts begin by attempting to drop a number of tables.) All database access is performed through the JDBC (Java Database Connectivity) API. You need the JDBC driver classes for the Oracle database. You'll find these with the database software, in ORACLE_HOME/jdbc/lib/classesXX.zip. Add this file to the iPlanet Application Server's runtime classpath. Using iPlanet Application Server's administration server, register the Oracle data source as instructed in the server's installation and configuration reference manual. Essentially, you will run the following command: iPlanet_appserver_HOME/iasdeploy regdatasource oracle-thin.xml where oracle-thin.xml is an XML file with the following content:
<ias-resource>
Step 7. Compile the servlets and the EJBs. Note: Skip this step and the next (Steps 6 and 7) if you want to deploy the pre-assembled WebDepOT.ear application module provided in the WebDepOT-server.zip download. To compile the servlets, the JavaBean and EJB components, run the script build.sh provided in WebDepOT-server.zip. (As an alternative, you may use Forte for Java Enterprise Edition to compile the WebDepOT application.) The script compiles the appropriate Java source files and puts the compiled classes in a destination directory it creates named build. In addition, it also copies the JSP and HTML pages into the build directory. These classes and pages may then be loaded from the build directory for assembly and packaging as described in the next step. In order to compile the servlets and enterprise beans, you will need to set the implementations of the following in the classpath:
JDK1.2 or higher
Step 8. Assemble and package the enterprise beans, servlets, and JSP pages. Here we walk you through the process of using the iPlanet packaging and deployment tools to assemble and package the EJB components, servlets, and JSP pages. If you prefer, you may use the Forte for Java Enterprise Edition to assemble and package the WebDepOT application. Bring up the iPlanet GUI deployment tool by issuing the command: iPlanet_appserver_HOME/ias/bin/deploytool
You'll now use iPlanet deploytool to create a Web module and a JAR module, and to package them in a J2EE application EAR module. Assemble the Web module Create the WebDepOT WAR module named WebDepOTwar.war and insert into it all the JSP pages, servlet classes, HTML pages, GIF files, and helper beans.
Configure the WAR module by right-clicking the file WebDepOTwar.war and providing the configuration information required by the window that pops up. Besides the general information that will seem intuitive, you must provide information that's not immediately obvious: You must map each servlet class to a new name. For example, map the servlet class named propList to /propListAlias. These mappings will enable the J2ME/MIDP WebDepOT client to access the servlets appropriately, and must be done for each servlet class in the WebDepOT package. In the Reference section, add a reference to the session bean that the servlets and JSP pages access.
Reference: ejb/rmsBean
The tool will write all this configuration information into the web.xml and ias-web.xml files in the WAR module WebDepOTwar.war. Assemble the JAR module Use the iPlanet deploytool to create the WebDepOT jar module called WebDepOTjar.jar and insert into it all the EJB components.
As with the WAR module, configure the JAR module by right-clicking each of the EJB components and supplying the configuration information required by the window that pops up. For the two entity beans, provide the following information: In the General section, enter the Primary Key as java.lang.String
In the Reference section, add a resource as follows:
In the environment section, add an environment variable as follows:
For the session bean RMSBean, specify these values:
State Management Type: Stateless
In the References section, add the resource described above for the two entity beans
Resource Name: jdbc/OracleDB
In the same section also add references to the two entity beans that the session bean will access, propBean and projBean. For propBean, specify these values:
Reference: ejb/propBean
For projBean, supply these values:
Reference: ejb/projBean
The tool will write all the information into the two descriptor files ejb-jar.xml and ias-ejb-jar.xml, packaged inside the JAR module WebDepOTjar.jar. Assemble the EAR module. Finally, create the WebDepOT EAR module called WebDepOT.ear and insert into it the WebDepOTwar.war and WebDepOTjar.jar modules you just created.
As before, right-click the WebDepOT.ear module and provide the one piece of configuration information required: In the Context Root section, specify the Context Root to be WebDepot. Save all the above configuration and assembly information to complete your creation of the final J2EE application module WebDepOT.ear. Step 9. Deploy the demo application. Use iPlanet deploytool to deploy WebDepOT as: iPlanet_appserver_HOME/ias/bin/iasdeploy deployapp WebDepOT.ear where WebDepOT.ear is the J2EE module you created in Step 8. Alternatively you can use the Forte for Java Enterprise Edition IDE to deploy the WebDepOT application on iPlanet. Downloading, Installing, and Running the WebDepOT Client Application. You won't be sure the server does its job until you install and run the WebDepOT client-end J2ME software. Follow the instructions at http://wireless.java.sun.com/midp/articles/mcommerce/readme.html#m-RMSclientapplication. Accessing the WebDepOT Server Application from the Client. Access the WebDepOT server application in any of the three modes and configurations described at http://wireless.java.sun.com/midp/articles/mcommerce.
If you use the J2ME client, you will need to set the following preferences, the first time the J2ME application is run: IP Address: hostname where hostname is the name of the machine on which the WebDepOT portal server is installed. References
| |||||||||
|
| ||||||||||||