简体   繁体   中英

Getting tomcat error while deploying Libreplan on windows

I have forked codebase of Libreplan from repository and import in eclipse. Now i am trying to deploy libreplan-webapp into tomcat7. I have configured data source file also which is present inside Tomcat-7.0.39\\conf\\Catalina\\localhost directory. libreplan-webapp.xml given below

<?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. But I am getting below error while starting of 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

<?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

The relevant error message is "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.

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.

I solved this issue myself to run Libreplan on windows. There were many problem with configuration. First thing the error message was misleading, it has nothing to do with 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. Then I remove hibernate-annotations dependency as annotation comes with hibernate-core jar from 3.5 onward. I added below entry in catalina.policy file

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
  ...
};

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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