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

Joe Greenawalt <[email protected]>
Newsgroups gmane.comp.java.jetty.support
Message-ID <[email protected]>
I tried both and neither made a change.  I can't see anything in the debug output that specifically helps, but there is a lot there.   I have a datasource that's defined first,  and it seems to pass the muster,(although its a resource) because before I had the mysql jar in lib/ext it would fail with class not found.  so something is parsing the file.  not sure what else to try though.

thanks,
j

On Jan 14, 2011, at 12:21 PM, Jesse McConnell <[email protected]> wrote:

> what is the output when you enable debug?  I suspect its just not
> processing the jndi bits on startup
> 
> also try just adding the plus to the options in the start.ini file
> 
> additionally, it shouldn't make a difference but you could try adding
> <Arg></Arg> to the jdni bits your configuring like most of the
> examples have for the scope field.
> 
> cheers,
> jesse
> 
> --
> jesse mcconnell
> [email protected]
> 
> 
> 
> On Fri, Jan 14, 2011 at 11:07, Joe Greenawalt <[email protected]> wrote:
>> Ok, thank you.  I have 7 where 6 was and starting with the same error.
>> in my jetty.xml i added:
>> <Call name="setAttribute">
>>       <Arg>org.eclipse.jetty.webapp.Configuration</Arg>
>>       <Arg>
>>           <Array type="java.lang.String">
>>               <Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item>
>>               <Item>org.eclipse.jetty.webapp.WebXmlConfiguration</Item>
>>               <Item>org.eclipse.jetty.webapp.MetaInfConfiguration</Item>
>>               <Item>org.eclipse.jetty.webapp.FragmentConfiguration</Item>
>>               <Item>org.eclipse.jetty.plus.webapp.EnvConfiguration</Item>
>>               <Item>org.eclipse.jetty.plus.webapp.Configuration</Item>
>>               <Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item>
>>               <Item>org.eclipse.jetty.webapp.TagLibConfiguration</Item>
>>           </Array>
>>       </Arg>
>>     </Call>
>> and in my webapp context file i have this:
>> <Configure class="org.eclipse.jetty.webapp.WebAppContext">
>>   <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="myDataSource" class="org.eclipse.jetty.plus.jndi.Resource">
>>   <Arg>jdbc/myDataSource</Arg>
>>   <Arg>
>>    <New class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource">
>>     <Set name="Url">jdbc:mysql://localhost:3306/mydb</Set>
>>     <Set name="User">username</Set>
>>     <Set name="Password">password</Set>
>>    </New>
>>   </Arg>
>>  </New>
>> 
>>  <New id="rimPropertiesLocation"
>> class="org.eclipse.jetty.plus.jndi.EnvEntry">
>>   <Arg>rimPropertiesLocation</Arg>
>>   <Arg type="java.lang.String">file:///etc/rim/RIMR3.properties</Arg>
>>  <Arg type="boolean">true</Arg>
>>  </New>
>> ......
>> </Configure>
>> starting with the command:
>> java -jar start.jar OPTIONS=All,plus
>> 
>> with the error:
>> ....Invocation of init method failed; nested exception is
>> javax.naming.NameNotFoundException; remaining name
>> 'env/rimPropertiesLocation'
>> Other note: i changed my app so it wouldn't look up rimPropertiesLocation
>> and the error just failed to the next jndi environment property, so its not
>> that one specifically.
>> Thanks,
>> j
>> 
>> On Fri, Jan 14, 2011 at 11:10 AM, Jesse McConnell
>> <[email protected]> wrote:
>>> 
>>> http://wiki.eclipse.org/Jetty/Feature/JNDI
>>> 
>>> cheers,
>>> jesse
>>> 
>>> --
>>> jesse mcconnell
>>> [email protected]
>>> 
>>> 
>>> 
>>> On Fri, Jan 14, 2011 at 10:08, Joe Greenawalt <[email protected]>
>>> wrote:
>>>> well, i thought about that, but looking over the documentation and
>>>> setup, it
>>>> seemed that for JNDI and Windows (has to be windows) it seemed like 6
>>>> was a
>>>> better candidate for a proof of concept, but if your offering to help
>>>> with 7
>>>> i'm game.
>>>> let me try 7, i've made some inroads there.  Do you have a link for jndi
>>>> setup and jetty 7?
>>>> thanks,
>>>> joe
>>>> 
>>>> On Fri, Jan 14, 2011 at 10:59 AM, Jesse McConnell
>>>> <[email protected]> wrote:
>>>>> 
>>>>> First off I would recommend using jetty7 if your just starting out, no
>>>>> reason to start out on the deprecated release.
>>>>> 
>>>>> http://www.eclipse.org/jetty/
>>>>> 
>>>>> http://wiki.eclipse.org/Jetty
>>>>> 
>>>>> if you have issues on jetty7 do come back and we'll help you get it
>>>>> sorted
>>>>> out.
>>>>> 
>>>>> if there is a compelling reason your using jetty6 lemme know
>>>>> 
>>>>> cheers,
>>>>> jesse
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> jesse mcconnell
>>>>> [email protected]
>>>>> 
>>>>> 
>>>>> 
>>>>> On Fri, Jan 14, 2011 at 07:48, Joe Greenawalt
>>>>> <[email protected]>
>>>>> wrote:
>>>>>> 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
>>>>>> 
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe from this list, please visit:
>>>>> 
>>>>>    http://xircles.codehaus.org/manage_email
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>> 
>>>    http://xircles.codehaus.org/manage_email
>>> 
>>> 
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>    http://xircles.codehaus.org/manage_email
> 
> 

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
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.