好像是要抛出异常的.
你可以再把它包装一层,比如catch这个异常,返回你要的类型.

解决方案 »

  1.   

    CMP和BMP都是这样的吗?
    但是CMP是没法自己编程的啊
      

  2.   

    public class ObjectNotFoundException
    extends FinderException
    The ObjectNotFoundException exception is thrown by a finder method to indicate that the specified EJB object does not exist. Only the finder methods that are declared to return a single EJB object use this exception. This exception should not be thrown by finder methods that return a collection of EJB objects (they should return an empty collection instead).这里是说只有找单个Bean的方法才抛出Exception,找集合的方法应该抛出空Collection