This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes EJB 2.x Client view for EJB 3 bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB 2.x Client view for EJB 3 bean" Watch "EJB 2.x Client view for EJB 3 bean" New topic
Author

EJB 2.x Client view for EJB 3 bean

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9344
    
    2

Guys,

I have an EJB 3 Stateless session bean instance and I have a client that is written to EJB 2.x Stateless session bean. Now as per the promise of EJB 3, this same client written for EJB 2.x should also be suitable for EJB 3 Stateless bean. So in such a case, how would I handle my RemoteException in my client (originally built for accessing EJB 2.x) which is targetting a EJB 3 Stateless bean because in my EJB 3 Remote Interface I do not have to explicitly say that I throw RemoteException?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30068
    
149

Jothi,
I was under the impression that the container will add the remoteexception as needed (through byte code manipulation.) Are you saying it doesn't do that?


[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
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9344
    
    2

The container certainly does the byte code enhancement, but that is during deployment. How can I handle RemoteException in my client when the methods in the interface that is marked @remote does not throws RemoteException. I mean how to add a catch block to handle RemoteException when my @Remote interface methods does not throw them during compilation time?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB 2.x Client view for EJB 3 bean
 
Similar Threads
Which statement about EJB 2.x and EJB 3.0 API interoperability is correct?
Help regarding RemoteClient
Stateless Or Pojo?
Stateless session bean confusion
ClassCastException at lookup