0 Replies Latest reply on Jan 22, 2003 1:31 PM by kloostec

    JBoss 3.0.5 no  method permissions error

    kloostec

      I'm using a combination of JBoss 3.0.5 (tested also under 3.0.4) and XDoclet 1.1.2. I have written an entity bean DirectoryNameBean, and XDoclet automatically generates the Data object for it. In my session bean, I have a getEmailsForDirectoryName which takes a DirectoryNameData object as the only parameter. The XDoclet info is as follows:

      /**
      * @ejb:interface-method view-type="both"
      * @ejb:permission role-name="Editor,Viewer"
      **/
      public Collection getEmailsForDirectoryName(DirectoryNameData dirNameData)

      The line of code that actually uses the DirectoryNameData object is:

      DirectoryName dirName = lHome.findByPrimaryKey(dirNameData.getNickName());

      In both a command line client, and a jsp page, I get the following error when trying to call this method:

      Error: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
      java.rmi.ServerException: EJBException:; nested exception is:
      javax.ejb.EJBException: checkSecurityAssociation; CausedByException is:
      No method permissions assigned to method=getEmailsForDirectoryName, interface=REMOTE

      When clearly there is method permissions assigned to this object. I have checked the deployment descriptor and everything checks out properly there, too.

      When I change the parameter to a plain Object, and then later cast the object to a DirectoryNameData (when it's needed), the method all of a sudden starts working:

      /**
      * @ejb:interface-method view-type="both"
      * @ejb:permission role-name="Editor,Viewer"
      **/
      public Collection getEmailsForDirectoryName(Object dirNameData)

      The line of code using the DirectoryNameData now being:

      DirectoryName dirName = lHome.findByPrimaryKey(((DirectoryNameData)dirNameData).getNickName());

      Why does the first set of code fail, while the second work perfectly fine? Is there a way that I can use the first set of code so that I don't have to use a hack?