Not from the client. Only java:global is supported from a client code.
-marina
glassfish_at_javadesktop.org wrote:
> Does the embeddable version of Glassfish support the global JNDI lookup name for the application name (java:app/AppName)? I always get a NamingException when I try using it. For example, using 3.0.1:
>
> javax.naming.NamingException: Lookup failed for 'java:app/AppName' in SerialContext [Root exception is javax.naming.NamingException: Could not resolve java:app/AppName]
> at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:442)
> at javax.naming.InitialContext.lookup(Unknown Source)
> at javax.naming.InitialContext.lookup(Unknown Source)
> at com.example.Test.main(Test.java:18)
> Caused by: javax.naming.NamingException: Could not resolve java:app/AppName
> at com.sun.enterprise.container.common.impl.JavaModuleNamingProxy.getAppName(JavaModuleNamingProxy.java:148)
> at com.sun.enterprise.container.common.impl.JavaModuleNamingProxy.handle(JavaModuleNamingProxy.java:100)
> at com.sun.enterprise.naming.impl.NamedNamingObjectManager.tryNamedProxies(NamedNamingObjectManager.java:84)
> at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:153)
> at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:428)
> ... 3 more
>
>
> And using 3.1-SNAPSHOT:
>
> javax.naming.NamingException: Lookup failed for 'java:app/AppName' in SerialContext[targetHost=null,targetPort=null [Root exception is javax.naming.NamingException: Could not resolve java:app/AppName]
> at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:561)
> at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:491)
> at javax.naming.InitialContext.lookup(Unknown Source)
> at javax.naming.InitialContext.lookup(Unknown Source)
> at com.example.Test.main(Test.java:18)
> Caused by: javax.naming.NamingException: Could not resolve java:app/AppName
> at com.sun.enterprise.container.common.impl.JavaModuleNamingProxy.getAppName(JavaModuleNamingProxy.java:166)
> at com.sun.enterprise.container.common.impl.JavaModuleNamingProxy.handle(JavaModuleNamingProxy.java:118)
> at com.sun.enterprise.naming.impl.NamedNamingObjectManager.tryNamedProxies(NamedNamingObjectManager.java:88)
> at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:171)
> at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:538)
> ... 4 more
>
>
> Attached is a trivial example that makes use of the lookup (and fails due to the exception). Is this functionality not currently supported? If that is the case, are there any plans to support this? Thanks in advance!
> [Message sent by forum member 'atomicknight']
>
> http://forums.java.net/jive/thread.jspa?messageID=486373
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>