Integrate a simple EJB3 program with Hibernate3.2, and when deploying the program, the following exception has been shown on the ant console.
deploy: [echo] asadmin.bat deploy --user admin --password 12345678 --host localhost --port 4848 --upload=true lib/chapter2.ear [exec] CLI171 Command deploy failed : Deploying application in domain failed; Error loading deployment descriptors for module [chapter2] -- Invalid ejb jar [chapter2-ejb.jar]: it contains zero ejb. [exec] Note: [exec] 1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or message driven bean. [exec] 2. EJB3+ entity beans (@Entity) are POJOs and please package them as library jar. [exec] Result: 1
Any idea what is going wrong here?
Thanks, Jiafan
SCJP, SCJD, SCWCD, SCBCD, SCEA
Shailesh Kini
Ranch Hand
Joined: Oct 17, 2001
Posts: 153
posted
0
Hi Jiafan,
What version of the appserver are you using to run this sample?
It is just complaining about the chapter2-ejb.jar file that it does not have any ejb's to be deployed. Please check if your chapter2.ear file is valid.
Sun Java System Application Server Platform Edition 9.0_01 (build b02-p01) is the EJB container I am using.
The chapter2-ejb.jar contains a stateless session bean.
I think the problem here is that because I have all the object model beans in another jar file which will be persisted into database via Hibernate. Does chapter2-ejb.jar need to contain the entity beans? How about using the hibernate approach?
What I want to achieve here is that I want to combine EJB3.0, Hibernate, and postgreSQL together. I am reading the "EJB3 in action" which only covers the default EJB3.0, JPA and derby as the database.
Needs some help on this.
Regards, Jiafan
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.