我正在尝试在 Oracle Java Cloud Service 上部署应用程序。我创建了一个无状态 ejb (3.0):
@Stateless(name = "PTOnlineSessionEJB", mappedName = "ejb/PtOnlineBean")
@Local(PTOnlineSessionEJBLocal.class)
public class PTOnlineSessionEJBBean implements PTOnlineSessionEJBLocal {
使用本地接口:
@Local
public interface PTOnlineSessionEJBLocal {
然后我尝试访问ejb:
@WebService(serviceName = "PTOnlineService", portName = "PTOnlineServiceSoap12HttpPort")
@BindingType(SOAPBinding.SOAP12HTTP_BINDING)
public class PTOnlineService {
@EJB(name = "ejb/PtOnlineBean")
PTOnlineSessionEJBLocal PtOnlineBean;
当我尝试在云服务器上部署时,出现此错误:
Caused by: weblogic.deployment.EnvironmentException: [J2EE:160200]Error resolving ejb-ref 'ejb****' from module 'PTOnlinev6-ViewController-context-root' of application 'PTOnline'. The ejb-ref does not have an ejb-link and the JNDI name of the target bean has not been specified. Attempts to automatically link the ejb-ref to its target bean failed because no EJBs in the application were found to implement the 'it.enigen.pt.online.ejb.PTOnlineSessionEJBLocal' interface. Please link or map this ejb-ref to its target EJB and ensure the interfaces declared in the ejb-ref are correct.
如何在 weblogic 上公开和使用具有本地接口的 ejb?