This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes EJB Resource Injection validation Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "EJB Resource Injection validation" Watch "EJB Resource Injection validation" New topic
Author

EJB Resource Injection validation

Pratap koritala
Ranch Hand

Joined: Sep 27, 2006
Posts: 251
In a EJB, there are couple of resources ( including strings) which should be injected.
But, While deploying,In the EJB configuration one can input wrong values for the resources which should be injected or forget to inject something ?

@postconstruct method will be called after the injection, but this method should not throw checked exceptions ( Honestly, don't know the reason, perhaps throwing throwing exception will make EJB deployment to stop, but that is what expected,Isn't it ?)

Is there a way to validate this, at least away to mention some resource as mandatory?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26192
    
  66

A runtime exception will stop your EJB from loading. A checked exception would be harder for the implementing container because they would have to deal with exceptions.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Pratap koritala
Ranch Hand

Joined: Sep 27, 2006
Posts: 251
Thanks, appreciate it
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: EJB Resource Injection validation
 
Similar Threads
EJB3- resource injection in JSP
The place where we define Annotations inside the EJB Bean class
why resource injection is not allowed in web client for EJB 3.0?
Container injecting JMS resources to EJB dependencies
EJBContext injection and ACC