uCosminexus Application Server, System Setup and Operation Guide

[Contents][Glossary][Index][Back][Next]

Appendix M.6 JavaBeans resource sample program

Following directory stores the sample program that uses JavaBeans resource.

Cosminexus-installation-directory\CC\examples\javabeans

Following is the overview and the execution procedure of the sample:

Organization of this subsection
(1) Overview of JavaBeans resource sample program
(2) Execution procedure of JavaBeans resource sample program

(1) Overview of JavaBeans resource sample program

The following figure shows the configuration of JavaBeans resource sample program:

Figure M-35 Configuration of JavaBeans resource sample program

[Figure]

This sample program displays the value on the browser on the basis of the information of each setting specified in the properly of the JavaBeans resource property file.

Following figure shows the execution example of the sample program:

Figure M-36 Execution example of JavaBeans resource sample program

[Figure]

(2) Execution procedure of JavaBeans resource sample program

Following procedure describes the method of executing the sample program:

(a) Compiling sample programs

Compile sample programs by using the batch file (compile.bat) provided in the sample. This batch file creates JavaBeans resource (MyJavaBean.jar) and EAR file (LookupBean.ear).

(b) Setting the J2EE server

See Appendix M.1(1) Setting the J2EE server.

(c) Customizing the J2EE server

See Appendix M.1(2) Customizing the J2EE server.

(d) Starting the J2EE server

See Appendix M.1(3) Starting the J2EE server.

(e) Importing and starting JavaBeans resource

Use the batch file (deployJb.bat) provided in the sample to deploy JavaBeans resource. This batch file imports and starts JavaBeans resource.

Following is the process executed by this batch file:

(f) Deploying the application

See Appendix M.1(5) Importing, setting and starting the application

(g) Executing the application

Start the browser and specify the following string in the URL:

http://Machine-name: Port-number/ContextRoot/servlet/LookupBeanServlet

If the in-process HTTP server is available, the following URL is specified by default:

http://localhost/web_jb/servlet/LookupBeanServlet

(h) Undeploying the application

See Appendix M.1(6) Stopping and deleting the application.

(i) Stopping JavaBeans resource

Stop the JavaBeans resource with the cjstopjb command.

C:\>cd Program Files\Hitachi\Cosminexus\CC\admin\bin
C:\Program Files\Hitachi\Cosminexus\CC\admin\bin>cjstopjb MyServer -resname JavaBean_resource
(j) Restarting the J2EE server

Stop the J2EE server with the cjstopsv command and start with the cjstartsv command. For the method of stopping the J2EE server, see Appendix M.1(7) Stopping the J2EE server. For the method of starting the J2EE server, see Appendix M.1(3) Starting the J2EE server.

(k) Deleting JavaBeans resource

Delete JavaBeans resource with the cjdeletejb command.

C:\>cd Program Files\Hitachi\Cosminexus\CC\admin\bin
C:\Program Files\Hitachi\Cosminexus\CC\admin\bin>cjdeletejb MyServer -resname JavaBean_resource
(l) Stopping the J2EE server

See Appendix M.1(7) Stopping the J2EE server.