Struts2在war文件中的jar文件中并且Struts2作为Wildfly模块部署时找不到我的动作

问题描述 投票:0回答:1

我正在使用Wildfly,并将Struts2部署为模块。我将project.war文件部署到独立/部署中。在project.war / WEB-INF / lib中有一个project-web.jar文件,其中包含我的Struts2操作。我正在使用Conventional插件。在我的struts2.xml中,我有以下内容:

<constant name="struts.convention.action.includeJars" value=".*?/project-web.*?jar(!/)?"/>
<constant name="struts.convention.exclude.parentClassLoader" value="true" />
<constant name="struts.convention.action.fileProtocols" value="file,jar,zip"/>

我得到的错误包括

2019-11-26 13:21:01,511 WARN  [com.opensymphony.xwork2.util.fs.DefaultFileManager] (default task-6) Could not normalize URL [vfs:.../wildfly-10.1.0.Final/bin/content/project-war-0.0.1.war] to file protocol!
2019-11-26 13:21:01,520 WARN  [org.apache.struts2.convention.PackageBasedActionConfigBuilder] (default task-6) The includeJars pattern [.*?/project-web.*?jar(!/)?] did not match any jars in the classpath
2019-11-26 13:21:01,523 ERROR [com.opensymphony.xwork2.util.ResolverUtil] (default task-6) Could not search jar file '...\wildfly-10.1.0.Final\bin\content\project-0.0.1.war\WEB-INF\lib\project-web-0.0.1.jar\com\company\project\actions' for classes matching criteria: org.apache.struts2.config.ClasspathPackageProvider$1@606e8501 due to an IOException: java.io.FileNotFoundException: ...\wildfly-10.1.0.Final\bin\content\project-0.0.1.war\WEB-INF\lib\project-web-0.0.1.jar\com\company\project\actions (The system cannot find the path specified)

虽然Wildfly中没有bin \ content文件夹,但我发现它与JBoss vfs有关。

请注意,当我使用project.war而不是模块部署Struts2时,webapp可以工作。

为什么Struts2无法找到我的动作?

java struts2 struts2-convention-plugin
1个回答
0
投票

似乎Struts2的早期版本在JBoss的VFS中有问题。我从2.3.24升级到2.5.20,这似乎使我超过了这一点。

© www.soinside.com 2019 - 2024. All rights reserved.