严重: Error listenerStart
2013-4-8 17:33:37 org.apache.catalina.core.StandardContext start
严重: Context [/crm2] startup failed due to previous errors
2013-4-8 17:33:37 org.apache.catalina.loader.WebappClassLoader loadClass
信息: Illegal access: this web application instance has been stopped already.  Could not load com.mysql.jdbc.ServerPreparedStatement$BindValue.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException在本地的运行是正常的,在服务器通过ant来发布java项目,报了如上的错误。   也不是重启项目的问题,麻烦各位大神看看,有没有比较好的方案解决这个问题TomcatJava服务器

解决方案 »

  1.   

    <?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"
             xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
      http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
             version="2.5" id="services">
        <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>     
             
    <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/applicationContext.xml</param-value>
        </context-param>    <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>    <context-param>
            <param-name>log4jConfigLocation</param-name>
            <param-value>/WEB-INF/log4j.properties</param-value>
        </context-param>    <context-param>
            <param-name>log4jRefreshInterval</param-name>
            <param-value>1000</param-value>
        </context-param>      <listener>
            <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
        </listener>
    </web-app>
      以上是我的web.xml的代码,麻烦指点一下,哪个监听有问题,能怎么改正
      

  2.   

    com.mysql.jdbc.ServerPreparedStatement$BindValue  这个类加载不上去,你把mysql jdbc驱动包 放到tomcat lib下  再试试 
      

  3.   

    就这个原因,本地的运行环境好服务器不一样导致的,你使用ant打包后看看需要的jar文件都打包进去了没?一般把用到的第三方库文件都放在web工程的lib文件夹下,不用通过连接的方式引用工程目录以外的jar、library(web服务器自带的除外),打包时将这个文件夹中的所有文件都打进去。