3 Replies Latest reply on Sep 3, 2003 6:28 AM by ij_dett

    LocalHome not accessible on the server side

    ij_dett

      Hello folks,

      I spend a few days now to find a solution to my problem, but I had no success. I have implemented two EntityBeans (PartyBean and SecurityDataBean). Both have remote and local interfaces. PartyBean references SecurityDataBean. I used XDoclet to generate the interfaces and the deployment descriptors. I also wrote Cactus tests. These tests run inside the server JVM trying to access the remote home interface and the local home interface. The PartyBean tests pass successfully. Both home interfaces of PartyBean can be accessed. But SecurityDataBean's test trying to access the local home interface fails.

      To me this is strange because the EntityBeans are trivial and implemented similar. The generated deployment descriptors look good, too. The generated utility classes contain the code for getting the home interfaces. This code uses the JNDI names to do the lookup.

      The deployment is done via an ear-archive containing a war-archive (containing the test classes) and a jar-archive (containing the EntityBeans and DD).

      The failing test throws the following exception:

      javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: org.jboss.ejb.plugins.local.LocalHomeProxy (no security manager: RMI class loader disabled)]

      The complete stack trace as well as the source code is attached to this topic. I also tried to add jboss.jar to WEB-INF/lib. But this did not help. What really confuses me is the fact that the source code of the tests are similar in structure.
      Can anybody help me? Thank you in advance...

      Ingo

        • 1. Re: LocalHome not accessible on the server side

          Your test is running inside the eclipse VM.
          Unless you are also running jboss in the same VM, you
          cannot use the local interface.

          Investigate JUnitEJB or similar

          Regards,
          Adrian

          • 2. Re: LocalHome not accessible on the server side
            ij_dett

            Adrian,

            thank you for the fast answer. But the Cactus tests runs in the same VM jboss is running. The tests for my PartyBean have the same code layout - and they pass.

            PartyBean's local interface can be accessed - SecurityDataBean's local interface not.

            This is what confuses me!!!

            Kind Regards,
            Ingo

            • 3. Re: LocalHome not accessible on the server side
              ij_dett

              Argh!!!
              I am so blind - and Adrian is right. I found the solution. Class SecurityDataTest was extending the wrong superclass. Extending ServletTestCase instead of TestCase solved the problem. I guess I was the victim of the test case creation wizard of Eclipse.
              Well problem solved - topic closed.
              Adrian I appreciate your comment because it openen my eyes :-)

              Ingo