3 Replies Latest reply on Mar 20, 2004 9:16 AM by adrian.brock

    local jndi name in the jboss.xml

    cari34

      Hi guys,
      I have a stateless session bean that has local and remote interfaces.
      When I try to get a reference to the local home interface (inside the server) I get a ClassCastException.

      In the jboss.xml file I wrote the following:

      <?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>beanName</ejb-name>
      <jndi-name>beanName</jndi-name>
      <local-jndi-name>beanName</local-jndi-name>

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


      I do not know if this is correct.
      How can I declare a local JNDI name for a bean that has both local and
      remote interfaces and could be called both inside and outside JBOSS?

      Any ideas?

      Thank you.

      Cari.

        • 1. Re: local jndi name in the jboss.xml

          Why have you bound the local and remote homes at the same jndi location?

          Regards,
          Adrian

          • 2. Re: local jndi name in the jboss.xml
            cari34

            Hi Adrian,
            thank you for your reply.
            My EJB has local and remote interfaces.

            I do not know how to declare in the jboss.xml file
            the jndi-name and the local-jndi-name for
            the same EJB.

            Do you have any sample of jboss.xml file
            that handles this situation?

            I have another question.
            Could I use the same name as jndi-name and local-jndi-name
            for an EJB?

            I notice also that instead of getting a reference to the localHome Object
            I get a reference to the home (remote) object, using the
            standard way that ejb clients inside the server use i.e
            default InitialContext and simple Java type casting.

            Do you have any idea what could be wrong?
            Thank you
            Cari

            • 3. Re: local jndi name in the jboss.xml

              No you cannot bind the remote and local home in the same place.
              They are different objects.

              Regards,
              Adrian