Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Attempting to integrate quickstart in the build process



Jan Bartel ha scritto il 10/05/2017 alle 16:07:
So it looks like we might need to do a bit more work on the documentation.

I'm not really sure which aspect you're having trouble with:  the
pre-generation of the quickstart war or the use of the webapp afterwards?


Actually both: while I succeeded in using mvn jetty:effective-web-xml (but didn't use it, see below), I failed to do that from inside docker container (see attached file)


If it's pre-generation, you don't necessarily have to do a special step
in the generation of your webapp to generate the quickstart-web.xml.
[...]


I skipped the lazy generation because what I need is to make it faster from the first run: I'm in the process of implementing continuous delivery and webapps have to restart as fast as possible



INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=xxxms

On subsequent restarts you won't see that line.


Ah good to know: then I suppose that, with a pregenerated file, I won't see that line any longer



As the doco mentions, there is a goal of the maven-jetty-plugin that
uses quickstart to generate an effective web.xml for you - if you want
you can save the output of mvn jetty:effective-web-xml into a file
called quickstart-web.xml and put it into your webapp, but that would be
a bit of a manual process.


docs also mention that that output may contain stuff found on jars included by maven but which are not included in the war: that's why I tried it to see what was its output and then looked for ways to make it "more right"


Sounds like it would be useful to have a maven plugin that did the
quickstart generation as part of a webapp build cycle, don't fancy
contributing one do you? :)


Indeed I do and, time permitting, I'll make one

regards

federico
/var/lib/jetty # CLASSPATH=.; for a in `find /usr/local/jetty/lib/ -name '*.jar'` ; do CLASSPATH=$CLASSPATH:$a ; done
/var/lib/jetty # java -cp $CLASSPATH org.eclipse.jetty.quickstart.PreconfigureQuickStartWar webapps/root.war 
2017-05-10 15:17:45.855:INFO::main: Logging initialized @150ms to org.eclipse.jetty.util.log.StdErrLog
2017-05-10 15:17:45.988:INFO:oejs.Server:main: jetty-9.4.5.v20170502
2017-05-10 15:17:46.011:INFO:oejq.QuickStartWebApp:main: Quickstart Extract file:///var/lib/jetty/webapps/root.war to file:///var/lib/jetty/webapps/root
Exception in thread "main" java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider org.eclipse.jetty.cdi.websocket.WebSocketCdiInitializer not found
	at java.util.ServiceLoader.fail(ServiceLoader.java:239)
	at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
	at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:372)
	at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
	at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
	at org.eclipse.jetty.annotations.AnnotationConfiguration.getNonExcludedInitializers(AnnotationConfiguration.java:788)
	at org.eclipse.jetty.annotations.AnnotationConfiguration.configure(AnnotationConfiguration.java:361)
	at org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:517)
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1458)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:785)
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
	at org.eclipse.jetty.quickstart.QuickStartWebApp.doStart(QuickStartWebApp.java:201)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
	at org.eclipse.jetty.server.Server.start(Server.java:452)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
	at org.eclipse.jetty.server.Server.doStart(Server.java:419)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.eclipse.jetty.quickstart.PreconfigureQuickStartWar.preconfigure(PreconfigureQuickStartWar.java:114)
	at org.eclipse.jetty.quickstart.PreconfigureQuickStartWar.main(PreconfigureQuickStartWar.java:78)


Back to the top