• com.opensymphony.xwork2.util.logging.jdk.JdkLogger info 错误


    在启动Tomcat时出现了如下的错误:

    警告: Could not create JarEntryRevision for [jar:file:/E:/Programming/apache-tomcat-6.0.26/webapps/Struts2/WEB-INF/lib/struts2-core-2.2.1.jar]

    ...

    2010-9-24 11:16:02 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info

    信息: Parsing configuration file [struts-default.xml]

    2010-9-24 11:16:02 com.opensymphony.xwork2.util.logging.jdk.JdkLogger error

    严重: Dispatcher initialization failed

    Unable to load configuration. - bean - jar:file:/E:/Programming/apache-tomcat-6.0.26/webapps/Struts2/WEB-INF/lib/struts2-core-2.2.1.jar!/struts-default.xml:48:178

        ...

    Caused by: Unable to load bean: type:org.apache.struts2.dispatcher.multipart.MultiPartRequest class:org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest - bean - jar:file:/E:/Programming/apache-tomcat-6.0.26/webapps/Struts2/WEB-INF/lib/struts2-core-2.2.1.jar!/struts-default.xml:48:178

        ...

    Caused by: java.lang.NoClassDefFoundError: org/apache/commons/fileupload/RequestContext

        ...

    2010-9-24 11:16:02 org.apache.catalina.core.StandardContext filterStart

    严重: Exception starting filter struts2

    Unable to load configuration. - bean - jar:file:/E:/Programming/apache-tomcat-6.0.26/webapps/Struts2/WEB-INF/lib/struts2-core-2.2.1.jar!/struts-default.xml:48:178

        ...

    Caused by: Unable to load configuration. - bean - jar:file:/E:/Programming/apache-tomcat-6.0.26/webapps/Struts2/WEB-INF/lib/struts2-core-2.2.1.jar!/struts-default.xml:48:178

        ... 

    Caused by: Unable to load bean: type:org.apache.struts2.dispatcher.multipart.MultiPartRequest class:org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest - bean - jar:file:/E:/Programming/apache-tomcat-6.0.26/webapps/Struts2/WEB-INF/lib/struts2-core-2.2.1.jar!/struts-default.xml:48:178

        ... 

    Caused by: java.lang.NoClassDefFoundError: org/apache/commons/fileupload/RequestContext

        ...

    Caused by: java.lang.ClassNotFoundException: org.apache.commons.fileupload.RequestContext

        ...

    2010-9-24 11:16:02 org.apache.catalina.core.StandardContext start

    严重: Error filterStart

    2010-9-24 11:16:02 org.apache.catalina.core.StandardContext start

    严重: Context [/Struts2] startup failed due to previous errors

     

    这些错误很让我摸不着头脑,经多方查阅资料后,在Struts 2.2.x中应该导入如下7个JAR文件

    1)   commons-fileupload-1.2.1.jar

    2)   commons-io-1.3.2.jar

    3)   freemarker-2.3.16.jar

    4)   javassist-3.7.ga.jar

    5)   ognl-3.0.jar

    6)   struts2-core-2.2.1.jar

    7)   xwork-core-2.2.1.jar

     

    其实,这里还有一个小窍门,我们可以将Struts 2.2.x根目录下的apps文件夹下的struts2-blank-2.2.1.war文件进行解压,然后找到WEB-INF下的lib目录,我们可以发现里面列出了7个JAR文件,刚好这7个就是我们配置Struts 2.2.x需要导入的JARs文件

  • 相关阅读:
    tomcat配置环境变量
    Java实现简单的正则表达式匹配
    vi编辑器用法
    MyEclipse中自定义maven命令(添加maven 命令)
    dos窗口编译*.java文件 解决 java “错误:编码GBK 的不可映射字符”
    如何循环枚举类型
    Java枚举的小用法
    Java读取maven目录下的*.properties配置文件
    用MyEclipse将Maven Dependencies中的jar包导出
    MD5加密与base64编码
  • 原文地址:https://www.cnblogs.com/ouyxy/p/6885350.html
Copyright © 2020-2023  润新知