0 Replies Latest reply on Dec 14, 2004 12:03 PM by realmaxim

    HELP ! SecurityException in SLSB ejbCreate() with unchecked

    realmaxim

      I have next SLSB declaration:
      /**
      * @ejb.bean
      * view-type="local"
      *
      * @ejb.permission
      * unchecked="true"
      */
      public class MonitoringServiceBean extends BaseServiceBean {
      ....
      /**
      * @ejb.create-method
      */
      public void ejbCreate() throws CreateException {}

      /**
      * @ejb.interface-method
      */
      public void handleResourceEvent(MonitoringEvent event)
      throws SystemException, ApplicationException {
      .......
      }
      }

      Next part of ejb-jar.xml generated by XDoclet:
      <method-permission >
      [CDATA[description not supported yet by ejbdoclet]]

      <role-name>User</role-name>

      [CDATA[description not supported yet by ejbdoclet]]
      <ejb-name>MonitoringService</ejb-name>
      <method-name>*</method-name>

      </method-permission>

      <method-permission >
      [CDATA[description not supported yet by ejbdoclet]]


      [CDATA[]]
      <ejb-name>MonitoringService</ejb-name>
      <method-intf>LocalHome</method-intf>
      <method-name>create</method-name>
      <method-params>
      </method-params>

      </method-permission>
      <method-permission >
      [CDATA[description not supported yet by ejbdoclet]]


      [CDATA[]]
      <ejb-name>MonitoringService</ejb-name>
      <method-intf>Home</method-intf>
      <method-name>create</method-name>
      <method-params>
      </method-params>

      </method-permission>

      But when i call my bean create() method from struts action like:
      "MonitoringServiceLocalHome.create()"
      JBoss from time to time (it may be once in 8-10 hours; create() called ~ each second) throws next exception:

      javax.ejb.EJBException: checkSecurityAssociation; CausedByException is:
      Authentication exception, principal=sempre
      at org.jboss.ejb.plugins.SecurityInterceptor.checkSecurityAssociation(SecurityInterceptor.java:166)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:83)
      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:319)
      at org.jboss.ejb.Container.invoke(Container.java:743)
      at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:294)
      at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
      at $Proxy129.create(Unknown Source)

      Seems like ejbCreate() method fails because some security error....
      But just second before and second after it works perfectly.

      Anybody could help ?