8 Replies Latest reply on Jul 3, 2015 2:02 AM by Nitin Shukla

    WildFly 8.2 - Is it possible to deploy Spring MVC (.war) application without EE subsystem?

    Nitin Shukla Newbie

      Hello,

       

      I am looking to migrate one of my web application currently running on JBoss AS 7.1 to WildFly 8. After looking to migrate the application to JBoss AS 7.2 I released somewhere in this forum that AS 7.2 will issues with Java 8. Moving to Java 8 is another migration under consideration, hence zeroing on WildFly 8.

       

      I downloaded the WildFly 8.2.Final today and attempting to configure my Web application with this version of server. After some effort in configuring the standalone.xml, I am currently facing issue at the server startup. I am getting below exception when deploying and starting the server.

      2015-06-30 19:54:41,050 ERROR [MSC service thread 1-4:] [org.jboss.msc.service.fail] MSC000001: Failed to start service jboss.deployment.unit."pricing.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."pricing.war".PARSE: JBAS018733: Failed to process phase PARSE of deployment "pricing.war"
      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166)
      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:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NullPointerException
      at org.wildfly.extension.undertow.deployment.WarMetaDataProcessor.deploy(WarMetaDataProcessor.java:368)
      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159)
      ... 5 more

      2015-06-30 19:54:41,064 ERROR [management-handler-thread - 2:] [org.jboss.as.controller.management-operation] JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "pricing.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"pricing.war\".PARSE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"pricing.war\".PARSE: JBAS018733: Failed to process phase PARSE of deployment \"pricing.war\"
          Caused by: java.lang.NullPointerException"}}

      One of the problem I faced when configuring the standalone.xml is sub system - undertow. JBoss AS 7.1 had module org.jboss.as.web that is no more with WildFly 8. As I understand this module is replaced with module org.wildfly.extension.undertow in WildFly 8. However I am not sure if I have configure this correctly. Below are the configurations in AS 7.1 and WildFly 8.2

       

      My AS 7.1 standalone.xml

        <extensions>
          ...
          <extension module="org.jboss.as.web" />
          ...
        </extensions>
        ...
        <subsystem xmlns="urn:jboss:domain:web:1.4" default-virtual-server="default-host" native="false">
           <configuration>
              <jsp-configuration tag-pooling="false" />
           </configuration>
           <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" />
           <virtual-server name="default-host" enable-welcome-root="true">
              <alias name="localhost" />
              <access-log pattern="%h %l %u %t &quot;%r&quot; %s %b %D">
                <directory path="web" />
              </access-log>
           </virtual-server>
        </subsystem>
      
      
      
      
      

       

      My WildFly8.2 standalone.xml

          <extensions>
              ...
              <extension module="org.wildfly.extension.io"/>
              <extension module="org.wildfly.extension.undertow"/>
          </extensions>
      
           <subsystems>
                ...
                <subsystem xmlns="urn:jboss:domain:io:1.1">
                  <worker name="default"/>
                  <buffer-pool name="default"/>
                </subsystem>
                ...
                <subsystem xmlns="urn:jboss:domain:undertow:1.2">
                      <buffer-cache name="default"/>
                      <server name="default-server">
                           <http-listener name="default" socket-binding="http"/>
                           <host name="default-host" alias="localhost">
                                <location name="/" handler="welcome-content"/>
                                <access-log pattern="%h %l %u %t &quot;%r&quot; %s %b %D" directory="web"/>
                           </host>
                      </server>
                      <servlet-container name="default">
                           <jsp-config tag-pooling="false"/>
                           <websockets/>
                      </servlet-container>
                      <handlers>
                           <file name="welcome-content" path="${jboss.home.dir}/welcome-content" directory-listing="true"/>
                      </handlers>
                 </subsystem>
           </subsystems>
      
      
      
      
      

      I am not sure if this is correct migration. Any help in resolving the issue I am facing will be appreciated.

       

      Thanks.

       

      Message was edited by: Nitin Shukla : Updated the host configuration in undertow subsystem to add access-log.

        • 1. Re: WildFly 8.2 server fails to start throwing org.jboss.msc.service.StartException
          Nitin Shukla Newbie

          Hello Forum Members,

           

          I have not yet been able to find the root cause of the issue I am facing. Unfortunately the error stacktrace does not give much insight into what and where configuration is wrong that causes this NullPointerException seen during server startup.

           

          I downloaded the source code of WildFly 8.2.Final to trace this exception to below code in WarMetaDataProcessor.java:368 (Line 4 in snippet).

           

                  //WFLY-3102 EJB in WAR should inherit WAR's security domain
                  if(mergedMetaData.getSecurityDomain() != null) {
                      final EEModuleDescription description = deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION);
                      description.setDefaultSecurityDomain(mergedMetaData.getSecurityDomain());
                  }
          
          
          

          Note that I do not have any EE modules in my application and my standalone.xml does not configure one. This is how my application is currently deployed with JBoss AS 7.1.

           

          Any pointers and insight that helps in resolving the issue I am facing is appreciated.

           

          Thanks.

          • 2. Re: WildFly 8.2 server fails to start throwing org.jboss.msc.service.StartException
            jaikiran pai Master

            Can you try this against WildFly 9.0.0.CR2 http://wildfly.org/downloads/ (a 9.0.0.Final is going to be released soon) and see if it fixes this issue?

            • 3. Re: WildFly 8.2 server fails to start throwing org.jboss.msc.service.StartException
              Tomaz Cerar Master

              Nitin Shukla wrote:

               

              Hello Forum Members,

               

              I have not yet been able to find the root cause of the issue I am facing. Unfortunately the error stacktrace does not give much insight into what and where configuration is wrong that causes this NullPointerException seen during server startup.

               

              I downloaded the source code of WildFly 8.2.Final to trace this exception to below code in WarMetaDataProcessor.java:368 (Line 4 in snippet).

               

              1.         //WFLY-3102 EJB in WAR should inherit WAR's security domain 
              2.         if(mergedMetaData.getSecurityDomain() != null) { 
              3.             final EEModuleDescription description = deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION); 
              4.             description.setDefaultSecurityDomain(mergedMetaData.getSecurityDomain()); 
              5.         } 

              Note that I do not have any EE modules in my application and my standalone.xml does not configure one. This is how my application is currently deployed with JBoss AS 7.1.

               

              Any pointers and insight that helps in resolving the issue I am facing is appreciated.

               

              Thanks.

              Hmm, It could be that when you ware doing migration, you forgot to include EE subsystem in standalone.xml

               

              ee subsystem is there as common subsystem that all other ee related ones use.

              Btw, web module *is* EE deployment.

               

              can you try just with fresh standalone.xml and see if it works? so we can on from there.

              • 4. Re: WildFly 8.2 server fails to start throwing org.jboss.msc.service.StartException
                Nitin Shukla Newbie

                Hello Tomaz,

                 

                Thank you for your reply.

                 

                My AS 7.1 standalone does not include the EE module. If web module *is* EE deployment then I am not sure why AS 7.1 server never complains about. Here is the list of modules we have for AS 7.1 standalone.

                 

                <extensions>
                        <extension module="org.jboss.as.connector"/>
                        <extension module="org.jboss.as.deployment-scanner"/>
                        <extension module="org.jboss.as.logging"/>
                        <extension module="org.jboss.as.naming"/>
                        <extension module="org.jboss.as.remoting"/>
                        <extension module="org.jboss.as.security"/>
                        <extension module="org.jboss.as.transactions"/>
                        <extension module="org.jboss.as.web"/>
                        <extension module="org.jboss.as.messaging"/>
                    </extensions>
                

                In attempt to overcome the issue I am facing I excluded the EE module in my jboss-deployment-structure.xml, however this had no desireable effect.

                 

                With not much options visible I attempted to include the EE module in my standalone.xml of WildFly. This forced me to provide default bindings in the EE subsystem. This overcame the issue I was facing above and finally my application is now launched. However I am still facing issues with ntlm and ldap authentication in my application as I am not able to login.

                 

                What is unclear to me is why WildFly is forcing me to include the EE module when AS 7.1 did not. I have not configured EE module before hence not sure if the ldap and ntlm authentication are broken due to any missing configuration in EE subsystem.

                 

                Thanks.

                • 5. Re: WildFly 8.2 server fails to start throwing org.jboss.msc.service.StartException
                  jaikiran pai Master

                  Like Tomaz already noted, a war deployment is a EE deployment and in order to deploy that you do require EE subsystem. What exactly does your .war contain if it's not a EE web application?

                  • 6. Re: WildFly 8.2 server fails to start throwing org.jboss.msc.service.StartException
                    Nitin Shukla Newbie

                    Hello jaikiran pai,

                     

                    Thanks for your reply.

                     

                    I think my earlier reply caused confusion. Mine is a Spring MVC application and is currently deployed on JBoss AS 7.1 In it's current configuration in JBoss I do not have any EE module configuration in the standalone.xml. I am not sure if this is correct thing to do or not and why original developers of application choose not to define one. The application is running in production for few years now without issues.

                     

                    When I tried to migrate this application to WildFly 8.2, I ran into the above issue. So question is it mandatory for EE module to be configured in standalone and is not optional? In case yes than WildFly is correct to force me to configure one while JBoss AS 7.1 was possibly having this as bug where it didn't enforce it. In case not than why is WildFly enforcing me to do so now?

                     

                    Thanks.

                    • 7. Re: WildFly 8.2 server fails to start throwing org.jboss.msc.service.StartException
                      jaikiran pai Master

                      (Most) Subsystems are optional. EE subsystem is optional too. If you however want to deploy a EE component then it's mandatory to enable EE subsystem.

                       

                      Mine is a Spring MVC application

                      So the real question is - is your Spring MVC application an web application. I'm guessing that it is, because you are using a .war (EE module) to deploy it.

                       

                      To answer why wasn't it throwing an error in previous version, I'm guessing that it was purely lucky and not a intentional design decision.

                      • 8. Re: WildFly 8.2 server fails to start throwing org.jboss.msc.service.StartException
                        Nitin Shukla Newbie

                        Hello jaikiran,

                         

                        Yes my application is a web application.

                         

                        So from your reply I understand that it's some loop hole with JBoss AS 7.1 that allowed it to work even without configuring the EE component. Ideally it should have enforced to configure EE component in standalone.

                         

                        Coming to the original Exception and stacktrace that I encountered with WildFly, can this be more informative to say the something like "EE component missing in standalone.xml when expected". From error I could not make out reason for failure until I saw that source code and made a guess that it is possibly looking for EE subsystem configuration. Possibly this may have been changed in WildFly 9 (as you suggested earlier) but I haven't tried this version yet.

                         

                        Thanks.