【问题标题】:Getting tomcat error while deploying Libreplan on windows在 Windows 上部署 Libreplan 时出现 tomcat 错误
【发布时间】:2014-12-16 14:24:04
【问题描述】:

我已经从存储库中分叉了 Libreplan 的代码库并在 Eclipse 中导入。现在我正在尝试将 libreplan-webapp 部署到 tomcat7 中。我还配置了 Tomcat-7.0.39\conf\Catalina\localhost 目录中的数据源文件。 libreplan-webapp.xml 下面给出了

<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="">
        <Resource name="jdbc/libreplan-ds" auth="Container"
            type="javax.sql.DataSource"
            maxActive="100" maxIdle="30" maxWait="10000"
            username="libreplan" password="libreplan"
            driverClassName="com.mysql.jdbc.Driver"
            url="jdbc:mysql://localhost/libreplandev" />
</Context>

我按照手册 [http://www.libreplan.org/INSTALL.html] 中给出的所有说明构建了 wepapp 并将其部署在 tomcat 上。 但是我在启动tomcat时遇到了错误

SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/libreplan-webapp]]
    at java.util.concurrent.FutureTask.report(Unknown Source)
    at java.util.concurrent.FutureTask.get(Unknown Source)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/libreplan-webapp]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    ... 6 more
Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/factory/ListableBeanFactory
    at java.lang.Class.getDeclaredFields0(Native Method)

这里是 web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
    xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
  http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>libreplan-webapp</display-name>

    <!--
        It searches all libreplan-business-spring-config.xml files, it can
        found several. There must be at least one. It searches
        libreplan-webapp-spring-config.xml. There must be just one. It
        searches libreplan-override-spring-config.xml to override some
        previous definitions. There could be several or none.
    -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            classpath*:/libreplan-business-spring-config.xml
            classpath:/libreplan-webapp-spring-config.xml
            classpath*:/libreplan-override-spring-config.xml
            classpath:/libreplan-webapp-spring-security-config.xml
        </param-value>
    </context-param>


    <!-- /// -->
    <!-- DSP -->
    <servlet>
        <description><![CDATA[The servlet loads the DSP pages.]]></description>
        <servlet-name>dspLoader</servlet-name>
        <servlet-class>org.zkoss.web.servlet.dsp.InterpreterServlet</servlet-class>
    </servlet>
    <servlet>
        <description><![CDATA[Callback Servlet]]></description>
        <servlet-name>callbackServlet</servlet-name>
        <servlet-class>org.zkoss.ganttz.servlets.CallbackServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>callbackServlet</servlet-name>
        <url-pattern>/callback/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>dspLoader</servlet-name>
        <url-pattern>*.dsp</url-pattern>
    </servlet-mapping>
    <!-- /// -->

    <!-- Spring security -->
    <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <!-- //// -->
    <listener>
        <listener-class>org.libreplan.web.LoggingConfiguration</listener-class>
    </listener>

    <!-- ZK -->
    <listener>
        <description>Used to cleanup when a session is destroyed</description>
        <display-name>ZK Session Cleaner</display-name>
        <listener-class>org.zkoss.zk.ui.http.HttpSessionListener</listener-class>
    </listener>

    <!-- Spring listeners -->

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <listener>
        <listener-class>
            org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>

    <!-- end Spring listeners -->

    <!-- Loads all IDataBootstrap and executes them -->
    <listener>
        <listener-class>org.libreplan.web.bootstrap.BootstrapListener</listener-class>
    </listener>

    <servlet>
        <description>ZK loader for ZUML pages</description>
        <servlet-name>zkLoader</servlet-name>
        <servlet-class>org.zkoss.zk.ui.http.DHtmlLayoutServlet</servlet-class>
        <!--
            Must. Specifies URI of the update engine (DHtmlUpdateServlet). It
            must be the same as <url-pattern> for the update engine.
        -->
        <init-param>
            <param-name>update-uri</param-name>
            <param-value>/zkau</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>zkLoader</servlet-name>
        <url-pattern>*.zul</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>zkLoader</servlet-name>
        <url-pattern>*.zhtml</url-pattern>
    </servlet-mapping>
    <servlet>
        <description>The asynchronous update engine for ZK</description>
        <servlet-name>auEngine</servlet-name>
        <servlet-class>org.zkoss.zk.au.http.DHtmlUpdateServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>auEngine</servlet-name>
        <url-pattern>/zkau/*</url-pattern>
    </servlet-mapping>
    <!-- //// -->

    <!-- CXF -->
    <servlet>
        <display-name>CXF Servlet</display-name>
        <servlet-name>CXFServlet</servlet-name>
        <servlet-class>
            org.apache.cxf.transport.servlet.CXFServlet
        </servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>CXFServlet</servlet-name>
        <url-pattern>/ws/rest/*</url-pattern>
    </servlet-mapping>

    <session-config>
        <!-- The session timeout is ten minutes. A timer is used to keep the session alive if there is some open page -->
        <session-timeout>10</session-timeout>
    </session-config>

    <welcome-file-list>
        <welcome-file>/common/index.zul</welcome-file>
    </welcome-file-list>

    <error-page>
        <exception-type>java.lang.Throwable</exception-type>
        <location>/common/error.zul</location>
    </error-page>

    <error-page>
        <error-code>404</error-code>
        <location>/common/page_not_found.zul</location>
    </error-page>

    <error-page>
        <error-code>403</error-code>
        <location>/common/access_forbidden.zul</location>
    </error-page>

</web-app>

配置: java版本:1.7.0_55-b13 服务器:Tomcat-7.0.39 操作系统:窗口 7 数据库:MySql

【问题讨论】:

    标签: java tomcat7


    【解决方案1】:

    相关错误信息为"java.lang.NoClassDefFoundError: org/springframework/beans/factory/ListableBeanFactory"

    因此,您似乎在运行时的类路径中没有所需的 Spring 库,或者您的版本较旧。

    它更可能是丢失而不是太旧,因为 ListableBeanFactory 是在很久以前的 Spring 2.0 中引入的。

    【讨论】:

    • 它与 spring-beans-4.0.3.RELEASE.jar 一起存在于 web-inf/lib 文件夹中
    【解决方案2】:

    我自己解决了这个问题,以便在 Windows 上运行 Libreplan。配置有很多问题。首先错误消息具有误导性,它与 ListableBeanFactory 无关。 我做了以下更改: 在 tomcat\conf\Catalina\localhost 文件夹中将 libreplan.xml 重命名为 libreplan-webapp.xml,因为文件名应为数学应用程序战争名称。 然后我删除了 hibernate-annotations 依赖项,因为注释从 3.5 开始随 hibernate-core jar 一起提供。 我在 catalina.policy 文件中添加了以下条目

    grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
      ...
      // begin:libreplan
      permission java.io.FilePermission "${catalina.base}${file.separator}webapps${file.separator}libreplan-webapp${file.separator}WEB-INF${file.separator}classes${file.separator}logging.properties", "read";
      // end:libreplan
      ...
    };
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-04-02
      • 2015-05-27
      • 1970-01-01
      • 2011-03-23
      • 1970-01-01
      • 2023-03-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多