3 Replies Latest reply on May 19, 2015 5:00 AM by jaikiran

    wildfly not loading class from web.xml

    samalaraj72

      in Wildfly am getting below Exception :

       

       

      Here is web.xml

            

      <?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"

              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

              version="2.5">

         

         

            <display-name>Test </display-name>

            <context-param>

              <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>

              <param-value>messages</param-value>

            </context-param>

            <filter>

              <filter-name>exportFilter</filter-name>

              <filter-class>org.displaytag.filter.ResponseOverrideFilter</filter-class>

            </filter>

            <filter>

              <filter-name>encodingFilter</filter-name>

              <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>

              <init-param>

                <param-name>encoding</param-name>

                <param-value>UTF-8</param-value>

              </init-param>

              <init-param>

                <param-name>forceEncoding</param-name>

                <param-value>true</param-value>

              </init-param>

            </filter>

            <filter>

              <filter-name>messageFilter</filter-name>

              <filter-class>com.Test.us.web.MessageFilter</filter-class>

            </filter>

            <filter>

          </web-app>

       

       

       

       

       

      Here is My Log :

       

       

       

          17:16:04,774 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC0000

          01: Failed to start service jboss.undertow.deployment.default-server.default-hos

          t./.UndertowDeploymentInfoService: org.jboss.msc.service.StartException in servi

          ce jboss.undertow.deployment.default-server.default-host./.UndertowDeploymentInf

          oService: java.lang.ClassNotFoundException: com.Test.us.web.MessageFilter fr

          om [Module "deployment.TestRWD_JB60_Testing.war:main" from Service Module Lo

          ader]

                  at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoServi

          ce.createServletConfig(UndertowDeploymentInfoService.java:933)

                  at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoServi

          ce.start(UndertowDeploymentInfoService.java:256)

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(Se

          rviceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceCont

          rollerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]

                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.

          java:1142) [rt.jar:1.8.0_40]

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor

          .java:617) [rt.jar:1.8.0_40]

                  at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_40]

          Caused by: java.lang.ClassNotFoundException: com.Test.us.web.MessageFilter f

          rom [Module "deployment.TestRWD_JB60_Testing.war:main" from Service Module L

          oader]

                  at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:

          213) [jboss-modules.jar:1.3.3.Final]

                  at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(Con

          currentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final]

                  at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(Concu

          rrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final]

                  at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentCl

          assLoader.java:389) [jboss-modules.jar:1.3.3.Final]

                  at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoad

          er.java:134) [jboss-modules.jar:1.3.3.Final]

                  at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoServi

          ce.createServletConfig(UndertowDeploymentInfoService.java:724)

                  ... 6 more

         

         

          17:16:04,861 ERROR [org.jboss.as.controller.management-operation] (DeploymentSca

          nner-threads - 2) JBAS014613: Operation ("deploy") failed - address: ([("deploym

          ent" => "TestRWD_JB60_Testing.war")]) - failure description: {"JBAS014671: F

          ailed services" => {"jboss.undertow.deployment.default-server.default-host./.Und

          ertowDeploymentInfoService" => "org.jboss.msc.service.StartException in service

          jboss.undertow.deployment.default-server.default-host./.UndertowDeploymentInfoSe

          rvice: java.lang.ClassNotFoundException: com.Test.us.web.MessageFilter from

          [Module \"deployment.TestRWD_JB60_Testing.war:main\" from Service Module Loa

          der]

              Caused by: java.lang.ClassNotFoundException: com.Test.us.web.MessageFilt

          er from [Module \"deployment.TestRWD_JB60_Testing.war:main\" from Service Mo

          dule Loader]"}}

          17:16:05,048 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018

          559: Deployed "TestRWD_JB60_Testing.war" (runtime-name : "TestRWD_JB60_T

          esting.war")

          17:16:05,052 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBA

          S014774: Service status report

          JBAS014777:   Services which failed to start:      service jboss.undertow.deploy

          ment.default-server.default-host./.UndertowDeploymentInfoService: org.jboss.msc.

          service.StartException in service jboss.undertow.deployment.default-server.defau

          lt-host./.UndertowDeploymentInfoService: java.lang.ClassNotFoundException: com.Test.us.web.MessageFilter from [Module "deployment.TestRWD_JB60_Testing.w

          ar:main" from Service Module Loader]

          - See more at: https://developer.jboss.org/message/929842#929842

        • 1. Re: wildfly not loading class from web.xml
          jaysensharma

          The Error which you are getting indicates that you might not have packaged the "com.Test.us.web.MessageFilter"  class inside the WAR "TestRWD_JB60_Testing.war".

           

          java.lang.ClassNotFoundException: com.Test.us.web.MessageFilter from [Module "deployment.TestRWD_JB60_Testing.war:main" from Service Module Loader]
          

           

          So can you please clarify where exactly have you placed the  "com.Test.us.web.MessageFilter"   inside the "TestRWD_JB60_Testing.war/WEB-INF/classes"   OR   "TestRWD_JB60_Testing.war/WEB-INF/lib/any.jar"

          • 2. Re: wildfly not loading class from web.xml
            samalaraj72

            HI Jay,

             

            My com.Test.us.web.MessageFilter is available in "testlib.jar" file under  TestRWD_JB60_Testing.war/WEB-INF/lib/testlib.jar


            FYI :  the class has no errors, it was working in jboss 6

            • 3. Re: wildfly not loading class from web.xml
              jaikiran

              Which operating system are you running this on?

               

              com.Test.us.web.MessageFilter #sthash.bANtNIdd.dpuf

              I suspect there might be some case sensitivity thing going on with that package name and the folder it resides in. Post the output of

               

              jar -tf testlib.jar