i didn't try by java:app can work too or legacy names (<simple name><interface type> by default) should be work too.
but well today JNDI looks old and CDI should replace it pretty soon ;) *Romain Manni-Bucau* *Twitter: @rmannibucau <https://twitter.com/rmannibucau>* *Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/7/29 tschuler <[email protected]> > Hi Romain! > > I can confirm it works from webapps, but within an ejb I'm still failing. > But anyhow: The main point is that with new InitialContext() an access to > the tomcat context is possible - I expected access to the TomEE context. > Sorry for that. > So a lookup needs to know about the ear name and the jar name and is > therefore no alternative to use initial context with TomEE initial context > factory as property. > > Thanks for clarification, > Thomas > > Von: Romain Manni-Bucau [via OpenEJB] [mailto: > [email protected]] > Gesendet: Montag, 29. Juli 2013 10:01 > An: Thomas Schuler > Betreff: Re: Initial context properties definition > > what i don't get is from the webapp you can do: > > new InitialContext().lookup("java:global/logApp/jar2/LogMessageJar2") > new InitialContext().lookup("java:global/logApp/jar1/LogMessageJar1") > > it only doesn't work if you call it from a class loaded with lib and which > is not an EJB > > *Romain Manni-Bucau* > *Twitter: @rmannibucau <https://twitter.com/rmannibucau>* > *Blog: **http://rmannibucau.wordpress.com/*< > http://rmannibucau.wordpress.com/> > *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* > *Github: https://github.com/rmannibucau* > > > > 2013/7/29 tschuler <[hidden > email]</user/SendEmail.jtp?type=node&node=4664413&i=0>> > > > Hi Romain! > > > > Attached an example: Just deploy the ear and use > > http://localhost:8080/logs1 or http://localhost:8080/logs2 to get the > > example running. > > > > - The console output shows Context environment and JNDI tree for > > new InitialContext() and JNDI tree for new > > InitialContext(org.apache.openejb.core.LocalInitialContextFactory) > > > > - The output is generated by > > deployment.server.jar2.LogMessageJar2Remote. > > > > Best regards, > > Thomas > > > > Von: Romain Manni-Bucau [via OpenEJB] [mailto: > > [hidden email]</user/SendEmail.jtp?type=node&node=4664413&i=1>] > > Gesendet: Montag, 29. Juli 2013 08:19 > > An: Thomas Schuler > > Betreff: Re: Initial context properties definition > > > > that's normal. > > > > now i think you said the magic word: ear. Is the class doing the lookup > in > > the lib part (i mean not in a webapp?). If so you can need properties i > > think, if not you clearly shouldn't and a sample would be great. > > > > *Romain Manni-Bucau* > > *Twitter: @rmannibucau <https://twitter.com/rmannibucau>* > > *Blog: **http://rmannibucau.wordpress.com/*< > > http://rmannibucau.wordpress.com/> > > *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* > > *Github: https://github.com/rmannibucau* > > > > > > > > 2013/7/29 tschuler <[hidden > > email]</user/SendEmail.jtp?type=node&node=4664411&i=0>> > > > > > Hi Romain! > > > > > > A deeper look inside (context environment) show that by default the > > tomcat > > > context factory org.apache.naming.java.javaURLContextFactory is used as > > > initial context factory. > > > If you need an example, I may provide an ear file and the according > > > sources. > > > > > > Best regards, > > > Thomas > > > > > > > > > > > > -- > > > View this message in context: > > > > > > http://openejb.979440.n4.nabble.com/Initial-context-properties-definition-tp4664367p4664410.html > > > Sent from the OpenEJB User mailing list archive at Nabble.com. > > > > > > > ________________________________ > > If you reply to this email, your message will be added to the discussion > > below: > > > > > http://openejb.979440.n4.nabble.com/Initial-context-properties-definition-tp4664367p4664411.html > > To unsubscribe from Initial context properties definition, click here< > > >. > > NAML< > > > http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml > > > > > > > > > logApp.ear (13K) < > > http://openejb.979440.n4.nabble.com/attachment/4664412/0/logApp.ear> > > src.zip (6K) < > > http://openejb.979440.n4.nabble.com/attachment/4664412/1/src.zip> > > > > > > > > > > -- > > View this message in context: > > > http://openejb.979440.n4.nabble.com/Initial-context-properties-definition-tp4664367p4664412.html > > Sent from the OpenEJB User mailing list archive at Nabble.com. > > > > ________________________________ > If you reply to this email, your message will be added to the discussion > below: > > http://openejb.979440.n4.nabble.com/Initial-context-properties-definition-tp4664367p4664413.html > To unsubscribe from Initial context properties definition, click here< > http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4664367&code=dGhvbWFzLnNjaHVsZXJAb3BlbnRleHQuY29tfDQ2NjQzNjd8LTE4NTIyNTQ0OTI= > >. > NAML< > http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml > > > > > > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/Initial-context-properties-definition-tp4664367p4664418.html > Sent from the OpenEJB User mailing list archive at Nabble.com. >
