[jboss-user] [EJB 3.0] - Re: Unit test EJB3 Exception

Jari Fredriksson jarif at iki.fi
Wed Mar 25 14:50:14 EDT 2009


> Oops, my bad... Local interfaces can be cast directly:
> 
> MyLocal local = (MyLocal) ctx.lookup("MyBean/local");
> 
> Probably a "narrow" would even result in error.
> 
> By the way, with EJB3, the "narrow" is even for remote
> interfaces no longer required, direct casting is
> possible.

Maybe in most implementations, but if server agnostic code is needed, narrow is good. WebSphere seems to like it. Direct cast does not seems to work.






More information about the jboss-user mailing list