The objective of this session is to deploy a simple BI Beans JSP application to a server with a JSP engine.
After development, the application should be deployed to a J2EE-compliant production server. To accomplish this, set up the server and deploy directly from the JDeveloper environment.
Several web servers contain JSP and servlet support to run BI Thin Beans including Oracle Application Server 10g Containers for J2EE (OC4J), Oracle Application Server Apache/JServ, Oracle Servlet Engine (OSE), Jakarta Tomcat, Sun iPlanet, BEA WebLogic Enterprise, IBM WebSphere, Allaire JRun, and so on. Oracle Application Server Apache/JServ is based on the Apache/JServ engine, which complies with Java Servlet Specification 2.0, while the other web servers that were mentioned comply with Java Servlet Specification 2.2. For more information about J2EE application deployment, refer to the JDeveloper Help topics on packaging and deploying.
This exercise will demonstrate deployment to a standalone OC4J server. Ensure
that JDK 1.3.1 and OC4J are installed on your production machine. The JDK home
directory will be referred to as <jdk_home>
and the OC4J
home directory will be referred to as <oc4j_home>
.
OC4J supports all types of J2EE applications: Web applications that contain servlets and JSPs and Enterprise JavaBeans applications that contain JavaBeans. The following ways are available to deploy J2EE applications:
Deployment to an exploded directory requires direct access to the Web server directory tree. Therefore, this approach is better for the development cycle than for production deployment.
For best results, package WAR files and EJB JARs into a standard J2EE-compliant
Enterprise Application Archive file with the .ear
extension. A
Web Application Archive file with the .war
extension is a single
file that contains all of the components of a web application. An EAR file can
contain several EJB jars or WAR files.
To deploy the application to an OC4J server, you must perform the following tasks:
Stop the OC4J server. Open a command prompt on the server machine, ensure that
the JDK binaries (that is, <jdk_home>/bin
) are in the path,
and use the following command under <oc4j_home>
on the production
machine:
java -jar oc4j.jar
If you are deploying to OC4J within Oracle Application Server, refer
to the JDeveloper Help system for special instructions about how to restart
OC4J within Oracle Application Server.
In JDeveloper, to facilitate the deployment process, specify the connection information to the OC4J server. The following steps are required only the first time that you deploy a web application to OC4J from JDeveloper.
deployConn
and select
Standalone OC4J in the Connection type
list box. Choose Next to continue.<admin-username>
and <admin-password>
respectively.ormi://www.server.com/
.Before you deploy your application, copy your objects to the BI Beans Catalog, which is a persistent database. For directions, follow the tutorial Copying Objects to the BI Beans Catalog to copy the objects. After the objects are copied, the runtime settings for the application are updated automatically to use the objects in the Catalog at runtime.
webapp.deploy
and choose Save.webapp
as the web context root and then choose OK.You have successfully created a new deployment profile named webapp.deploy
.
webapp.deploy
under Project1.jpr
and choose Deploy to deployConn (that is, the connection
name that you specified earlier).
The JDeveloper deployment wizard creates the files webapp.war
and webapp.ear
under the project folder, copies these files to
the OC4J applications directory, and invokes the Oracle Application Server administration
tools to configure the application (that is, to unpack the EAR and WAR files
and edit the XML configuration files within OC4J).
bibeans.deploy
and choose Save.You have successfully created a new deployment profile named bibeans.deploy
.
bibeans.deploy
under Project1.jpr
and choose Deploy to.bibeans.jar
and choose Save.bibeans.jar
.lib
under
<oc4j_home>/applications/webapp/webapp/WEB-INF.
bibeans.jar
from the machine that is running JDeveloper
to the server machine under the newly-created libraries directory <oc4j_home>/applications/webapp/webapp/WEB-INF/lib
.
These libraries will be appended automatically to the application CLASSPATH
at runtime.
You can access the web application in a browser by entering its application
URL,
http://host-name:port-number/virtual-path/filename
,
where:
For example:
http://myMachine.oracle.com:8888/webapp/simpleJSP.jsp
After deployment, you may want to reset the JDeveloper runtime settings so that the application will reference objects locally during development.
Project1BIConfig1.xml
) and choose Settings.You have successfully deployed a simple JSP application from JDeveloper.