5 Replies Latest reply on Feb 20, 2004 9:18 PM by mbutler

    Why can't you use local interfaces for CMP EJBs?

    Ian Ian Newbie

      I'm having trouble accessing a local interface bean, and I'm not sure what I'm doing wrong. The error I'm getting when looking up the name is:
      javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: org.jboss.ejb.plugins.local.LocalHomeProxy (no security manager: RMI class loader disabled)]
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:652)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      (plus a heap more).

      It concerns me that the class where the error occurs is a JBoss class.

      I'm using JBoss 3.2.3 (default configuration), JDK 1.4.2, running through Eclipse 2.1 and JBossIDE 1.2.2. I'm trying to deploy the client class through Cactus, which means it should be able to access the local interfaces.

      Not sure what else would help, but let me know if anything can help. BTW, the EJB works well if you access it via the REMOTE interface. I'm using XDoclet to generate the interfaces, so I don't think it's a hand-coding mistake.

        • 1. Re: Why can't you use local interfaces for CMP EJBs?
          Joachim Van der Auwera Expert

          Ae you trying to use the local interface from inside the same JVM as JBoss, or is JBoss running on the same machine?

          Local interfaces are only available inside the same JVM as where JBoss is running. he machine which runs either side is not relevant.

          Joachim

          • 2. Re: Why can't you use local interfaces for CMP EJBs?
            Ian Ian Newbie

            Cactus is an in-container test framework, so it is running in the same JVM.

            • 3. Re: Why can't you use local interfaces for CMP EJBs?
              mbutler Newbie

              I'm using just about the same setup, JBoss 3.2.3 (default configuration as well), JDK 1.4.2, running through Eclipse 2.1, JBossIDE 1.2.2, Junit and Cactus. All of our EJB's are running through local interfaces. I've been able to use the same setup as I recently did on a project using Websphere 5.1 without any changes to my project design at all.
              The small modifications that I had to do were configuration issues related to the Classloader. I scoped the ear to have it's own classloader and had my war specified to use the 2.3 spec.
              It sounds like the problem may be where your unit tests are located. We have all of ours included in the war file. Please feel free to contact me for further information.

              • 4. Re: Why can't you use local interfaces for CMP EJBs?
                Ian Ian Newbie

                At last, somebody seems to have the same setup! How do you do the changes you mentioned? BTW, the test classes are part of the WAR file so that ought to be ok.

                Was going to e-mail, but it doesn't want to let me do it!

                • 5. Re: Why can't you use local interfaces for CMP EJBs?
                  mbutler Newbie

                  I noticed the same problem with the email on the forums here as well. Here's how I scoped out the ear and it's war.
                  1) Include a jboss-app.xml in the ear's meta-inf directory. The jboss-app.xml should contain the following:
                  <jboss-app>
                  <loader-repository>some.dot.com:loader=ROMApp.ear</loader-repository>
                  </jboss-app>

                  This will create a new UCL for the ear. If you are running on the box by yourself, it's not necessary, but it will isolate you from someone loading conflicting jars at the system classloader level

                  2) Include in your jboss-web.xml in your war the following line:
                  <class-loading java2ClassLoadingCompliance='false'/>
                  This will force your war to use the 2.3 Servlet spec. Out of the box, JBoss uses the 2.2 spec. You can also change this at the app server level by editing the jboss-service.xml under the tomcat.sar.

                  If you have any further problems please feel free to contact me at the below address:
                  mbutler@interjsolutions.com

                  Good luck!

                  Sincerely,

                  Michael G. Butler
                  Senior Enterprise Architect
                  InterJ Solutions, Inc.