EJB error due to NoPermissionException on JNDI lookup of JDBC datasource (Doc ID 878116.1)

Last updated on JUNE 09, 2016

Applies to:

Oracle Weblogic Server - Version 8.1 and later
Information in this document applies to any platform.
***Checked for relevance on 17-Jul-2013***

Symptoms

When trying to lookup JDBC datasource inside EJB create method, the following NoPermissionException was thrown:


com.examples.sessionbean.client.Client" com.examples.sessionbean.client.ClientException in thread "main" javax.naming.NoPermissionException: User <anonymous> does not have permission on StatelessHello to perform lookup operation. [Root exception is javax.naming.NoPermissionException: User <anonymous> does not have permission on StatelessHello to perform lookup operation.]
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:221)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:338)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252)
at weblogic.jndi.internal.ServerNamingNode_1001_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:379)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:367)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.examples.sessionbean.client.Client.main(Client.java:34)
Caused by: javax.naming.NoPermissionException: User <anonymous> does not have permission on StatelessHello to perform lookup operation.

Changes

In admin console, JNDI under security policies group was changed from "everyone" to a specified group for testing.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms