Did you actually check if it works?
I get
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.visit(IterativeDescriptorProcessor.java:80)
at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.process(IterativeDescriptorProcessor.java:67)
at org.eclipse.jetty.webapp.MetaData.resolve(MetaData.java:284)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1130)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:577)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:491)
at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:160)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.eclipse.jetty.server.handler.HandlerCollection$1.run(HandlerCollection.java:200)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:450)
at java.lang.Thread.run(Thread.java:662)
Caused by:
java.lang.IllegalStateException: Nothing to bind for name javax.sql.DataSource/default
at org.eclipse.jetty.plus.webapp.PlusDescriptorProcessor.bindEntry(PlusDescriptorProcessor.java:793)
at org.eclipse.jetty.plus.webapp.PlusDescriptorProcessor.bindResourceRef(PlusDescriptorProcessor.java:708)
at org.eclipse.jetty.plus.webapp.PlusDescriptorProcessor.visitResourceRef(PlusDescriptorProcessor.java:232)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.visit(IterativeDescriptorProcessor.java:80)
at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.process(IterativeDescriptorProcessor.java:67)
at org.eclipse.jetty.webapp.MetaData.resolve(MetaData.java:284)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1130)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:577)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:491)
at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:160)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.eclipse.jetty.server.handler.HandlerCollection$1.run(HandlerCollection.java:200)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:450)
at java.lang.Thread.run(Thread.java:662)
I have the following in pom.xml (src is defined as "$
{project.basedir}
/src")
<configuration>
<webAppSourceDirectory>$
{src}/main/webapp</webAppSourceDirectory>
<scanIntervalSeconds>5</scanIntervalSeconds>
<webApp>
<jettyEnvXml>${src}
/main/webapp/META-INF/jetty-env.xml</jettyEnvXml>
<contextPath>/myBCM</contextPath>
<baseResource>
<resourcesAsCSV>$
{src}/main/webapp</resourcesAsCSV>
</baseResource>
</webApp>
</configuration>
With my patch it worked when i put <jettyEnvXml> directly in <configuration>, like this:
<configuration>
<webAppSourceDirectory>${src}
/main/webapp</webAppSourceDirectory>
<scanIntervalSeconds>5</scanIntervalSeconds>
<jettyEnvXml>$
{src}/main/webapp/META-INF/jetty-env.xml</jettyEnvXml>
<webApp>
<contextPath>/myBCM</contextPath>
<baseResource>
<resourcesAsCSV>${src}
/main/webapp</resourcesAsCSV>
</baseResource>
</webApp>
</configuration>
The topic was raised before and left unresolved (see http://comments.gmane.org/gmane.comp.java.jetty.support/14194?set_lines=100000)
Hi Stephan,
Actually this is a problem with the documentation. The <jettyEnvXml> can be set on any <webApp> element and take effect. The documentation makes it look as if it should be specified outside of the <webApp> element, but that is not the case, as the <webApp> refers to the JettyWebAppContext instance.
I've fixed the doco now.
cheers
Jan