1 Reply Latest reply on Nov 22, 2002 1:07 PM by rouadec

    deployment error when securing bean access

    rouadec

      Hello,
      I've got one session bean (called BopManagement) referencing another external session bean called RequestManagement (not the same package, but the same server). They work fine together but when I modify the BopManagement one in order to secure it (using my own LoginModule, and a configuration which was prooved to work fine by itseld on other beans) then jboss complained about some tags missing in the RequestManagement ejb-jar.xml/jboss.xml files, tags which are presents since thoses files hasn't changed and it didn't complain before the security changes...

      I'm using Jboss 3.0.1RC1 bundled with tomcat 4.0.4

      Any idea is welcome,
      Antoine

      Here is the JBOSS deployment error:
      17:52:46,933 ERROR [STDERR] Incomplete Deployment listing:
      Packages waiting for a deployer:

      Incompletely deployed packages:

      MBeans waiting for classes:

      MBeans waiting for other MBeans:
      [ObjectName: jboss.j2ee:service=EJB,jndiName=BopManagement
      state: FAILED
      I Depend On:
      Depends On Me: org.jboss.deployment.DeploymentException: ejb-ref ejb/RequestMan
      agement, expected either ejb-link in ejb-jar.xml or jndi-name in jboss.xml]
      17:52:46,933 ERROR [STDERR] at org.jboss.deployment.MainDeployer.checkIncomp
      leteDeployments(MainDeployer.java:1081)
      17:52:46,933 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(Main
      Deployer.java:583)
      17:52:46,933 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(Main


      here are the BopManagement bean config files:
      EJB-JAR:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
      <ejb-jar>
      No Description.
      <display-name>Generated by XDoclet</display-name>
      <enterprise-beans>
      <!-- Session Beans -->

      Provides a session facade that works with cmp/cmr from EJB 2.0 based entity beans.
      <ejb-name>BopManagement</ejb-name>
      com.degroof.domain.BopManagementHome
      com.degroof.domain.BopManagement
      <ejb-class>com.degroof.Bop.BopManagementBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
      <ejb-ref>
      <ejb-ref-name>ejb/RequestManagement</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      com.degroof.domain.RequestManagementHome
      com.degroof.domain.RequestManagement
      </ejb-ref>
      <ejb-local-ref>
      <ejb-ref-name>ejb/Bop</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <local-home>com.degroof.domain.BopLocalHome</local-home>
      com.degroof.domain.BopLocal
      <ejb-link>Bop</ejb-link>
      </ejb-local-ref>

      <security-identity>
      <run-as>
      <role-name>JBOSS</role-name>
      </run-as>
      </security-identity>



      <!-- Entity Beans -->

      This entity bean represents a bop used to generat a report.
      <ejb-name>Bop</ejb-name>
      <local-home>com.degroof.domain.BopLocalHome</local-home>
      com.degroof.domain.BopLocal
      <ejb-class>com.degroof.Bop.BopBean</ejb-class>
      <persistence-type>Bean</persistence-type>
      <prim-key-class>com.degroof.domain.BopPK</prim-key-class>
      False


      </enterprise-beans>
      <assembly-descriptor>
      <security-role>
      <role-name>DEG_User</role-name>
      </security-role>
      <security-role>
      <role-name>JBOSS_Supervisor</role-name>
      </security-role>
      <method-permission>
      <role-name>DEG_User</role-name>
      <role-name>JBOSS_Supervisor</role-name>

      <ejb-name>BopManagement</ejb-name>
      <method-name>*</method-name>


      <ejb-name>Bop</ejb-name>
      <method-name>*</method-name>

      </method-permission>
      ...

      JBOSS:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">

      <security-domain>java:/jaas/MomRealm</security-domain>
      <enterprise-beans>

      <ejb-name>Bop</ejb-name>
      <local-jndi-name>Bop</local-jndi-name>


      <ejb-name>BopManagement</ejb-name>
      <jndi-name>BopManagement</jndi-name>

      </enterprise-beans>
      <resource-managers>
      </resource-managers>



      for the RequestManagement bean:
      EJB-JAR:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

      <ejb-jar >

      No Description.
      <display-name>Generated by XDoclet</display-name>

      <enterprise-beans>

      <!-- Session Beans -->

      <![CDATA[Provides a session facade that works with cmp/cmr from EJB 2.0 based entity beans.]]>

      <ejb-name>RequestManagement</ejb-name>

      com.degroof.domain.RequestManagementHome
      com.degroof.domain.RequestManagement
      <ejb-class>com.degroof.Request.RequestManagementBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>

      <ejb-local-ref >
      <ejb-ref-name>ejb/Request</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <local-home>com.degroof.domain.RequestLocalHome</local-home>
      com.degroof.domain.RequestLocal
      <ejb-link>Request</ejb-link>
      </ejb-local-ref>



      <!--
      To add session beans that you have deployment descriptor info for, add
      a file to your merge directory called session-beans.xml that contains
      the markup for those beans.
      -->

      <!-- Entity Beans -->

      <![CDATA[This entity bean represents a request used to generat a report.]]>

      <ejb-name>Request</ejb-name>

      <local-home>com.degroof.domain.RequestLocalHome</local-home>
      com.degroof.domain.RequestLocal

      <ejb-class>com.degroof.Request.RequestBean</ejb-class>
      <persistence-type>Bean</persistence-type>
      <prim-key-class>com.degroof.domain.RequestPK</prim-key-class>
      False



      <!--
      To add entity beans that you have deployment descriptor info for, add
      a file to your merge directory called entity-beans.xml that contains
      the markup for those beans.
      -->

      <!-- Message Driven Beans -->
      <!--
      To add message driven beans that you have deployment descriptor info for, add
      a file to your merge directory called message-driven-beans.xml that contains
      the <message-driven></message-driven> markup for those beans.
      -->

      </enterprise-beans>
      ...

      JBOSS:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">

      <enterprise-beans>

      <ejb-name>Request</ejb-name>
      <local-jndi-name>Request</local-jndi-name>


      <ejb-name>RequestManagement</ejb-name>
      <jndi-name>RequestManagement</jndi-name>

      </enterprise-beans>
      <resource-managers>
      </resource-managers>



      thanks again