Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Entity beans and Local interfaces  RSS feed

 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I developed a very simple entity bean and I used local interfaces, because I want to use a session bean facade to access the entity bean. During deployment on Jboss I get the following exception:
<!-- Exception begin -->
22:51:14,390 WARN [verifier] EJB spec violation:
Bean : UsersEJB
Section: 9.2.2
Warning: The entity bean class must not be defined as abstract.
22:51:14,390 WARN [verifier] EJB spec violation:
Bean : UsersEJB
Section: 9.4.7.1
Warning: The primkey-field element must name a public field in the bean implemen
tation class.
<!-- Exception end -->
I developed the implementation class as abstract because it contains some abstract getter and setter methods, according to the EJB 2.x specs. Is it possible to deploy and implementation class as an abstract class? Why I'm getting this error?
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a guess, the DTD for ejb-jar.xml
s'd be different for EJB1.x and EJB2.x Are you by mistake referring to the EJB1.x DTD ?
Yes for EJB2.x, for CMP entity beans, they need to defined as abstract.
Originally posted by Marco Tedone:
Hi, I developed a very simple entity bean and I used local interfaces, because I want to use a session bean facade to access the entity bean. During deployment on Jboss I get the following exception:
<!-- Exception begin -->
22:51:14,390 WARN [verifier] EJB spec violation:
Bean : UsersEJB
Section: 9.2.2
Warning: The entity bean class must not be defined as abstract.
22:51:14,390 WARN [verifier] EJB spec violation:
Bean : UsersEJB
Section: 9.4.7.1
Warning: The primkey-field element must name a public field in the bean implemen
tation class.
<!-- Exception end -->
I developed the implementation class as abstract because it contains some abstract getter and setter methods, according to the EJB 2.x specs. Is it possible to deploy and implementation class as an abstract class? Why I'm getting this error?
 
Edy Yu
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using BMP for your entity bean, have can't define it as abstract class.
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by karthik Guru:
Just a guess, the DTD for ejb-jar.xml
s'd be different for EJB1.x and EJB2.x Are you by mistake referring to the EJB1.x DTD ?
Yes for EJB2.x, for CMP entity beans, they need to defined as abstract.

Actually it was a mispelling in the dtd definition. Thanks, Marco
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!