我在 TomEE 服务器上使用 OpenJPA。
我构建了我的 .war,将其部署在服务器上,但是当我使用我的应用程序打开页面时,我得到了这个 execption:
javax.servlet.ServletException: WebBeans context with scope type annotation @RequestScoped does not exist within current thread
javax.faces.webapp.FacesServlet.service(FacesServlet.java:229)
filters.NoCacheFilter.doFilter(NoCacheFilter.java:42)
org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:98)
com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145)
javax.enterprise.context.ContextNotActiveException: WebBeans context with scope type annotation @RequestScoped does not exist within current thread
org.apache.webbeans.container.BeanManagerImpl.getContext(BeanManagerImpl.java:351)
org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.getContextualCreationalContext(NormalScopedBeanInterceptorHandler.java:169)
org.apache.webbeans.web.intercept.RequestScopedBeanInterceptorHandler.getContextualInstance(RequestScopedBeanInterceptorHandler.java:79)
org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.invoke(NormalScopedBeanInterceptorHandler.java:114)
org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.invoke(NormalScopedBeanInterceptorHandler.java:108)
org.apache.webbeans.conversation.ConversationImpl_$$_javassist_0.isTransient(ConversationImpl_$$_javassist_0.java)
org.apache.webbeans.jsf.WebBeansPhaseListener.beforePhase(WebBeansPhaseListener.java:106)
org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore(PhaseListenerManager.java:77)
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:158)
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
filters.NoCacheFilter.doFilter(NoCacheFilter.java:42)
org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:98)
com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145)