我阅读并关注了BallusC的以下帖子,但仍然困惑:如何在Tomcat上安装和使用CDI?
尝试安装焊缝2.2.9.最终和配置如上所述。我正在使用以下内容:
JSF 2.2、EL 2.2、Servlet3、Java7
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="{name}" version="3.0">
INFO: Starting service Catalina
Aug 09, 2015 8:57:18 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.56
Aug 09, 2015 8:57:18 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\xampp\tomcat\conf\Catalina\localhost\MITrace.xml
Aug 09, 2015 8:57:24 AM org.richfaces.webapp.ResourceServletContainerInitializer registerServlet
INFO: Auto-registered servlet ResourceServlet with mapping '/org.richfaces.resources/*'
Aug 09, 2015 8:57:24 AM org.omnifaces.ApplicationInitializer logOmniFacesVersion
INFO: Using OmniFaces version 2.1
Aug 09, 2015 8:57:26 AM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra 2.2.6 ( 20140304-1537 https://svn.java.net/svn/mojarra~svn/tags/2.2.6@12949) for context '/MITrace'
Aug 09, 2015 8:57:27 AM com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed.
Aug 09, 2015 8:57:27 AM com.sun.faces.config.ConfigureListener contextInitialized
SEVERE: Critical error during deployment:
java.lang.NoClassDefFoundError: Could not initialize class org.omnifaces.config.BeanManager
at org.omnifaces.application.OmniApplication.<init>(OmniApplication.java:69)
at org.omnifaces.application.OmniApplicationFactory.createOmniApplication(OmniApplicationFactory.java:89)
at org.omnifaces.application.OmniApplicationFactory.getApplication(OmniApplicationFactory.java:54)
at com.sun.faces.application.InjectionApplicationFactory.getApplication(InjectionApplicationFactory.java:93)
at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:144)
at com.sun.faces.lifecycle.ClientWindowFactoryImpl.<init>(ClientWindowFactoryImpl.java:62)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:379)
at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:721)
at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:553)
at javax.faces.FactoryFinder.access$500(FactoryFinder.java:140)
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1120)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:379)
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:328)
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:236)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:435)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:214)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4992)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:672)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1861)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
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:745)
Aug 09, 2015 10:28:23 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Aug 09, 2015 10:28:25 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Aug 09, 2015 10:28:27 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.omnifaces.ApplicationListener
java.lang.ExceptionInInitializerError
at org.omnifaces.ApplicationListener.checkCDIAvailable(ApplicationListener.java:63)
at org.omnifaces.ApplicationListener.contextInitialized(ApplicationListener.java:55)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:672)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1861)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
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:745)
Caused by: java.lang.IllegalStateException: CDI BeanManager instance is not available in JNDI.
at org.omnifaces.config.BeanManager.<init>(BeanManager.java:99)
at org.omnifaces.config.BeanManager.<clinit>(BeanManager.java:49)
... 15 more
Caused by: java.lang.IllegalStateException: javax.naming.NamingException: Cannot create resource instance
at org.omnifaces.util.JNDI.lookup(JNDI.java:92)
at org.omnifaces.config.BeanManager.<init>(BeanManager.java:95)
... 16 more
Caused by: javax.naming.NamingException: Cannot create resource instance
at org.apache.naming.factory.ResourceEnvFactory.getObjectInstance(ResourceEnvFactory.java:115)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
at org.apache.naming.NamingContext.lookup(NamingContext.java:842)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.naming.NamingContext.lookup(NamingContext.java:830)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.naming.NamingContext.lookup(NamingContext.java:830)
at org.apache.naming.NamingContext.lookup(NamingContext.java:167)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:156)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at org.omnifaces.util.JNDI.lookup(JNDI.java:88)
... 17 more
还有什么可能导致这个错误?
我正试图将一个。war项目部署到我的tomcat7安装中。 我使用的是Ubuntu12.04和Tomcat7。
也许不是Maven的问题。也许是m2e/wtp问题? 为了给出一个背景,我在Eclipse中建立了一个ICEFaces项目,并在Tomcat7.0.30中部署了它。在将servlet-api.jar部署到Tomcat时,似乎忽略了所提供范围中的Maven POM配置。我错过什么了吗?我如何让Maven做得正确? 在该项目中,javax.servlet-api.jar作为IceFaces的可传递依赖
知道如何在变化时重新部署html和jsp吗?
我需要在tomcat7部署战争文件...到目前为止我所做的是1。安装Tomcat7-启动并运行。能够看到索引页2。安装apache2-up并运行.成功地将80重定向到tomcat的8080端口。所有请求都被重定向到tomcat。3.现在我需要部署战争文件。 我的战争没有被发现,也没有扩大。没有日志。。未创建“mycompany”目录。 我检查了我的server.xml下面是代码 我错过了什么吗。。
在将OmniFaces库添加到Apache Tomcat7并将CDI(遵循此链接)添加到Apache Tomcat7之后,我遇到了一个错误,并且我使用的是Maven。 严重:启动java.util.concurrent.ExecutionException时子容器失败:org.apache.Catalina.LifeCycleException:无法启动组件[StandardEngine[Cata