Tutorial for building J2ee Applications Using Jboss and Eclipse Chapter 3

zhaozj2021-02-16  80

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

In the Create Dao Interface section, "Go to SRC> add package named au.com.tusc.dao> Add a class storessdaoimpl in That Package" red font is wrong, it should be StoreAccessDaoImpl.

It is because uses different versions of JBoss and Lomboz, so the ejbgenerate.xml file in the article is xdoclet.xml file.

Stateless session bean

According to the description of Mastering EJB 2nd, a few steps needed to establish an EJB Component

1. Write the .java files That Component Interface: The Component Interfaces, Home Interfaces, Enterprise Bean Class File, And Any Helper Classes Youmight Need. This step is because there is a help of Lomboz, I just need to write Enterprise Bean Class files, here The example of one chapter is that StoreAccessBean is an Enterprise Bean file. Then add a few tags in the beginning of this file, such as @ ejb.dao, Lomboz automatically generates a StoreAccessDao file.

2. Write the deployment descriptor. Lomboz automatically creates related deployment files

3. Compile the .java files from step 1 INTO .CLASS FILES.WRITI 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 aWeb-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 Test Client Into a .class file. Run The Test Client from The Command Line and have it exercise your bean's apis.

3 ~ 8 steps Lomboz will automatically finish me. It seems that Lomboz can really concentrate on business logic. However, when this example is realized, a typical mistake of deploying EJB has happened again. It is a TAG statement written wrong. These things can only be known after deployment, can't compile, and it is not wrong. It is easy to find, it is really trouble. The only way is to open the Lomboz document, then copy the paste, I hope this will be less wrong. Or wait for me to find more advanced tools to check, I have had this hamoy.

转载请注明原文地址:https://www.9cbs.com/read-14967.html

New Post(0)