Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Can't get env-entry value from web.xml


You need to ensure you have the jars on the classpath that enable j2ee-style features for jetty and configure the webapp to use them also.



On 29 September 2011 03:23, David Haynes <david.dhcinc@xxxxxxxxx> wrote:
I am probably missing something trivial but I can't seem to find it.
I am running Jetty 8.0.1.v20110908 as an embedded server.
My jetty-web.xml file looks like this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting/DTD Configure/EN" "">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
    <Set name="contextPath">/directory</Set>
    <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapp/directory</Set>

My web.xml has this env-entry in it:

When I try to read the value from my webapp, I get the following:
[2011-09-28 13:12:55,638][DEBUG]?:?(?:?): No entry for classloader: WebAppClassLoader=Directory Service@2f996f
[2011-09-28 13:12:55,638][DEBUG]?:?(?:?): Looking up name="env/database.fqn"
[2011-09-28 13:12:55,639][ WARN]?:?(?:?): /directory/api/ping
org.jboss.resteasy.spi.UnhandledException: javax.naming.NameNotFoundException; remaining name 'env/database.fqn'
    at org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(
    at org.jboss.resteasy.core.SynchronousDispatcher.handleException(
    at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(

This is the start method:
public void startServer() throws Exception {
        Connector connector = new SelectChannelConnector();
        connector.setMaxIdleTime(10000);    // 10 seconds
        server = new Server();
        WebAppContext wac = new WebAppContext(warFilePath, contextPath);
        server.setConnectors(new Connector[] { connector });

Does anyone have any idea why its not working?
Any suggestions would be great at this point!


jetty-users mailing list

Back to the top