简体   繁体   English

在Windows上部署Libreplan时出现tomcat错误

[英]Getting tomcat error while deploying Libreplan on windows

I have forked codebase of Libreplan from repository and import in eclipse. 我从存储库中分叉了Libreplan的代码库,并导入了eclipse。 Now i am trying to deploy libreplan-webapp into tomcat7. 现在,我正在尝试将libreplan-webapp部署到tomcat7中。 I have configured data source file also which is present inside Tomcat-7.0.39\\conf\\Catalina\\localhost directory. 我还配置了数据源文件,该文件也位于Tomcat-7.0.39 \\ conf \\ Catalina \\ localhost目录中。 libreplan-webapp.xml given below 下面给出的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>

I followed all the instruction given in manual [ http://www.libreplan.org/INSTALL.html] to build the wepapp and deploy it on tomcat. 我按照手册[ http://www.libreplan.org/INSTALL.html]中的所有说明进行操作,以构建wepapp并将其部署在tomcat上。 But I am getting below error while starting of 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)

here is web.xml 这是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>

Configuration: java version : 1.7.0_55-b13 server :Tomcat-7.0.39 OS : Window 7 DB : MySql 配置:Java版本:1.7.0_55-b13服务器:Tomcat-7.0.39操作系统:Window 7 DB:MySql

The relevant error message is "java.lang.NoClassDefFoundError: org/springframework/beans/factory/ListableBeanFactory" 相关的错误消息是"java.lang.NoClassDefFoundError: org/springframework/beans/factory/ListableBeanFactory"

So, it appears that either you do not have the required Spring library in the classpath at runtime, or you have an older version. 因此,似乎在运行时您在类路径中没有必需的Spring库,或者您使用的是较旧的版本。

It's more likely that it's missing than too old, since ListableBeanFactory was introduced in Spring 2.0, which was quite a while ago. 由于ListableBeanFactory是在不久前的Spring 2.0中引入的,因此很可能缺少它,而不是太老了。

I solved this issue myself to run Libreplan on windows. 我自己解决了这个问题,以便在Windows上运行Libreplan。 There were many problem with configuration. 配置有很多问题。 First thing the error message was misleading, it has nothing to do with ListableBeanFactory. 错误消息的第一件事是令人误解,它与ListableBeanFactory无关。 I made following changes: Rename libreplan.xml to libreplan-webapp.xml inside tomcat\\conf\\Catalina\\localhost folder as filename should math application war name. 我进行了以下更改:将tomcat \\ conf \\ Catalina \\ localhost文件夹中的libreplan.xml重命名为libreplan-webapp.xml,其名称应为数学应用程序战争名称。 Then I remove hibernate-annotations dependency as annotation comes with hibernate-core jar from 3.5 onward. 然后我删除了hibernate-annotations依赖,因为从3.5开始,hibernate-core jar附带了注释。 I added below entry in catalina.policy file 我在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
  ...
};

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM