[jetty-user] Jetty jndi env javax.naming.NameNotFoundException

Joe Greenawalt <[email protected]>
Newsgroups gmane.comp.java.jetty.support
Message-ID <[email protected]>
Hi I'm trying to migrate from Tomcat to Jetty. We have environment setting
in jndi that i can't seem to get to work as a deployed app, even though the
maven jetty plugin works for the same app.
ERROR:

    Invocation of init method failed; nested exception is
javax.naming.NameNotFoundException; remaining name
'env/rimPropertiesLocation':
    jvm 1    | javax.naming.NameNotFoundException; remaining name
'env/rimPropertiesLocation'

After reading the docs my set up is like this:
context name = my
JETTY_HOME/contexts/my.xml
environment variable like so (summarized):
...
       <Set name="contextPath">/my</Set>
      <Set name="war"><SystemProperty name="jetty.home"
default="."/>/webapps/my.war</Set>
      <Set name="extractWAR">false</Set>
      <Set name="copyWebDir">false</Set>
    <New id="rimPropertiesLocation"
class="org.mortbay.jetty.plus.naming.EnvEntry">
          <Arg>rimPropertiesLocation</Arg>
          <Arg type="java.lang.String">file:///path/to/MY.properties</Arg>
         <Arg type="boolean">true</Arg>
         </New>
...
JETTY_HOME/etc/jetty.xml (summarized):
...
     <Array id="plusConfig" type="java.lang.String">
        <Item>org.mortbay.jetty.webapp.WebInfConfiguration</Item>
        <Item>org.mortbay.jetty.plus.webapp.EnvConfiguration</Item>
        <Item>org.mortbay.jetty.plus.webapp.Configuration</Item>
        <Item>org.mortbay.jetty.webapp.JettyWebXmlConfiguration</Item>
        <Item>org.mortbay.jetty.webapp.TagLibConfiguration</Item>
      </Array>

      <Call name="addLifeCycle">
          <Arg>
            <New class="org.mortbay.jetty.deployer.WebAppDeployer">
              <Set name="contexts"><Ref id="Contexts"/></Set>
              <Set name="webAppDir"><SystemProperty name="jetty.home"
default="."/>/webapps</Set>
              <Set name="parentLoaderPriority">false</Set>
              <Set name="extract">true</Set>
              <Set name="allowDuplicates">false</Set>
              <Set name="defaultsDescriptor"><SystemProperty
name="jetty.home" default="."/>/etc/webdefault.xml</Set>
              <Set name="configurationClasses"><Ref id="plusConfig"/></Set>
            </New>
          </Arg>
    </Call>
...
I have the war in JETTY_HOME/webapps/my.war


However when i start jetty, the app looks like its starting up correctly (as
in initial config is working) then i get the above mentioned error.  The
lookup for the env/rimPropertiesLocation is set in a spring
applicationContext.xml.


In some examples I have seen an additional < Arg > in the environment
definition, sometimes blank and sometimes with and 'id' or a 'server'.  I
believe I understand their meaning and have tried them all.


Running: latest 6 jetty, on WindowsXP with latest java.

Thanks in advance
j
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.