I think you should catch it and throw an EJBException. Btw, the general problem with xdoclet atm is that it doesn't really care if you declared your ejbActivate throw an exception, whatever exception, though it works correctly for persistent field getter/setters/etc. So we'll fix it very soon and let you declare whatever exception you want :-)
Ara. > -----Original Message----- > From: Mike Cannon-Brookes [mailto:[EMAIL PROTECTED]] > Sent: Thursday, October 18, 2001 3:22 AM > To: Ara Abrahamian; 'Dmitri Colebatch' > Cc: [EMAIL PROTECTED] > Subject: RE: [Xdoclet-user] Problems with thrown Exceptions? > > How should a situation such as this be handled? (Perhaps example code will > help) > > public void ejbActivate() throws RemoteException > { > // lookup another EJB here > ejbB = getOtherEJB(); > this.bar = ejbB.getBar(); > } > > Calling EJB B's getBar() method will throw a RemoteException, so I should > declare ejbActivate() as throwing RemoteException. > > I am not throwing it myself, rather I'm just leaving it be. > > XDoclet dislikes such a method, but IMHO it is valid according to the > spec? > > -mike > > > Mike Cannon-Brookes :: [EMAIL PROTECTED] > > Atlassian :: http://www.atlassian.com > Supporting YOUR J2EE World > > > > > -----Original Message----- > > From: Ara Abrahamian [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, October 18, 2001 3:17 AM > > To: [EMAIL PROTECTED]; 'Dmitri Colebatch' > > Cc: [EMAIL PROTECTED] > > Subject: RE: [Xdoclet-user] Problems with thrown Exceptions? > > > > > > See section 12.3.7 of ejb 1.1 spec. If throwing RemoteException works in > > your container that's because of this section :o) > > But don't do it ;-) > > > > Ara. > > > > > -----Original Message----- > > > From: [EMAIL PROTECTED] [mailto:xdoclet-user- > > > [EMAIL PROTECTED]] On Behalf Of Mike Cannon-Brookes > > > Sent: Wednesday, October 17, 2001 6:07 PM > > > To: Dmitri Colebatch > > > Cc: [EMAIL PROTECTED] > > > Subject: RE: [Xdoclet-user] Problems with thrown Exceptions? > > > > > > Not a problem! I'd like to know what the 'true' meaning is but I sense > > it > > > would be hard to divine! > > > > > > I'm caught in exception hell at the moment between different OSS > > projects, > > > just trying to get some consistency ;) > > > > > > -mike > > > > > > > > > Mike Cannon-Brookes :: [EMAIL PROTECTED] > > > > > > Atlassian :: http://www.atlassian.com > > > Supporting YOUR J2EE World > > > > > > > > > > > > > -----Original Message----- > > > > From: [EMAIL PROTECTED] > > > > [mailto:[EMAIL PROTECTED]]On Behalf Of Dmitri > > > > Colebatch > > > > Sent: Thursday, October 18, 2001 12:08 AM > > > > To: Mike Cannon-Brookes > > > > Cc: [EMAIL PROTECTED] > > > > Subject: RE: [Xdoclet-user] Problems with thrown Exceptions? > > > > > > > > > > > > On Wed, 17 Oct 2001, Mike Cannon-Brookes wrote: > > > > > > > > > Your methods are not allowed to _throw_ RemoteExceptions > > > > (agreed) however > > > > > they are allowed to declare that it may be thrown. For example > > > > if my method > > > > > looks up and uses other EJBs, that method 'throws > > > > RemoteExceptions' but I do > > > > > not generate them. > > > > > > > > I swear the spec said that it should throw EJBExceptions in that > > case, > > > but > > > > it doesn't quite... I'm still not sure what the exact behaviour > > should > > > > be. If what you're saying is true, then yes, it seems we need to > > make a > > > > change to the template. > > > > > > > > No disrespect, but I wouldn't mind hearing a few more opinions on > > this > > > > before doing anything. > > > > > > > > cheers > > > > dim > > > > > > > > > > > > > > > > > > AFAI can see XDoclet doesn't handle this well? I made all > > > > methods declare > > > > > throws RemoteException in my session template and they work > > > > fine after this > > > > > minor mod? > > > > > > > > > > -mike > > > > > > > > > > > > > > > Mike Cannon-Brookes :: [EMAIL PROTECTED] > > > > > > > > > > Atlassian :: http://www.atlassian.com > > > > > Supporting YOUR J2EE World > > > > > > > > > > > > > > > > > > > > > -----Original Message----- > > > > > > From: [EMAIL PROTECTED] > > > > > > [mailto:[EMAIL PROTECTED]]On Behalf Of > > Dmitri > > > > > > Colebatch > > > > > > Sent: Wednesday, October 17, 2001 11:07 PM > > > > > > To: Mike Cannon-Brookes > > > > > > Cc: [EMAIL PROTECTED] > > > > > > Subject: Re: [Xdoclet-user] Problems with thrown Exceptions? > > > > > > > > > > > > > > > > > > since ejb 1.1 bean classes are not allowed to throw remote > > > > > > exceptions. application exceptions are handled properly afaik. > > > > > > > > > > > > hth > > > > > > dim > > > > > > > > > > > > On Wed, 17 Oct 2001, Mike Cannon-Brookes wrote: > > > > > > > > > > > > > XDoclet seems to have a problem when its generated EJB class > > > > > > extends another > > > > > > > class, and that class throws Exceptions? > > > > > > > > > > > > > > ie > > > > > > > > > > > > > > - EntityAdapter is an abstract EJB helper class which throws > > > > > > > RemoteExceptions from some methods > > > > > > > - BeanA extends EntityAdapter > > > > > > > - XDoclet generates a BeanACMP which _doesn't_ throw those > > > > > > RemoteExceptions > > > > > > > from the same methods > > > > > > > - BeanACMP doesn't compile because it's methods don't throw > > the > > > > > > exceptions > > > > > > > > > > > > > > What to do? How can I get my generated beans to throw > > > > > > exceptions properly? > > > > > > > > > > > > > > -mike > > > > > > > > > > > > > > Mike Cannon-Brookes :: [EMAIL PROTECTED] > > > > > > > > > > > > > > Atlassian :: http://www.atlassian.com > > > > > > > Supporting YOUR J2EE World > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > Xdoclet-user mailing list > > > > > > > [EMAIL PROTECTED] > > > > > > > https://lists.sourceforge.net/lists/listinfo/xdoclet-user > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > Xdoclet-user mailing list > > > > > > [EMAIL PROTECTED] > > > > > > https://lists.sourceforge.net/lists/listinfo/xdoclet-user > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > Xdoclet-user mailing list > > > > [EMAIL PROTECTED] > > > > https://lists.sourceforge.net/lists/listinfo/xdoclet-user > > > > > > > > > _______________________________________________ > > > Xdoclet-user mailing list > > > [EMAIL PROTECTED] > > > https://lists.sourceforge.net/lists/listinfo/xdoclet-user > > > > > > _________________________________________________________ > > Do You Yahoo!? > > Get your free @yahoo.com address at http://mail.yahoo.com > > _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _______________________________________________ Xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
