Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

No method permissions assigned to method=create, interface=LOCALHOME  RSS feed

 
Tim Cockle
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I hope you can help, I have been stuck on the same problem for a day now!!!

I am using Jboss 3.2.1, middlegen and Xdoclet.

I have a set of entity beans and a few session beans. I have created a session bean with a remote interface that is used by a remote client.

The client logs on using the logincontext then uses the remote interface of a session bean to preform a series of tasks. Basically this will be:
Look for a Person Entity Bean
Create a new Diary Entity Bean

I use Xdoclet to secure the session bean by adding the following to the different method comments:
* @ejb.permission role-name="pda_user"
* view-type="remote"

And use middlegen �cmp20-ALL-class-comments.txt� to add the following to the entity beans
*
* @ejb.permission unchecked="true"
*

The client logs in fine,
It access the session bean
The session bean uses the PersonLocalHome interface to search for a person (this will not work if I remove the middlegen comments)
The sesson bean user the PersonLocal interface to access the person's name

However, when the session tries to call create() from DiaryLocalHome I get:
java.lang.SecurityException: No method permissions assigned to method=create, interface=LOCALHOME
at org.jboss.ejb.plugins.SecurityInterceptor.checkSecurityAssociation(SecurityInterceptor.java:179)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:81)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
at org.jboss.ejb.StatelessSessionContainer.internalInvokeHome(StatelessSessionContainer.java:310)
at org.jboss.ejb.Container.invoke(Container.java:694)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:272)
at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
at $Proxy3649.create(Unknown Source)
at alpha.personEntities.DiaryBean.ejbCreate(Unknown Source)
etc...etc...etc...

The ejb-jar.xml has the following information (I am just including the interesting bits):


<security-role>
<description><![CDATA[description not supported yet by ejbdoclet]]></description>
<role-name>pda_user</role-name>
</security-role>

<method-permission >
<description><![CDATA[description not supported yet by ejbdoclet]]></description>
<unchecked/>
<method >
<description><![CDATA[description not supported yet by ejbdoclet]]></description>
<ejb-name>Person</ejb-name>
<method-name>*</method-name>
</method>
</method-permission>

<method-permission >
<description><![CDATA[description not supported yet by ejbdoclet]]></description>
<unchecked/>
<method >
<description><![CDATA[description not supported yet by ejbdoclet]]></description>
<ejb-name>Diary</ejb-name>
<method-name>*</method-name>
</method>
</method-permission>
<method-permission >
<description><![CDATA[description not supported yet by ejbdoclet]]></description>
<role-name>pda_user</role-name>
<method >
<description><![CDATA[]]></description>
<ejb-name>ReportLoader</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>create</method-name>
<method-params>
</method-params>
</method>
</method-permission>
<method-permission >
<description><![CDATA[description not supported yet by ejbdoclet]]></description>
<role-name>pda_user</role-name>
<method >
<description><![CDATA[]]></description>
<ejb-name>ReportLoader</ejb-name>
<method-intf>Home</method-intf>
<method-name>create</method-name>
<method-params>
</method-params>
</method>
</method-permission>
<method-permission >
<description><![CDATA[description not supported yet by ejbdoclet]]></description>
<role-name>pda_user</role-name>
<method >
<description><![CDATA[]]></description>
<ejb-name>ReportLoader</ejb-name>
<method-intf>Remote</method-intf>
<method-name>createReport</method-name>
<method-params>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
<method-param>java.util.Date</method-param>
<method-param>java.util.Date</method-param>
<method-param>java.util.Date</method-param>
<method-param>java.util.Date</method-param>
</method-params>
</method>
</method-permission>
<method-permission >
<description><![CDATA[description not supported yet by ejbdoclet]]></description>
<role-name>pda_user</role-name>
<method >
<description><![CDATA[]]></description>
<ejb-name>ReportLoader</ejb-name>
<method-intf>Remote</method-intf>
<method-name>attachFile</method-name>
<method-params>
<method-param>byte[]</method-param>
<method-param>java.lang.String</method-param>
<method-param>int</method-param>
</method-params>
</method>
</method-permission>
<method-permission >
<description><![CDATA[description not supported yet by ejbdoclet]]></description>
<role-name>pda_user</role-name>
<method >
<description><![CDATA[]]></description>
<ejb-name>ReportLoader</ejb-name>
<method-intf>Remote</method-intf>
<method-name>commit</method-name>
<method-params>
</method-params>
</method>
</method-permission>

I have tried different configurations including giving the entity beans the same role-name. But they all come up with the same error. Interestingly I did at one point give the entity beans
a different role name. This gave a different error namely that the user did not have the correct role. When I added the role to the user the same error as now appeared.

Thanks in advance,

(My head hurts now)

Tim
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!