Bugs item #1020788, was opened at 2004-09-01 15:29
Message generated for change (Settings changed) made by starksm
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=1020788&group_id=22866

Category: JBossServer
Group: v3.2
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Ed Hillmann (ehillman)
>Assigned to: Scott M Stark (starksm)
Summary: ServerException calling gtEJBObject on javax.ejb.Handle

Initial Comment:
I'm using JBoss 3.2.5, and I have some Stateful Session
Beans which are returned to calling clients as a
javax.ejb.Handle instance.  So, the server creates the
instance of the stateful instance of the Remote bean,
gets and returns its handle...

Defined on the UserRemote Interface....

public Handle createDataClient() throws
CreateException, RemoteException {
        DataRemoteHome dataHome = null;
        try {
            dataHome = lookup.getDataRemoteHome();
        } catch (NamingException ex) {
            throw new EJBException("Unable to get
DataRemoteHome reference", ex);
        }
        DataRemote data = dataHome.create(userSettings);
        return data.getHandle();
    }

In my particular client, it calls this method and
immediately retrieves the EJBObject to pass into a
client object which handles it in the client space....

public DataClient createDataClient() throws
ServerAccessException {
        validateState();
        try {
            Handle dataHandle =
userRemote.createDataClient();
            EJBObject ejbObject =
dataHandle.getEJBObject();
            return new
DataClientImplementation((DataRemote) ejbObject);
        } catch (CreateException ce) {
            throw new ServerAccessException(ce);
        } catch (RemoteException re) {
            throw new ServerAccessException(re);
        }
    }

When this client executes, an exception is thrown
during the call to dataHandle.getEJBObject()....

java.rmi.ServerException: Could not get EJBObject;
nested exception is: 
        java.rmi.ServerException: RemoteException occurred in
server thread; nested exception is: 
        java.rmi.ServerException: EJBException:; nested
exception is: 
        javax.ejb.EJBException: checkSecurityAssociation;
nested exception is: java.lang.SecurityException: No
method permissions assigned to method=getEJBObject,
interface=HOME"
type="com.bh.bplan.client.ServerAccessException">com.bh.bplan.client.ServerAccessException:
java.rmi.ServerException: Could not get EJBObject;
nested exception is: 
        java.rmi.ServerException: RemoteException occurred in
server thread; nested exception is: 
        java.rmi.ServerException: EJBException:; nested
exception is: 
        javax.ejb.EJBException: checkSecurityAssociation;
nested exception is: java.lang.SecurityException: No
method permissions assigned to method=getEJBObject,
interface=HOME
        at
com.bh.bplan.client.UserContextImplementation.createDataClient(UserContextImplementation.java:107)
        at
com.bh.bplan.client.UserContextTest.testCreateClients(UserContextTest.java:42)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Caused by: java.rmi.ServerException: Could not get
EJBObject; nested exception is: 
        java.rmi.ServerException: RemoteException occurred in
server thread; nested exception is: 
        java.rmi.ServerException: EJBException:; nested
exception is: 
        javax.ejb.EJBException: checkSecurityAssociation;
nested exception is: java.lang.SecurityException: No
method permissions assigned to method=getEJBObject,
interface=HOME
        at
org.jboss.proxy.ejb.handle.StatefulHandleImpl.getEJBObject(StatefulHandleImpl.java:158)
        at
com.bh.bplan.client.UserContextImplementation.createDataClient(UserContextImplementation.java:102)
        ... 16 more
Caused by: java.rmi.ServerException: RemoteException
occurred in server thread; nested exception is: 
        java.rmi.ServerException: EJBException:; nested
exception is: 
        javax.ejb.EJBException: checkSecurityAssociation;
nested exception is: java.lang.SecurityException: No
method permissions assigned to method=getEJBObject,
interface=HOME
        at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
        at sun.rmi.transport.Transport$1.run(Transport.java:148)
        at java.security.AccessController.doPrivileged(Native
Method)
        at
sun.rmi.transport.Transport.serviceCall(Transport.java:144)
        at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
        at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
        at java.lang.Thread.run(Thread.java:534)
        at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
        at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
        at
org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown
Source)
        at
org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:135)
        at
org.jboss.proxy.ejb.handle.StatefulHandleImpl.getEJBObject(StatefulHandleImpl.java:154)
        ... 17 more
Caused by: java.rmi.ServerException: EJBException:;
nested exception is: 
        javax.ejb.EJBException: checkSecurityAssociation;
nested exception is: java.lang.SecurityException: No
method permissions assigned to method=getEJBObject,
interface=HOME
        at
org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:347)
        at
org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:124)
        at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
        at
org.jboss.ejb.StatefulSessionContainer.internalInvokeHome(StatefulSessionContainer.java:404)
        at org.jboss.ejb.Container.invoke(Container.java:743)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at
org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
        at
org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
        at
org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
        at
org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
        at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
        at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
        at
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:360)
        at
sun.reflect.GeneratedMethodAccessor76.invoke(Unknown
Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
        at sun.rmi.transport.Transport$1.run(Transport.java:148)
        at java.security.AccessController.doPrivileged(Native
Method)
        at
sun.rmi.transport.Transport.serviceCall(Transport.java:144)
        at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
        at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
        at java.lang.Thread.run(Thread.java:534)
Caused by: javax.ejb.EJBException:
checkSecurityAssociation; nested exception is:
java.lang.SecurityException: No method permissions
assigned to method=getEJBObject, interface=HOME
        at
org.jboss.ejb.plugins.SecurityInterceptor.checkSecurityAssociation(SecurityInterceptor.java:186)
        at
org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:83)
        at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:205)
        at
org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invokeHome(StatefulSessionInstanceInterceptor.java:102)
        at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:88)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:341)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:128)
        at
org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
        ... 24 more


The exception is the same exception I was receiving on
other EJB methods that didn't have any method
permissions on them.  That was fine.  I found the
methods and defined roles or unchecked values to the
methods.

However, I don't see where I can assign a method
permission to getEJBObject, and this is a method on the
Handle interface and not on my Home interface at all.

Is this an actual bug?  Or is there some way for me to
configure the server so it can ignore certain methods.
 On first glance, I would've thought that the
getEJBObject method would not have declarative security
on it, but I can't say I know enough to stand by that
argument. ;)

----------------------------------------------------------------------

>Comment By: Scott M Stark (starksm)
Date: 2004-10-08 21:15

Message:
Logged In: YES 
user_id=175228

A better solution has been added for 3.2.6. You still need a
create method permission to obtain the ejb object from the
handle, but you don't have to add a getEJBObject method
permission as is the case with 3.2.5.

----------------------------------------------------------------------

Comment By: Ed Hillmann (ehillman)
Date: 2004-09-15 15:43

Message:
Logged In: YES 
user_id=197687

With Scott Stark's help, a work around was found.  Define
the default method permissions to be unchecked in the
deployment descriptor.  With this set, the exception was
avoided.

However, I still think that it's a bit odd that the method
on the javax.ejb.Handle interface was being impacted by the
method permissions of the EJB it pointed to.  As there's no
clear way to define method permissions of the Handle
instance, I don't feel like this was designed to be included
in the declarative method security of J2EE.

However, I have a workaround.  I will reduce the priority,
but I will leave the ticket and let someone there decide on
whether it's worth following up or closing.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=1020788&group_id=22866


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to