• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JAX-RPC EJB End points doubt in xyzws

 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I was going through xyzws notes and got some controversial statement




please clarify .
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Divya,

The endpoint interface must throw remote exception,
but the implementation for that endpoint interface should not throw remote exception,because remote exception is something which is thrown by the server and not by the implementation class,since the implementation class resides in the server we should not throw remote exception from our implementation class only the server throws it.But in the endpoint interface this is not the case,think like ,the client will call only methods in the endpoint interface and the client should be aware of the remote exception,that is why we need to throw remote exception from the endpoint interface.

Thanks,
Sajan C
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you mean "contradictory" not "controversial".

And the statements aren't contradictory - they are in fact complimentary.

The endpoint interface is a remote interface as seen by the client and therefore losing the remote connection is always a possibility. If the connection is lost or cannot be created the client's application server throws a subclass of java.rmi.RemoteException. Note this exception isn't coming from the implementing bean.

The implementing bean on the other hand "lives" on the application server that is running the service (not the client's application server) and therefore doesn't know about any of the connection problems that the client may be having. Throwing of java.rmi.RemoteExceptions is entirely the responsibility of the client's application server. The bean is only allowed to throw "application exceptions" (which show up in the WSDL as SOAP Faults) which cannot derive from java.rmi.RemoteExceptions.


Basically the rules state that java.rmi.RemoteException (or a subclass thereof) cannot be used to represent an "application exception" but must always be treated as a "system exception".

Enterprise JavaBeans, 3rd Edition: 14.6.1. Application Exceptions Versus System Exceptions


An application exception is any exception that does not extend java.lang.RuntimeException or java.rmi.RemoteException. System exceptions are java.lang.RuntimeException and its subtypes, including EJBException.

An application exception must never extend either the RuntimeException, the RemoteException, or one of their subtypes.

 
Divya Gehlot
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peer,
Thanks
I understood
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic