Details
Description
See related jetty users mailing-list topic.
(odd, 6.1.20 is marked as unreleased version...)
-
Hide
- foo.bar.jetty.zip
- 31/Aug/09 2:25 AM
- 6 kB
- Stevo Slavic
-
- foo.bar.jetty/pom.xml 4 kB
- foo.bar.jetty/src/.../DummyService.java 0.1 kB
- foo.bar.jetty/src/.../DummyServiceImpl.java 0.6 kB
- foo.bar.jetty/.../web-application-config.xml 0.6 kB
- foo.bar.jetty/src/.../META-INF/MANIFEST.MF 0.0 kB
- foo.bar.jetty/src/main/.../WEB-INF/web.xml 2 kB
-
- maven_out_6_1_19.log
- 01/Sep/09 12:24 AM
- 7 kB
- Stevo Slavic
-
- maven_out_6_1_20.log
- 01/Sep/09 12:24 AM
- 3 kB
- Stevo Slavic
Issue Links
- relates to
-
JETTY-1080
improve unpacking of war
-
Activity
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
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.
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
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.
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
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.
A different fix for JETTY-1080 has been applied that works on both windows and linux.
The supplied example webapp now deploys fine.
Do you have a simple webapp that demonstrates the problem? That would be a big help.
thanks,
Jan