GeeCON Prague 2014*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Is deployment descriptor always override annotation? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Is deployment descriptor always override annotation?" Watch "Is deployment descriptor always override annotation?" New topic
Author

Is deployment descriptor always override annotation?

Fu Dong Jia
Ranch Hand

Joined: May 23, 2007
Posts: 131
Hi everyone1
The EJB deployment descriptor can partially override bean class annotation OR entirely override?


who dare win!<br />SCJP5(94%)|SCWCD5(86%)|SCBCD(100%)|SCEA in progress
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

I think that everything any settings can be override in the deployment descriptor, to avoid deployment problems.


[My Blog]
All roads lead to JavaRanch
Peter Purmonen
Greenhorn

Joined: Oct 24, 2008
Posts: 9
Where annotations and Deployment descriptor entries are in conflict, the Deployment Descriptor has precedence. E.g, the DD overrides what is in the annotation(s). In other cases, the annotations and deployment descriptor meta data complement each other.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

"PeterP", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ralph Jaus
Ranch Hand

Joined: Apr 27, 2008
Posts: 342
I don't know, whether it is technically possible to override any annotation in the deployment descriptor. But at least the ejb spec doesn't allow to do so. For example, you are not allowed to override the bean type (see core spec 19.2, page 491).


SCJP 5 (98%) - SCBCD 5 (98%)
Peter Purmonen
Greenhorn

Joined: Oct 24, 2008
Posts: 9
Yes, that's absolutely true, my bad. There are exceptions to the "rule(s)", but they are few, so knowing the general behavior of annotation and DD meta data combined with remembering the exceptions is always good.
Peter Purmonen
Greenhorn

Joined: Oct 24, 2008
Posts: 9
.. more specifically, most stuff are overridable by the deployment descriptor. :-)
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Nice catch Ralph
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is deployment descriptor always override annotation?