This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 14687
    
  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: 60800
    
  65

"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: 14687
    
  16

Nice catch Ralph
 
wood burning stoves
 
subject: Is deployment descriptor always override annotation?
 
Similar Threads
websphere 7.0 JAXWS webservice deployed in tomcat 6.0.32 not working
Can I override session bean type in the deployment descriptor?
built in Annotation doubt
Really need help!
deployment descriptor always override annotation?