迁移tomcat 6到7; JSF; java.lang.NoClassDefFoundError:com / sun / enterprise / InjectionException

时间:2015-07-08 13:08:47

标签: jsf tomcat noclassdeffounderror

我需要将tomcat 6项目(Java 6)迁移到Tomcat 7 Server(Java 7)。现在我从服务器收到以下错误:

CONSOLE:

INFORMATION: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
Jul 09, 2015 9:47:38 AM com.sun.faces.config.ConfigureListener contextInitialized
INFORMATION: Mojarra 2.2.11 ( 20150505-0732 https://svn.java.net/svn/mojarra~svn/tags/2.2.11@14688) für Kontext '/CM-Tool' wird initialisiert.
Jul 09, 2015 9:47:39 AM com.sun.faces.config.ConfigureListener contextInitialized
SCHWERWIEGEND: Critical error during deployment: 
java.lang.NoClassDefFoundError: com/sun/enterprise/InjectionException
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:274)
    at com.sun.faces.util.Util.loadClass(Util.java:364)
    at com.sun.faces.spi.InjectionProviderFactory.getProviderFromEntry(InjectionProviderFactory.java:317)
    at com.sun.faces.spi.InjectionProviderFactory.findProviderClass(InjectionProviderFactory.java:285)
    at com.sun.faces.spi.InjectionProviderFactory.createInstance(InjectionProviderFactory.java:116)
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:365)
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:227)
    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$StartChild.call(ContainerBase.java:1575)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
    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.ClassNotFoundException: com.sun.enterprise.InjectionException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
    ... 17 more

Jul 09, 2015 9:47:39 AM org.apache.catalina.core.StandardContext listenerStart
SCHWERWIEGEND: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/sun/enterprise/InjectionException
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292)
    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$StartChild.call(ContainerBase.java:1575)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
    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.NoClassDefFoundError: com/sun/enterprise/InjectionException
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:274)
    at com.sun.faces.util.Util.loadClass(Util.java:364)
    at com.sun.faces.spi.InjectionProviderFactory.getProviderFromEntry(InjectionProviderFactory.java:317)
    at com.sun.faces.spi.InjectionProviderFactory.findProviderClass(InjectionProviderFactory.java:285)
    at com.sun.faces.spi.InjectionProviderFactory.createInstance(InjectionProviderFactory.java:116)
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:365)
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:227)
    ... 9 more
Caused by: java.lang.ClassNotFoundException: com.sun.enterprise.InjectionException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
    ... 17 more

Jul 09, 2015 9:47:39 AM org.apache.catalina.core.StandardContext startInternal
SCHWERWIEGEND: Error listenerStart
Jul 09, 2015 9:47:40 AM org.apache.catalina.core.StandardContext startInternal
SCHWERWIEGEND: Context [/CM-Tool] startup failed due to previous errors
Jul 09, 2015 9:47:40 AM org.apache.coyote.AbstractProtocol start

BUILDPATH / DEPLOYMENT ASSEMBLY:

enter image description here

WEB.XML:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee   http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

  <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
  </context-param>
  <context-param>
    <param-name>facelets.REFRESH_PERIOD</param-name>
    <param-value>2</param-value>
  </context-param>
  <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
  </context-param>
  <context-param>
    <param-name>org.richfaces.SKIN</param-name>
    <param-value>DEFAULT</param-value>
  </context-param>
  <context-param>
    <param-name>org.ajax4jsf.handleViewExpiredOnClient</param-name>
    <param-value>true</param-value>
  </context-param>
  <filter>
    <display-name>Ajax4jsf Filter</display-name>
    <filter-name>ajax4jsf</filter-name>
    <filter-class>org.ajax4jsf.Filter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>ajax4jsf</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
  </filter-mapping>
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
  </servlet-mapping>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  <session-config>
    <session-timeout>60</session-timeout>
  </session-config> 
  <!--Tomcat 5 Workaround: Listener used to initialize JSF on startup-->
  <!--Remove comment tags to enable listener.
    <listener>
        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener>
    -->
  <!--Tomcat 5 Workaround: Listener implementation to handle web application lifecycle event-->
  <!--Remove comment tags to enable listener.
    <listener>
        <listener-class>com.sun.faces.application.WebappLifecycleListener</listener-class>
    </listener>
    -->
    <error-page>
        <exception-type>javax.faces.application.ViewExpiredException</exception-type>
        <location>/pages/viewExpired.jsp</location>
    </error-page>
    <error-page>
        <error-code>500</error-code>
        <location>/pagecomponents/error.faces</location>
    </error-page>
</web-app>

项目内容:

enter image description here

任何人都知道如何解决这个问题,甚至从哪里开始?

提前致谢=)

更新: 我在控制台中找到了这个:

INFORMATION: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
Jul 09, 2015 9:47:38 AM com.sun.faces.config.ConfigureListener contextInitialized
INFORMATION: Mojarra 2.2.11 ( 20150505-0732 https://svn.java.net/svn/mojarra~svn/tags/2.2.11@14688) für Kontext '/CM-Tool' wird initialisiert.
Jul 09, 2015 9:47:39 AM com.sun.faces.config.ConfigureListener contextInitialized

上下文初始化两次......这是问题吗?

0 个答案:

没有答案