On Tue, 2004-02-17 at 00:55, Dickson, Craig wrote: > I notice in the .xdt file responsible for generating the remote > interfaces for EJBs, that the template explicitly adds the > java.rmi.RemoteException to each method in the remote interface and > skips over the javax.ejb.EJBException. > > After reading through the EJB 2.0 specification again, my > understanding is that throw EJBException is correct if writing a v2.0 > bean and RemoteException should only be thrown if you want to v1.0 > compatible.
That's within the bean class itself. In EJB 1.0, you just threw RemoteException in both the bean class and remote interface. From EJB 1.1 onwards, your implementation class methods should throw EJBException, and the remote client receives it as a RemoteException. Remote interface methods must always be declared as throwing RemoteException, so we add this by default. Since the remote user won't ever receive an EJBException, we skip that if it was declared (as it's a subclass of RuntimeException the methods don't actually need to declare it, but I like to so that it shows up in my javadocs). > Is there are reason this template is hard coded to throw > RemoteExceptions instead of having the option to throw EJBException > instead? Because we want to conform to the spec :-) Andrew. ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
