微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

我在从 struts 2.3 迁移到 struts 2.5 时遇到了问题

如何解决我在从 struts 2.3 迁移到 struts 2.5 时遇到了问题

我正在处理一个非 maven 遗留的 java struts 项目,我需要从 struts 2.3 升级到 struts 2.5,但是在包含所有需要的更新 jar 之后,我遇到了 freemarker 的一些问题。

jar 列表是:

  • asm-7.3.1
  • asm-commons-7.3.1
  • asm-tree-7.3.1
  • CMCaseCreationPort.wsdl
  • commons-beanutils-1.9.4
  • commons-collections-3.2.2
  • commons-digester-2.1
  • commons-fileupload-1.4
  • commons-io-2.6
  • commons-lang-2.4
  • commons-lang3-3.8.1
  • commons-logging-1.2
  • dom4j-1.6.1
  • fontBox-1.5.0
  • freemarker-2.3.30
  • 看门人
  • javassist-3.20.0-GA
  • javax.servlet-3.0
  • jempBox-1.6.0
  • jstl
  • log4j-api-2.12.1
  • ognl-3.1.28
  • pdfBox-app-1.5.0
  • PSE_Lite
  • quartz-2.2.0
  • servlet-api
  • simplecaptcha-1.1.1
  • slf4j-api-1.7.30
  • 标准
  • struts2-config-browser-plugin-2.5.26
  • struts2-convention-plugin-2.5.26
  • struts2-core-2.5.26
  • struts2-dojo-plugin-2.3.16.2
  • struts2-json-plugin-2.5.26
  • struts2-ssl-plugin-1.2.1
  • struts2-tiles-plugin-2.5.26
  • tiles-api-3.0.8
  • tiles-autotag-core-runtime-1.2
  • tiles-core-3.0.8
  • tiles-el-3.0.8
  • tiles-jsp-3.0.8
  • tiles-ognl-3.0.8
  • tiles-request-api-1.0.7
  • tiles-request-servlet-1.0.7
  • tiles-servlet-3.0.8
  • tiles-template-3.0.8
  • wls-api
  • xwork-core-2.3.34

我使用的是 weblogic 10.3 和 Java 8 运行时。以下是服务器启动的控制台日志 :

.
.
JAVA Memory arguments: -xms256m -Xmx512m
.
WLS Start Mode=Development
.
CLAsspATH=;C:\bea\patch_wlw1030\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\bea\patch_wls1030\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\bea\patch_cie660\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\PROGRA~1\Java\jdk1.8.0_291\lib\tools.jar;C:\bea\wlserver_10.3\server\lib\weblogic_sp.jar;C:\bea\wlserver_10.3\server\lib\weblogic.jar;C:\bea\modules\features\weblogic.server.modules_10.3.0.0.jar;C:\bea\wlserver_10.3\server\lib\webservices.jar;C:\bea\modules\org.apache.ant_1.6.5/lib/ant-all.jar;C:\bea\modules\net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar;;C:\bea\wlserver_10.3\common\eval\pointbase\lib\pbembedded57.jar;C:\bea\wlserver_10.3\common\eval\pointbase\lib\pbclient57.jar;C:\bea\wlserver_10.3\server\lib\xqrl.jar;;
.
PATH=C:\bea\patch_wlw1030\profiles\default\native;C:\bea\patch_wls1030\profiles\default\native;C:\bea\patch_cie660\profiles\default\native;C:\bea\wlserver_10.3\server\native\win\32;C:\bea\wlserver_10.3\server\bin;C:\bea\modules\org.apache.ant_1.6.5\bin;C:\PROGRA~1\Java\jdk1.8.0_291\jre\bin;C:\PROGRA~1\Java\jdk1.8.0_291\bin;C:\bea\jrockit_160_05\jre\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Java\jre1.8.0_291\bin;C:\Program Files\1E\Client\Extensibility\NomadBranch;C:\Program Files\Java\jdk1.8.0_291\bin;C:\Program Files\Git\cmd;C:\Users\mc455v\AppData\Local\Microsoft\WindowsApps;C:\Users\mc455v\AppData\Local\Programs\Git\cmd;C:\Users\mc455v\AppData\Local\Programs\fiddler;C:\bea\wlserver_10.3\server\native\win\32\oci920_8
.
***************************************************
*  To start WebLogic Server,use a username and   *
*  password assigned to an admin-level user.  For *
*  server administration,use the WebLogic Server *
*  console at http:\\hostname:port\console        *
***************************************************
starting weblogic with Java version:
java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10,mixed mode)
Starting WLS with line:
C:\PROGRA~1\Java\jdk1.8.0_291\bin\java    -xms256m -Xmx512m   -da -dplatform.home=C:\bea\wlserver_10.3 -Dwls.home=C:\bea\wlserver_10.3\server -Dweblogic.home=C:\bea\wlserver_10.3\server   -Dweblogic.management.discover=true  -Dwlw.iterativeDev=true -Dwlw.testConsole=true -Dwlw.logErrorsToConsole=true -Dweblogic.ext.dirs=C:\bea\patch_wlw1030\profiles\default\sysext_manifest_classpath;C:\bea\patch_wls1030\profiles\default\sysext_manifest_classpath;C:\bea\patch_cie660\profiles\default\sysext_manifest_classpath -Dweblogic.Name=AdminServer -Djava.security.policy=C:\bea\wlserver_10.3\server\lib\weblogic.policy   weblogic.Server
<Jul 26,2021 12:23:10 PM IST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 25.291-b10 from Oracle Corporation> 
<Jul 26,2021 12:23:10 PM IST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 10.3  Fri Jul 25 16:30:05 EDT 2008 1137967 > 
<Jul 26,2021 12:23:12 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING> 
<Jul 26,2021 12:23:12 PM IST> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool> 
<Jul 26,2021 12:23:12 PM IST> <Notice> <Log Management> <BEA-170019> <The server log file C:\bea\user_projects\domains\Tax_exmp_jdk1_8_domain\servers\AdminServer\logs\AdminServer.log is opened. All server side log events will be written to this file.> 
<Jul 26,2021 12:23:12 PM IST> <Error> <Socket> <BEA-000438> <Unable to load performance pack. Using Java I/O instead. Please ensure that wlntio.dll is in: 'C:\PROGRA~1\Java\jdk1.8.0_291\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\bea\patch_wlw1030\profiles\default\native;C:\bea\patch_wls1030\profiles\default\native;C:\bea\patch_cie660\profiles\default\native;C:\bea\wlserver_10.3\server\native\win\32;C:\bea\wlserver_10.3\server\bin;C:\bea\modules\org.apache.ant_1.6.5\bin;C:\PROGRA~1\Java\jdk1.8.0_291\jre\bin;C:\PROGRA~1\Java\jdk1.8.0_291\bin;C:\bea\jrockit_160_05\jre\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Java\jre1.8.0_291\bin;C:\Program Files\1E\Client\Extensibility\NomadBranch;C:\Program Files\Java\jdk1.8.0_291\bin;C:\Program Files\Git\cmd;C:\Users\mc455v\AppData\Local\Microsoft\WindowsApps;C:\Users\mc455v\AppData\Local\Programs\Git\cmd;C:\Users\mc455v\AppData\Local\Programs\fiddler;C:\bea\wlserver_10.3\server\native\win\32\oci920_8;.'
> 
<Jul 26,2021 12:23:15 PM IST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.> 
<Jul 26,2021 12:23:16 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY> 
<Jul 26,2021 12:23:16 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING> 
ERROR StatusLogger Log4j2 Could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (nop) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
----Hello Load MasterDataCashe
Hello Load MasterDataCashe
user.dir @@@@@@C:\bea\user_projects\domains\Tax_exmp_jdk1_8_domain

DEBUG   16272   [freemark] (): Couldn't find template in cache for "org/apache/struts2/dispatcher/error.ftl"("en_US",UTF-8,parsed); will try to load it.
DEBUG   16272   [freemark] (): TemplateLoader.findTemplateSource("org/apache/struts2/dispatcher/error.ftl"): Found
DEBUG   16272   [freemark] (): Loading template for "org/apache/struts2/dispatcher/error.ftl"("en_US",parsed) from "zip:C:/bea/user_projects/domains/Tax_exmp_jdk1_8_domain/servers/AdminServer/tmp/_WL_user/_auto_generated_ear_/f22bx5/war/WEB-INF/lib/struts2-core-2.5.26.jar!/org/apache/struts2/dispatcher/error.ftl"

<Jul 26,2021 12:23:55 PM IST> <Notice> <Log Management> <BEA-170027> <The Server has established connection with the Domain level Diagnostic Service successfully.> 
<Jul 26,2021 12:23:55 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN> 
<Jul 26,2021 12:23:55 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING> 
<Jul 26,2021 12:23:55 PM IST> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is Now listening on 127.0.0.1:7001 for protocols iiop,t3,ldap,snmp,http.> 
<Jul 26,2021 12:23:55 PM IST> <Warning> <Server> <BEA-002611> <Hostname <confidential_info>,maps to multiple IP addresses: <confidential_info>,127.0.0.1> 
<Jul 26,2021 12:23:55 PM IST> <Notice> <Server> <BEA-002613> <Channel "Default" is Now listening on 135.170.112.16:7001 for protocols iiop,2021 12:23:55 PM IST> <Warning> <Server> <BEA-002611> <Hostname "localhost.att.com",2021 12:23:55 PM IST> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "AdminServer" for domain "Tax_exmp_jdk1_8_domain" running in Development Mode> 
<Jul 26,2021 12:23:55 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING> 
<Jul 26,2021 12:23:55 PM IST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>

我的 localhost Web 应用程序在加载主页 url 时收到错误 404,之后控制台日志更新如下:


DEBUG   16272   [freemark] (): Key "cssClass" was not found on instance of java.util.LinkedHashMap. Introspection information for the class is: {getClass=public final native java.lang.class java.lang.Object.getClass(),getorDefault=public java.lang.Object java.util.LinkedHashMap.getorDefault(java.lang.Object,java.lang.Object),computeIfAbsent=public java.lang.Object java.util.HashMap.computeIfAbsent(java.lang.Object,java.util.function.Function),values=public java.util.Collection java.util.LinkedHashMap.values(),replace=freemarker.ext.beans.OverloadedMethods@4fde4764,replaceAll=public void java.util.LinkedHashMap.replaceAll(java.util.function.BiFunction),remove=freemarker.ext.beans.OverloadedMethods@15b22544,containsValue=public boolean java.util.LinkedHashMap.containsValue(java.lang.Object),put=public java.lang.Object java.util.HashMap.put(java.lang.Object,empty=freemarker.ext.beans.FastPropertyDescriptor@6bf1d74,compute=public java.lang.Object java.util.HashMap.compute(java.lang.Object,java.util.function.BiFunction),hashCode=public int java.util.AbstractMap.hashCode(),putAll=public void java.util.HashMap.putAll(java.util.Map),get=public java.lang.Object java.util.LinkedHashMap.get(java.lang.Object),merge=public java.lang.Object java.util.HashMap.merge(java.lang.Object,java.lang.Object,class=freemarker.ext.beans.FastPropertyDescriptor@406b4220,keySet=public java.util.Set java.util.LinkedHashMap.keySet(),java.lang.Object@237cadde=freemarker.ext.beans.OverloadedMethods@7d33c82e,entrySet=public java.util.Set java.util.LinkedHashMap.entrySet(),forEach=public void java.util.LinkedHashMap.forEach(java.util.function.BiConsumer),containsKey=public boolean java.util.HashMap.containsKey(java.lang.Object),isEmpty=public boolean java.util.HashMap.isEmpty(),clear=public void java.util.LinkedHashMap.clear(),java.lang.Object@26b4c89b={public boolean java.util.HashMap.isEmpty()=[Ljava.lang.class;@792f4ac9,public int java.util.AbstractMap.hashCode()=[Ljava.lang.class;@705ac25,public java.lang.Object java.util.HashMap.put(java.lang.Object,java.lang.Object)=[Ljava.lang.class;@1d6594a7,public boolean java.util.AbstractMap.equals(java.lang.Object)=[Ljava.lang.class;@7e745d9d,public java.lang.Object java.util.LinkedHashMap.get(java.lang.Object)=[Ljava.lang.class;@7d0e2998,public java.lang.String java.util.AbstractMap.toString()=[Ljava.lang.class;@5740c698,public boolean java.util.HashMap.containsKey(java.lang.Object)=[Ljava.lang.class;@66b1a07b,public java.util.Set java.util.LinkedHashMap.keySet()=[Ljava.lang.class;@3af58185,public java.lang.Object java.util.HashMap.computeIfAbsent(java.lang.Object,java.util.function.Function)=[Ljava.lang.class;@36bb3daa,public java.lang.Object java.util.HashMap.clone()=[Ljava.lang.class;@679e59e3,public java.lang.Object java.util.LinkedHashMap.getorDefault(java.lang.Object,java.lang.Object)=[Ljava.lang.class;@cc78f13,public java.util.Set java.util.LinkedHashMap.entrySet()=[Ljava.lang.class;@1a28dea7,public void java.util.LinkedHashMap.forEach(java.util.function.BiConsumer)=[Ljava.lang.class;@7511e625,public java.lang.Object java.util.HashMap.putIfAbsent(java.lang.Object,java.lang.Object)=[Ljava.lang.class;@6055f825,public java.util.Collection java.util.LinkedHashMap.values()=[Ljava.lang.class;@50da5c2b,public void java.util.LinkedHashMap.clear()=[Ljava.lang.class;@c5b6d71,public java.lang.Object java.util.HashMap.computeIfPresent(java.lang.Object,java.util.function.BiFunction)=[Ljava.lang.class;@76818211,public java.lang.Object java.util.HashMap.compute(java.lang.Object,java.util.function.BiFunction)=[Ljava.lang.class;@39dad834,public final native java.lang.class java.lang.Object.getClass()=[Ljava.lang.class;@3b63e020,public void java.util.HashMap.putAll(java.util.Map)=[Ljava.lang.class;@6c8422d8,public void java.util.LinkedHashMap.replaceAll(java.util.function.BiFunction)=[Ljava.lang.class;@16efb453,public java.lang.Object java.util.HashMap.merge(java.lang.Object,java.util.function.BiFunction)=[Ljava.lang.class;@791bc5c2,public int java.util.HashMap.size()=[Ljava.lang.class;@5ddd4821,public boolean java.util.LinkedHashMap.containsValue(java.lang.Object)=[Ljava.lang.class;@100223a0},computeIfPresent=public java.lang.Object java.util.HashMap.computeIfPresent(java.lang.Object,size=public int java.util.HashMap.size(),equals=public boolean java.util.AbstractMap.equals(java.lang.Object),clone=public java.lang.Object java.util.HashMap.clone(),java.lang.Object@75d1b5e8=public java.lang.Object java.util.LinkedHashMap.get(java.lang.Object),toString=public java.lang.String java.util.AbstractMap.toString(),putIfAbsent=public java.lang.Object java.util.HashMap.putIfAbsent(java.lang.Object,java.lang.Object)}
DEBUG   16272   [freemark] (): Key "cssstyle" was not found on instance of java.util.LinkedHashMap. 
DEBUG   16272   [freemark] (): Key "title" was not found on instance of java.util.LinkedHashMap. 
DEBUG   16272   [freemark] (): Couldn''t find template in cache for "template/~~~xhtml/scripting-events.ftl"("en_US",parsed); will try to load it.
DEBUG   16272   [freemark] (): TemplateLoader.findTemplateSource("template/~~~xhtml/scripting-events.ftl"): Found
DEBUG   16272   [freemark] (): Loading template for "template/~~~xhtml/scripting-events.ftl"("en_US",parsed) from "zip:C:/bea/user_projects/domains/Tax_exmp_jdk1_8_domain/servers/AdminServer/tmp/_WL_user/_auto_generated_ear_/f22bx5/war/WEB-INF/lib/struts2-core-2.5.26.jar!/template/simple/scripting-events.ftl"
DEBUG   16272   [freemark] (): Key "ondblclick" was not found on instance of java.util.LinkedHashMap. 
DEBUG   16272   [freemark] (): Key "onmousedown" was not found on instance of java.util.LinkedHashMap. 
DEBUG   16272   [freemark] (): Key "onmouseup" was not found on instance of java.util.LinkedHashMap. 
DEBUG   16272   [freemark] (): Key "onmouSEOver" was not found on instance of java.util.LinkedHashMap. 
DEBUG   16272   [freemark] (): Key "onmousemove" was not found on instance of java.util.LinkedHashMap. 
DEBUG   16272   [freemark] (): Key "onmouSEOut" was not found on instance of java.util.LinkedHashMap. 
DEBUG   16272   [freemark] (): Key "onfocus" was not found on instance of java.util.LinkedHashMap. 
DEBUG   16272   [freemark] (): Key "onblur" was not found on instance of java.util.LinkedHashMap. 
DEBUG   16272   [freemark] (): Key "onkeypress" was not found on instance of java.util.LinkedHashMap. 
DEBUG   16272   [freemark] (): Key "onkeydown" was not found on instance of java.util.LinkedHashMap. 
DEBUG   16272   [freemark] (): Key "onkeyup" was not found on instance of java.util.LinkedHashMap. 
DEBUG   16272   [freemark] (): Key "onselect" was not found on instance of java.util.LinkedHashMap.
DEBUG   16272   [freemark] (): Key "onchange" was not found on instance of java.util.LinkedHashMap.
DEBUG   16272   [freemark] (): Couldn''t find template in cache for "template/~~~xhtml/common-attributes.ftl"("en_US",parsed); will try to load it.
DEBUG   16272   [freemark] (): TemplateLoader.findTemplateSource("template/~~~xhtml/common-attributes.ftl"): Found
DEBUG   16272   [freemark] (): Loading template for "template/~~~xhtml/common-attributes.ftl"("en_US",parsed) from "zip:C:/bea/user_projects/domains/Tax_exmp_jdk1_8_domain/servers/AdminServer/tmp/_WL_user/_auto_generated_ear_/f22bx5/war/WEB-INF/lib/struts2-core-2.5.26.jar!/template/simple/common-attributes.ftl"
DEBUG   16272   [freemark] (): Key "accesskey" was not found on instance of java.util.LinkedHashMap. 
DEBUG   16272   [freemark] (): Couldn''t find template in cache for "template/~~~xhtml/dynamic-attributes.ftl"("en_US",parsed); will try to load it.
DEBUG   16272   [freemark] (): TemplateLoader.findTemplateSource("template/~~~xhtml/dynamic-attributes.ftl"): Found
DEBUG   16272   [freemark] (): Loading template for "template/~~~xhtml/dynamic-attributes.ftl"("en_US",parsed) from "zip:C:/bea/user_projects/domains/Tax_exmp_jdk1_8_domain/servers/AdminServer/tmp/_WL_user/_auto_generated_ear_/f22bx5/war/WEB-INF/lib/struts2-core-2.5.26.jar!/template/simple/dynamic-attributes.ftl"


我现在面临这个问题有一段时间了,但还没有找到解决办法。如果您遇到过这个问题或知道为什么会发生这种情况,请帮助我解决它。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?