Nick,

That's definitely a bug.  Thanks for taking the time to track it down as well.

If you have the time to fix this, I would be happy to grant the access so you can 
check it in.

Any interest?

-David

On Fri, Sep 05, 2003 at 04:54:35PM +0100, Nick Grimshaw wrote:
> I've recently started using OpenEJB as an EJB Container, and I've discovered
> that it's not compatible with the 'Business Methods' design pattern. To
> whit, take the following code:
> ~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~
> BeanBusinessMethods.java:
> public interface BeanBusinessMethods {
>       public long getID() throws RemoteException;
>       public void setID(long id) throws RemoteException;
>       ...
> }
> ~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~
> ... and then write the Local and Remote interfaces as:
> ~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~
> public interface BeanLocal extends javax.ejb.EJBLocalObject,
> BeanBusinessMethods { }
> public interface BeanRemote extends javax.ejb.EJBObject, BeanBusinessMethods
> { }
> ~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~
> ... and the bean as:
> ~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~
> public class Bean implements BeanBusinessMethods {
>       public long getID() { ... }
>       public void setID(long id) { ... }
>       ...
> }
> ~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~
> ... so as to get compile-time checking of method signatures.
> 
> The bean compiles and deploys fine, but any attempt to call bean-methods
> results in an UnsupportedOperationException. I don't have the message/stack
> trace to hand, but it was along the lines of:
>       Unkown {sic} method: public abstract long BeanBusinessMethods.getID()
> throws java.rmi.RemoteException
> 
> The problem lies in org.openejb.client.EJBObjectHandler._invoke(); the lines
> that read:
> ~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~
>     } else if ( m.getDeclaringClass() == ejb.remoteClass ) {
>         retValue = businessMethod(m,a,p);
>     } else {
>         throw new UnsupportedOperationException("Unkown method: "+m);
>     }
> ~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~
> ... should probably read (sorry, no 'diff' here!)
> ~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~
>     } else if ( m.getDeclaringClass().isInstance(ejb.remoteClass) ) {
>         retValue = businessMethod(m,a,p);
>     } else {
>         throw new UnsupportedOperationException("Unkown method: "+m);
>     }
> ~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~/~
> ... if I'm reading Class.isInstance(Object) correctly.
> 
> - Nick Grimshaw
> { if you're not part of the solution, you're part of the precipitate. }
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> http://OpenEJB.sf.net
> OpenEJB-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/openejb-development


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
http://OpenEJB.sf.net
OpenEJB-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/openejb-user

Reply via email to