1 Reply Latest reply on Mar 21, 2005 10:22 AM by Peter Korsten

    Cannot deploy EJB with both remote and local interfaces

    Peter Korsten Newbie

      Hi,

      I'm having a problem on JBoss 3.2.1 (old, but it's worked fine so far). There's an application using an EJB and application clients on remote desktops, which has been working flawlessly so far. Because of a rather complex authentication/authorisation/security issue, I've decided to split some of the methods between a remote interface (for application clients) and a local interface (for web clients). However, it only deploys the remote interface, unless I comment everything out about the remote interface, at which point the local interface is deployed. Here are the Xdoclet tags I use:

      * @ejb:bean name="ejb/directory/Directory"
       * display-name="Handles all requests for directory and information services"
       * type="Stateless"
       * view-type="both"
       * jndi-name="ejb/directory/DirectoryBean"
       * local-jndi-name="ejb/directory/DirectoryLocalBean"
       * @ejb:ejb-ref ejb-name="ejb/directory/Directory"
       * ref-name="ejb/directory/DirectoryBean"
       * view-type="remote"
       * @ejb:ejb-ref ejb-name="ejb/directory/Directory"
       * ref-name="ejb/directory/DirectoryLocalBean"
       * view-type="local"
       * @ejb.security-role-ref role-name="directory-common"
       * role-link="directory-common"
       * @ejb.security-role-ref role-name="directory-prepaid"
       * role-link="directory-prepaid"
       * @ejb.security-role-ref role-name="directory-compiled"
       * role-link="directory-compiled"
       * @ejb.security-role-ref role-name="directory-information"
       * role-link="directory-information"
       * @ejb.security-role-ref role-name="directory-administrator"
       * role-link="directory-administrator"
       * @ejb.security-role-ref role-name="directory-view-prepaid"
       * role-link="directory-view-prepaid"
       * @ejb.security-role-ref role-name="directory-web"
       * role-link="directory-web"
       * @ejb.security-role-ref role-name="directory-mss"
       * role-link="directory-mss"
       * @ejb.security-role-ref role-name="directory-mss-log"
       * role-link="directory-mss-log"


      This leads to the following ejb-jar.xml:

      <?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 >
      
       <description>No Description.</description>
       <display-name>Generated by XDoclet</display-name>
      
       <enterprise-beans>
      
       <!-- Session Beans -->
       <session >
       <description>[CDATA[<p>The main class of the business logic.]]</description>
       <display-name>Handles all requests for directory and information services</display-name>
      
       <ejb-name>ejb/directory/Directory</ejb-name>
      
       <home>vodafonemalta.directory.ejb.DirectoryHome</home>
       <remote>vodafonemalta.directory.ejb.Directory</remote>
       <local-home>vodafonemalta.directory.ejb.DirectoryLocalHome</local-home>
       <local>vodafonemalta.directory.ejb.DirectoryLocal</local>
       <ejb-class>vodafonemalta.directory.ejb.DirectoryBean</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
      
       <ejb-ref >
       <ejb-ref-name>ejb/directory/DirectoryBean</ejb-ref-name>
       <ejb-ref-type>Session</ejb-ref-type>
       <home>vodafonemalta.directory.ejb.DirectoryHome</home>
       <remote>vodafonemalta.directory.ejb.Directory</remote>
       <ejb-link>ejb/directory/Directory</ejb-link>
       </ejb-ref>
      
       <ejb-local-ref >
       <ejb-ref-name>ejb/directory/DirectoryLocalBean</ejb-ref-name>
       <ejb-ref-type>Session</ejb-ref-type>
       <local-home>vodafonemalta.directory.ejb.DirectoryLocalHome</local-home>
       <local>vodafonemalta.directory.ejb.DirectoryLocal</local>
       <ejb-link>ejb/directory/Directory</ejb-link>
       </ejb-local-ref>
       <security-role-ref>
       <role-name>directory-common</role-name>
       <role-link>directory-common</role-link>
       </security-role-ref>
       <security-role-ref>
       <role-name>directory-prepaid</role-name>
       <role-link>directory-prepaid</role-link>
       </security-role-ref>
       <security-role-ref>
       <role-name>directory-compiled</role-name>
       <role-link>directory-compiled</role-link>
       </security-role-ref>
       <security-role-ref>
       <role-name>directory-information</role-name>
       <role-link>directory-information</role-link>
       </security-role-ref>
       <security-role-ref>
       <role-name>directory-administrator</role-name>
       <role-link>directory-administrator</role-link>
       </security-role-ref>
       <security-role-ref>
       <role-name>directory-view-prepaid</role-name>
       <role-link>directory-view-prepaid</role-link>
       </security-role-ref>
       <security-role-ref>
       <role-name>directory-web</role-name>
       <role-link>directory-web</role-link>
       </security-role-ref>
       <security-role-ref>
       <role-name>directory-mss</role-name>
       <role-link>directory-mss</role-link>
       </security-role-ref>
       <security-role-ref>
       <role-name>directory-mss-log</role-name>
       <role-link>directory-mss-log</role-link>
       </security-role-ref>
      
       </session>
      
       </enterprise-beans>
      
       <!-- assembly-descriptor skipped, no need to include 800 lines -->
      
      </ejb-jar>


      And this jboss.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">
      
      <jboss>
      
       <enterprise-beans>
      
       <session>
       <ejb-name>ejb/directory/Directory</ejb-name>
       <jndi-name>ejb/directory/DirectoryBean</jndi-name>
       <local-jndi-name>ejb/directory/DirectoryLocalBean</local-jndi-name>
       </session>
      
       </enterprise-beans>
      
       <resource-managers>
       </resource-managers>
      
      </jboss>


      This is what the JMX console shows:

      jboss.j2ee
      jndiName=ejb/directory/DirectoryBean,plugin=pool,service=EJB
      jndiName=ejb/directory/DirectoryBean,service=EJB
      
      jndiName=ejb/mgmt/MEJB,plugin=pool,service=EJB
      jndiName=ejb/mgmt/MEJB,service=EJB...
      
      


      Is there something obviously wrong that I'm doing? As said, I've successfully run this application for almost two years, and another, web-based application with just a local interface for a year and a half. Both un on 3.2.1. Just the combination of remote and local interfaces isn't working.

      Thanks in advance,

      - Peter

        • 1. Re: Cannot deploy EJB with both remote and local interfaces
          Peter Korsten Newbie

          OK, it appears to be not a problem at all. For those who may encounter the same problem, let me outline the solution to this problem, which doesn't exist in the first place.

          There's only one listing in the JMX console, because obviously there's only one bean. If browsed with a JNDI broswer, JBoss shows both the local and remote home interfaces.

          The mistake I made was putting too much information in the ejbdoclet tags. Apart from the security-role-ref tags, there's only this left:

          * @ejb:bean name="ejb/directory/Directory"
           * display-name="Handles all requests for directory and information services"
           * type="Stateless"
           * view-type="both"

          This leaves me with the authentication problem that I described in this thread (http://www.jboss.org/index.html?module=bb&op=viewtopic&t=61640), but at least I'm getting somewhere. There's only one problem left to deal with.

          Thanks to all who had sleepless nights over this problem. ;)

          - Peter