aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Can I override session bean type in the deployment descriptor? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Can I override session bean type in the deployment descriptor?" Watch "Can I override session bean type in the deployment descriptor?" New topic
Author

Can I override session bean type in the deployment descriptor?

Mellon Sun
Ranch Hand

Joined: Feb 20, 2003
Posts: 126
For instance, there is a stateless session bean annotated with "@Stateless", can I override it to a stateful session bean via the deployment descriptor?

"Type-level, method-level, and field-level annotation can all be overridden by the deployment descriptor.", is this true?


SCJP,SCWCD1.3,SCWCD1.4,SCJD,SCBCD5,SCEA5
Mellon Sun
Ranch Hand

Joined: Feb 20, 2003
Posts: 126
<enterprise-beans>
<session>
<ejb-name>StatelessSBBean</ejb-name>
<ejb-class>com.mellon.StatelessSBBean</ejb-class>
<session-type>Stateful</session-type>
</session>
</enterprise-beans>

It works with the descriptor snippet above, the StatelessSBBean is annotated with @Stateless, how could I confirm the StatelessSBBean is running as an Stateful Session Bean exactly? After all, there is not a
method like "isStateless" or "getSessionType" exists.

And, anyone can cite a case need this?
Manish Shah
Greenhorn

Joined: Jun 09, 2002
Posts: 22
No.

Not all annotations are overridable.

Session bean types like @Stateful or @Stateless cant be overridden via a descriptor.


SCBCD5, SCWCD, SCJP, MCP
Jeya Uma
Greenhorn

Joined: Jan 11, 2009
Posts: 3
If you refer Mikalai Zaikin notes , you can find the following notes in Chapter 1

" Keep in mind not all annotations are overridable
e.g., Session bean type (Stateful vs. Stateless) can't be overridden"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can I override session bean type in the deployment descriptor?