在我将javaee-web-api-7.0.jar
添加到JSF项目后,它停止工作并出现错误:
org.apache.catalina.startup.ContextConfig.processServletContainerInitializers Failed to process JAR found at URL [/RegaloCE] for ServletContainerInitializers for context with name [{1}]
java.io.IOException: java.lang.ClassCastException: Cannot cast com.sun.faces.config.FacesInitializer to javax.servlet.ServletContainerInitializer
好吧,服务器(apache tomcat 8)没有这个库,我没有使用maven。
从这里(stackoverflow)尝试了一些答案,但没有任何帮助…
thx
全部加
07-May-2014 14:53:51.111 SEVERE [http-apr-8080-exec-3] org.apache.catalina.startup.ContextConfig.processServletContainerInitializers Failed to process JAR found at URL [/RegaloCE] for ServletContainerInitializers for context with name [{1}]
java.io.IOException: java.lang.ClassCastException: Cannot cast com.sun.faces.config.FacesInitializer to javax.servlet.ServletContainerInitializer
at org.apache.catalina.startup.WebappServiceLoader.loadServices(WebappServiceLoader.java:185)
at org.apache.catalina.startup.WebappServiceLoader.load(WebappServiceLoader.java:151)
at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1597)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1125)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:768)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5058)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:697)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:579)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:455)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1554)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1448)
at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:901)
at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:335)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:301)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:615)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:526)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1017)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:652)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:277)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2451)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2440)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
好吧,因为我使用NetBeans 8,我不能使用TomEE与JEE Web 7,我不得不把javax。{tomcat-home}/lib..
不幸的是,netbeans仍然不识别它,所以我更新了nbproject
文件夹内的project.properties
,并将${j2ee.server.home}/lib/javax.ejb-api-3.2.jar
添加到j2ee.platform.classpath
属性..
现在netbeans可以识别这个库并使用它进行构建,我不需要在项目库中包含它。
(我在Java ee web API中唯一需要的东西是注释和ejb,现在我手动加载它们..