This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Confusion about EJB Exceptions  RSS feed

 
Kaxhif Khan
Ranch Hand
Posts: 51
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


In EJB specification document section 14.3.1 (page number 384), table row 2 (system exception portion) said via note 'E' as

[E] If the business interface is a remote business interface that extends java.rmi.Remote, the java.rmi.RemoteException is thrown to the client, which will receive this exception.

Practically i found "com.sun.ejb.containers.InternalEJBContainerException" thrown to the client, here is the code



"searchBook" method of BookService is invoked from another EJB.

Is it a mistake in specs document or i am doing something wrong because of which i am not able to receive "java.rmi.RemoteException"?
 
Himai Minh
Ranch Hand
Posts: 1572
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you use a client that calls the searhBook method remotely?
For Java RMI, I think the client needs to know the IP address of the server and make connection to the server.
Refer to the Java RMI tutorial from Oracle.
Does your client inject the BookService bean?
If the client instantiate the BookService object, then it is not used as an EJB.


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!