Getting java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener at Server startup - Struts 2.3.28 & Tile-core-2.2.2

荒凉一梦 提交于 2020-01-25 07:28:09

问题


We are migrating struts 1.2.9 to strtus 2.3.28. In the process i have added StrutsTilesListener in WEB.xml. I'm getting the below exception while trying to start Wildfly 10.1 server with struts 2.3.28 and tiles-api-2.2.2.

Any solution to fix this issue would be helpful.

Jars in lib folder:
struts2-convention-plugin-2.3.28.jar
struts2-tiles-plugin-2.3.28.jar
struts2-core-2.3.28.jar
tiles-api-2.2.2.jar
tiles-core-2.2.2.jar
tiles-request-api-1.0.1.jar
tiles-request-servlet-1.0.1.jar
tiles-servlet-2.2.2.jar
tiles-template-2.2.2.jar

WEB.xml

<web-app version="2.5"  xmlns="http://java.sun.com/xml/ns/javaee"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> 
    <servlet>
      <servlet-name>setup</servlet-name>
      <servlet-class>com.presentation.servlets.SetupServlet</servlet-class>      
      <init-param>
        <param-name>monitoredFiles</param-name>
        <param-value>monitoredfiles.properties</param-value>
      </init-param>      
    </servlet>  
<filter>
        <filter-name>DispatcherFilter</filter-name>
        <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
        <init-param>
            <param-name>config</param-name>
            <param-value>
                /WEB-INF/struts-config/struts.xml,/WEB-INF/struts-config/struts-plugin.xml,/WEB-INF/struts-config/struts-user.xml</param-value>
        </init-param>

    </filter>
    <listener>
        <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
    </listener>
    <context-param id="struts_tiles">  
            <param-name>org.apache.tiles.DEFINITIONS_CONFIG</param-name>  
            <param-value>/WEB-INF/tiles-base-defs.xml,  /WEB-INF/tiles-user-defs.xml</param-value>  
    </context-param>
</web-app>

Console Error:

13:36:29,735 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./bmt.UndertowDeploymentInfoService: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./bmt.UndertowDeploymentInfoService: java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener from [Module "deployment.bmt.ear.bmt.war:main" from Service Module Loader]
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:1079)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.start(UndertowDeploymentInfoService.java:284)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener from [Module "deployment.bmt.ear.bmt.war:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.addListener(UndertowDeploymentInfoService.java:1364)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:860)

来源:https://stackoverflow.com/questions/59874449/getting-java-lang-classnotfoundexception-org-apache-struts2-tiles-strutstilesli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!