The first EJB program under J2EE Server (advanced text and text)

Source: Internet
Author: User
Author: Weng Chiyuan
Editor's note: to help beginners of J2EE in China, I wrote this article, hoping to help Java enthusiasts.
Article content:
1. This document demonstrates how to configure a standard J2EE development environment step by step.
2. Start cloudview of the cloudscape database and create a database.
3. Let the reader develop the first EJB program
4. Set the datasource of the EJB and deploy the application.
Development Environment:
The development environment uses SUN's j2sdk1.4 and j2sdkee1.3.1 (note: for j2sdk versions, any version later than 1.3.1 _ 02 ). Database: The cloudscape database that comes with j2sdkee.
1. Configure the system environment
Are you sure you have downloaded jdk Version j2sdk1.3.1 _ 02 or above and j2sdkee. 1.3.1 these software can go to sun's website to find http://java.sun.com currently j2se's highest version is j2sdk1.4. Then install the above Software. My installation directory is in H: disk. Before installation, if you have installed jdk of different versions, uninstall them before installation. After installation, set classpath. windows as follows: for convenience, add most of the paths.
Set JAVA_HOME = h: j2sdk1.4
Set J2EE_HOME = h: j2sdkee1.3.1
Set classpath = h: j2sdk1.4jrelibjaws. jar;
H: j2sdk1.4libdt. jar;
H: j2sdk1.4libools. jar;
H: j2sdkee1.3.1libejb10deployment. jar;
H: j2sdkee1.3.1libj2ee. jar;
H: j2sdkee1.3.1libjhall. jar;
H: j2sdkee1.3.1libj2ew.ls. jar;
H: j2sdkee1.3.1lib;
The above is the directory on my machine. If you install it on different directories, please change it on your own
If the operating system is win98, this file must be run or restarted to take effect.
In this way, you can smoothly start j2ee and run the % j2ee_home % inj2ee-verbose command in the dos window, the prompt of J2EE server startup complete appears in the DOS window (as shown below ).
Open the browser and enter http: // localhost: 8000/index.html. You can see that the home page shows that the configuration is correct and the J2EE application server is successfully started. (As shown in the following figure)
2. Start the database
Add the following path
H: j2sdkee1.3.1libsystemcloudutil. jar; h: j2sdkee1.3.1libcloudscapecloudclient. jar;
H: j2sdkee1.3.1libcloudscapemijdbc. jar; h: j2sdkee1.3.1libsystemcloudscape. jar;
The key issue lies in how to bring up the graphic management interface of the cloudscape database! If you type java COM. cloudscape. tools. cview in the command line mode, an error may occur. Why? First, check whether your jdk version is correct, such as 1.3.1 _ 02 or later, or 1.4. Second, the key is that the cloudview in sun's j2ee cannot work in the cloudscape4.0.6 that he has attached (I really don't know what sun is doing :))

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.