@Override public EJBLocalObject getEJBLocalObject() throws IllegalStateException { try { Object id = beanContext.getId(); EJBLocalObject proxy = null; try { proxy = (EJBLocalObject) container.createProxyLocalEjb21(id); } // Proxy does not implement EJBLocalObject catch (ClassCastException cce) { // JIRA EJBTHREE-1057 throw new IllegalStateException("EJB3 Specification Violation: " + container.getBeanClassName() + " does not have a local interface; " + "EJB3 Spec 4.3.3 Bullet 12: Only session beans with a local EJBLocalObject interface " + "can call this method."); } return proxy; } catch (Exception e) { throw new IllegalStateException(e); } }
@Override public EJBObject getEJBObject() throws IllegalStateException { try { Object id = beanContext.getId(); EJBObject proxy = null; try { proxy = (EJBObject) container.createProxyRemoteEjb21(id); } // Proxy does not implement EJBObject catch (ClassCastException cce) { // JIRA EJBTHREE-1057 throw new IllegalStateException("EJB3 Specification Violation: " + container.getBeanClassName() + " does not have a remote interface; " + "EJB3 Spec 4.3.3 Bullet 10: Only session beans with a remote EJBObject interface " + "can call this method."); } return proxy; } catch (Exception e) { throw new IllegalStateException(e); } }