Tutorial for building J2EE applications using JBoss and eclipse chapter 3

Source: Internet
Author: User
Tags jboss

When reading this chapter, there is basically no obstacle, but there is a local article that is wrong.

In the create Dao interface section,"Go to SRC> Add package named au.com. tusc. Dao> Add a class storeacessdaoimpl in that package"The red font is incorrect. It should be storeaccessdaoimpl.

Another reason is that different versions of JBoss and lomboz are used.Ejbgenerate. xmlThe file correspondsXDoclet. xmlFile.

Stateless Session Bean

The steps required to create an EJB component are described in mastering EJB 2nd.

1. Write the. java files that compose your bean: The component interfaces,
Home interfaces, enterprise Bean class file, and any helper classes you
Might need. With the help of lomboz, I only need to write the enterprise Bean class file. In this chapter, storeaccessbean is the enterprise Bean file. Add several tags at the beginning of the file, such as @ EJB. Dao. lomboz will automatically generate the storeaccessdao file.

2. Write the deployment descriptor. lomboz will automatically create the relevant deployment File

3. Compile the. java files from step 1 into. class files. Writing your first Bean

4. Using the jar utility, create an EJB-JAR file containing the deploymentdescriptor and. class files.

5. deploy the EJB-JAR file into your container in a vendor-specific manner, perhaps by running a vendor-specific tool or perhaps by copying yourejb-JAR file into a folder where your container looks to load EJB-jar files.

6. configure your EJB server so that it is properly configured to host yourejb-JAR file. you might tune things such as database connections, thread pools, and so on. this step is vendor-specific and might be done through
Web-based console or by editing a configuration file.

7. Start your EJB container and confirm that it has loaded your EJB-JAR file.

8. optionally, write a standalone test client. java file. compile that test client into. class file. run the test client from the command line and have it exercise your bean's APIs.

3 ~ Step 8 lomboz will automatically help me. It seems that with lomboz, you can really focus on developing business logic.

However, when this example is implemented, a typical error of deploying ejbs occurs again, that is, the tag statement is wrong, which can only be known after deployment, it cannot be compiled for verification, and it is difficult to find an error. The only way is to open the lomboz document and copy and paste it. I hope there will be fewer errors. Or wait until I find a more advanced tool for verification.

Related Article

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.