How should we avoid this Injection exception?

I am trying to call a Servlet but the following Exceptions occur:

The server encountered an internal error () that prevented it from fulfilling this request.
javax.servlet.ServletException: PWC1392: Error instantiating servlet class Web.ListNewsData root cause

com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class Web.ListNewsData root cause

com.sun.enterprise.container.common.spi.util.InjectionException: Exception attempting to inject Remote ejb-ref name=UserSession,Remote 3.x interface =SessionBean.UserSession,ejb-link=null,lookup=null,mappedName=,jndi-name=SessionBean.UserSession,refType=Session into class Web.ListNewsData root cause

javax.naming.NamingException: Lookup failed for 'java:comp/env/UserSession' in SerialContext [Root exception is javax.naming.NamingException: Exception resolving Ejb for 'Remote ejb-ref name=UserSession,Remote 3.x interface =SessionBean.UserSession,ejb-link=null,lookup=null,mappedName=,jndi-name=SessionBean.UserSession,refType=Session' . Actual (possibly internal) Remote JNDI name used for lookup is 'SessionBean.UserSession#SessionBean.UserSession' [Root exception is javax.naming.NamingException: Lookup failed for 'SessionBean.UserSession#SessionBean.UserSession' in SerialContext [Root exception is javax.naming.NameNotFoundException: SessionBean.UserSession#SessionBean.UserSession not found]]] root cause

javax.naming.NamingException: Exception resolving Ejb for 'Remote ejb-ref name=UserSession,Remote 3.x interface =SessionBean.UserSession,ejb-link=null,lookup=null,mappedName=,jndi-name=SessionBean.UserSession,refType=Session' . Actual (possibly internal) Remote JNDI name used for lookup is 'SessionBean.UserSession#SessionBean.UserSession' [Root exception is javax.naming.NamingException: Lookup failed for 'SessionBean.UserSession#SessionBean.UserSession' in SerialContext [Root exception is javax.naming.NameNotFoundException: SessionBean.UserSession#SessionBean.UserSession not found]] root cause

javax.naming.NamingException: Lookup failed for 'SessionBean.UserSession#SessionBean.UserSession' in SerialContext [Root exception is javax.naming.NameNotFoundException: SessionBean.UserSession#SessionBean.UserSession not found] root cause

javax.naming.NameNotFoundException: SessionBean.UserSession#SessionBean.UserSession not found

We are using the Glassfish server.

链接地址: http://www.djcxy.com/p/58776.html

上一篇: 无法注入本地EJB。 依赖注入失败

下一篇: 我们应该如何避免这种注入异常?