Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB3 deployment issue

 
Jiafan Zhou
Ranch Hand
Posts: 193
Fedora Linux Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Shailesh Kini
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jiafan Zhou
Ranch Hand
Posts: 193
Fedora Linux Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic