I have a stateless Session Bean EJBs deployed on the OC4J Application Server that calls this method:
public
String getCurrentTime()
{
return ""+ new java.util.Date();
}
I try to access it from a client running on the same machine(windows nt).
DateEJBClient dateEJBClient = new DateEJBClient();
try
{
Context context = getInitialContext();
DateEJBHome dateEJBHome = (DateEJBHome)PortableRemoteObject.narrow(context.lookup("DateEJB"), DateEJBHome.class);
DateEJB dateEJB;
// Use one of the create() methods below to create a new instance
dateEJB = dateEJBHome.create();
// Call any of the Remote methods below to access the
EJB System.out.println("Date & Time >>> "+dateEJB.getCurrentTime());
}
catch(Throwable ex)
Any idea why I get this error?
com.evermind.server.rmi.OrionRemoteException: jazn.com/admin is not allowed to call this EJB method, check your security settings (method-permission in ejb-jar.xml and security-role-mapping in orion-application.xml).
at DateEJBHome_StatelessSessionHomeWrapper3.create(DateEJBHome_StatelessSessionHomeWrapper3.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:124)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:534)
at connection to localhost/127.0.0.1 as admin
at DateEJBHome_StatelessSessionHomeWrapper3.create(DateEJBHome_StatelessSessionHomeWrapper3.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:124)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:534)
Process exited with exit code 0.