Skip to main content

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

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" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
    <Set name="contextPath">/directory</Set>
    <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapp/directory</Set>
</Configure>

My web.xml has this env-entry in it:
 <env-entry>
    <env-entry-name>database.fqn</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>192.168.215.35</env-entry-value>
 </env-entry>

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(SynchronousDispatcher.java:340)
    at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:214)
    at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:190)

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

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

-david-

Back to the top