Jetty
  1. Jetty
  2. JETTY-1091

After upgrading from 6.1.19 to 6.1.20 jetty:run-war and jetty:deploy-war goals start the server but not the application

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.1.20
    • Fix Version/s: 7.0.0, 6.1.21
    • Component/s: Maven
    • Labels:
      None
    • Environment:
      maven 2.2.1
    • Number of attachments :
      3

      Description

      See related jetty users mailing-list topic.

      (odd, 6.1.20 is marked as unreleased version...)

        Issue Links

          Activity

          Hide
          Jan Bartel added a comment -

          Do you have a simple webapp that demonstrates the problem? That would be a big help.

          thanks,
          Jan

          Show
          Jan Bartel added a comment - Do you have a simple webapp that demonstrates the problem? That would be a big help. thanks, Jan
          Hide
          Jan Bartel added a comment -

          Using the example/test-webapp in the distribution and uncommenting the printlns from the src/main/java/com/acme/TagListener.java I can see that the listener is being called correctly for "mvn jetty:run", "mvn jetty:run-war" and "mvn jetty:run-exploded".

          To diagnose further a webapp with a pom that demonstrates the problem will be key.

          thanks
          Jan

          Show
          Jan Bartel added a comment - Using the example/test-webapp in the distribution and uncommenting the printlns from the src/main/java/com/acme/TagListener.java I can see that the listener is being called correctly for "mvn jetty:run", "mvn jetty:run-war" and "mvn jetty:run-exploded". To diagnose further a webapp with a pom that demonstrates the problem will be key. thanks Jan
          Hide
          Stevo Slavic added a comment -

          Attaching foo.bar.jetty.zip example which demonstrates the faulty behavior. It's configured to run jetty:deploy-war @pre-integration-test and jetty:stop @post-integration-test. Spring web application being deployed couldn't be simpler, just starts the web context and on context init a single service bean method is triggered which logs that it has been called.

          In example from archive version 6.1.20 of jetty maven plugin is configured, and if one issues "mvn clean verify" it will be clear from the console log output that application context hasn't been started. If then one changes jetty maven plugin version back to 6.1.19 and issues same command, a lot more log output will be generated, including application context loading info messages, as well as service call log message.

          Show
          Stevo Slavic added a comment - Attaching foo.bar.jetty.zip example which demonstrates the faulty behavior. It's configured to run jetty:deploy-war @pre-integration-test and jetty:stop @post-integration-test. Spring web application being deployed couldn't be simpler, just starts the web context and on context init a single service bean method is triggered which logs that it has been called. In example from archive version 6.1.20 of jetty maven plugin is configured, and if one issues "mvn clean verify" it will be clear from the console log output that application context hasn't been started. If then one changes jetty maven plugin version back to 6.1.19 and issues same command, a lot more log output will be generated, including application context loading info messages, as well as service call log message.
          Hide
          Jan Bartel added a comment - - edited

          Hi Stevo,

          Thanks for the webapp!

          Can you paste in the output you get from running 6.1.20 with:

          • mvn jetty:run
          • mvn jetty:run-war
          • mvn jetty:deploy-war

          I'm not sure of what output you expect to see if things are running correctly, but whenever I run any of the above commands, I get output that indicates the spring classes are being called. I can even hit the spring dispatcher servlet at http://localhost:8181/jetty/ (although it doesn't seem to be configured to respond with anything than a 404 ?).

          The output I get when I do "mvn:run" or "mvn:run-war" or "mvn integration-test" is like so:

          [INFO] Starting jetty 6.1.20 ...
          2009-09-01 12:21:07.162::INFO:  jetty-6.1.20
          2009-09-01 12:21:07.372::INFO:  No Transaction manager found - if your webapp requires one, please configure one.
          2009-09-01 12:21:07.755:/jetty:INFO:  Initializing Spring root WebApplicationContext
          Sep 1, 2009 12:21:07 PM org.springframework.web.context.ContextLoader initWebApplicationContext
          INFO: Root WebApplicationContext: initialization started
          Sep 1, 2009 12:21:07 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
          INFO: Refreshing org.springframework.web.context.support.XmlWebApplicationContext@d510e8: display name [Root WebApplicationContext]; startup date [Tue Sep 01 12:21:07 EST 2009]; root of context hierarchy
          Sep 1, 2009 12:21:07 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
          INFO: Loading XML bean definitions from class path resource [foo/bar/jetty/ctx/web-application-config.xml]
          Sep 1, 2009 12:21:08 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
          INFO: Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@d510e8]: org.springframework.beans.factory.support.DefaultListableBeanFactory@59a735
          Sep 1, 2009 12:21:08 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
          INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@59a735: defining beans [dummyServiceImpl,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor]; root of factory hierarchy
          Sep 1, 2009 12:21:08 PM foo.bar.jetty.services.impl.DummyServiceImpl doSomething
          INFO: Doing something important...
          Sep 1, 2009 12:21:08 PM org.springframework.web.context.ContextLoader initWebApplicationContext
          INFO: Root WebApplicationContext: initialization completed in 513 ms
          2009-09-01 12:21:08.373:/jetty:INFO:  Initializing Spring FrameworkServlet 'foo-bar-jetty'
          Sep 1, 2009 12:21:08 PM org.springframework.web.servlet.FrameworkServlet initServletBean
          INFO: FrameworkServlet 'foo-bar-jetty': initialization started
          Sep 1, 2009 12:21:08 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
          INFO: Refreshing org.springframework.web.context.support.XmlWebApplicationContext@30c963: display name [WebApplicationContext for namespace 'foo-bar-jetty-servlet']; startup date [Tue Sep 01 12:21:08 EST 2009]; parent: org.springframework.web.context.support.XmlWebApplicationContext@d510e8
          Sep 1, 2009 12:21:08 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
          INFO: Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@30c963]: org.springframework.beans.factory.support.DefaultListableBeanFactory@b3c24f
          Sep 1, 2009 12:21:08 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
          INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@b3c24f: defining beans []; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@59a735
          Sep 1, 2009 12:21:08 PM org.springframework.web.servlet.FrameworkServlet initServletBean
          INFO: FrameworkServlet 'foo-bar-jetty': initialization completed in 63 ms
          2009-09-01 12:21:08.466::INFO:  Started SelectChannelConnector@0.0.0.0:8181
          [INFO] Started Jetty Server
          [INFO] Starting scanner at interval of 5 seconds.
          

          Does the above indicate its working as you expect?

          BTW I moved aside my local repo to ensure there was no contamination with local builds, so any jetty jars have come purely from the 6.1.20 plugin's dependencies from the main maven repo.

          cheers
          Jan

          Show
          Jan Bartel added a comment - - edited Hi Stevo, Thanks for the webapp! Can you paste in the output you get from running 6.1.20 with: mvn jetty:run mvn jetty:run-war mvn jetty:deploy-war I'm not sure of what output you expect to see if things are running correctly, but whenever I run any of the above commands, I get output that indicates the spring classes are being called. I can even hit the spring dispatcher servlet at http://localhost:8181/jetty/ (although it doesn't seem to be configured to respond with anything than a 404 ?). The output I get when I do "mvn:run" or "mvn:run-war" or "mvn integration-test" is like so: [INFO] Starting jetty 6.1.20 ... 2009-09-01 12:21:07.162::INFO: jetty-6.1.20 2009-09-01 12:21:07.372::INFO: No Transaction manager found - if your webapp requires one, please configure one. 2009-09-01 12:21:07.755:/jetty:INFO: Initializing Spring root WebApplicationContext Sep 1, 2009 12:21:07 PM org.springframework.web.context.ContextLoader initWebApplicationContext INFO: Root WebApplicationContext: initialization started Sep 1, 2009 12:21:07 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh INFO: Refreshing org.springframework.web.context.support.XmlWebApplicationContext@d510e8: display name [Root WebApplicationContext]; startup date [Tue Sep 01 12:21:07 EST 2009]; root of context hierarchy Sep 1, 2009 12:21:07 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from class path resource [foo/bar/jetty/ctx/web-application-config.xml] Sep 1, 2009 12:21:08 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory INFO: Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@d510e8]: org.springframework.beans.factory.support.DefaultListableBeanFactory@59a735 Sep 1, 2009 12:21:08 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@59a735: defining beans [dummyServiceImpl,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor]; root of factory hierarchy Sep 1, 2009 12:21:08 PM foo.bar.jetty.services.impl.DummyServiceImpl doSomething INFO: Doing something important... Sep 1, 2009 12:21:08 PM org.springframework.web.context.ContextLoader initWebApplicationContext INFO: Root WebApplicationContext: initialization completed in 513 ms 2009-09-01 12:21:08.373:/jetty:INFO: Initializing Spring FrameworkServlet 'foo-bar-jetty' Sep 1, 2009 12:21:08 PM org.springframework.web.servlet.FrameworkServlet initServletBean INFO: FrameworkServlet 'foo-bar-jetty': initialization started Sep 1, 2009 12:21:08 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh INFO: Refreshing org.springframework.web.context.support.XmlWebApplicationContext@30c963: display name [WebApplicationContext for namespace 'foo-bar-jetty-servlet']; startup date [Tue Sep 01 12:21:08 EST 2009]; parent: org.springframework.web.context.support.XmlWebApplicationContext@d510e8 Sep 1, 2009 12:21:08 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory INFO: Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@30c963]: org.springframework.beans.factory.support.DefaultListableBeanFactory@b3c24f Sep 1, 2009 12:21:08 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@b3c24f: defining beans []; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@59a735 Sep 1, 2009 12:21:08 PM org.springframework.web.servlet.FrameworkServlet initServletBean INFO: FrameworkServlet 'foo-bar-jetty': initialization completed in 63 ms 2009-09-01 12:21:08.466::INFO: Started SelectChannelConnector@0.0.0.0:8181 [INFO] Started Jetty Server [INFO] Starting scanner at interval of 5 seconds. Does the above indicate its working as you expect? BTW I moved aside my local repo to ensure there was no contamination with local builds, so any jetty jars have come purely from the 6.1.20 plugin's dependencies from the main maven repo. cheers Jan
          Hide
          Stevo Slavic added a comment -

          Attaching maven output files that I get when running "mvn clean verify", in one case when jetty maven plugin 6.1.20 (maven_out_6_1_20.log) is configured and the other (maven_out_6_1_19.log) with version 6.1.19 of it. In both cases Apache Maven 2.2.1 is being used, with Java 1.6 update 16 on Windows XP SP3. Same happens with the clean local repository, with addition of all the dependencies being downloaded.

          Show
          Stevo Slavic added a comment - Attaching maven output files that I get when running "mvn clean verify", in one case when jetty maven plugin 6.1.20 (maven_out_6_1_20.log) is configured and the other (maven_out_6_1_19.log) with version 6.1.19 of it. In both cases Apache Maven 2.2.1 is being used, with Java 1.6 update 16 on Windows XP SP3. Same happens with the clean local repository, with addition of all the dependencies being downloaded.
          Hide
          Jan Bartel added a comment -

          Stevo,

          Thanks for the extra info.

          My platform is: maven 2.2.1, java 1.6.0_14 on linux Ubuntu Jaunty Jackalope.

          Strangely, it doesn't fail for me. I always get the spring stuff initialized correctly.

          I will have to find someone with a windows box to see if they can reproduce it with that version of maven, jetty and java and then debug if they can it to fail.
          Might have to bite the bullet and install vmware

          cheers
          Jan

          Show
          Jan Bartel added a comment - Stevo, Thanks for the extra info. My platform is: maven 2.2.1, java 1.6.0_14 on linux Ubuntu Jaunty Jackalope. Strangely, it doesn't fail for me. I always get the spring stuff initialized correctly. I will have to find someone with a windows box to see if they can reproduce it with that version of maven, jetty and java and then debug if they can it to fail. Might have to bite the bullet and install vmware cheers Jan
          Hide
          Jan Bartel added a comment -

          The fix in JETTY-1080 does not work on windows, meaning that war files will be incompletely unpacked. This means that the war deploys without WEB-INF/web.xml and therefore none of the servlets or listeners are run. This affects both jetty-standalone and jetty maven plugin, although the "mvn jetty:run" goal should still work as it operates on the unassembled webapp.

          Show
          Jan Bartel added a comment - The fix in JETTY-1080 does not work on windows, meaning that war files will be incompletely unpacked. This means that the war deploys without WEB-INF/web.xml and therefore none of the servlets or listeners are run. This affects both jetty-standalone and jetty maven plugin, although the "mvn jetty:run" goal should still work as it operates on the unassembled webapp.
          Hide
          Jan Bartel added a comment -

          A different fix for JETTY-1080 has been applied that works on both windows and linux.

          The supplied example webapp now deploys fine.

          Show
          Jan Bartel added a comment - A different fix for JETTY-1080 has been applied that works on both windows and linux. The supplied example webapp now deploys fine.

            People

            • Assignee:
              Jan Bartel
              Reporter:
              Stevo Slavic
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: