5 Replies Latest reply on Jul 31, 2006 10:09 PM by stormy

    Accessing EJB3 from an Applet...

    abelmj

      Can anybody tell me which is the best way to access EJB3 from an Applet?. After reading the specification I can't find any reference about it.

      Thanks a lot!

        • 1. Re: Accessing EJB3 from an Applet...
          clebert.suconic

          Even with J2EE 1.4 would recommend a servlet.
          I still do.

          • 2. Re: Accessing EJB3 from an Applet...
            abelmj

            Thank you for the quick answer, but the problem is that I need to access from a rich-gui swing applet, i.e. I need to obtain some EJB entities from the server, and then paint the information in a rich-gui application (each type of entity would lead the painting of the related GUI-Object), and as far as I know I can't do that in plain HTML, but with swing I could do almost anything rich-gui.

            • 3. Re: Accessing EJB3 from an Applet...
              wauwau0977

              hi

              for me this worked for swing apps as well as JUnit tests (which run in separate JVM).

              1) add to java installation where the server is running: lib/security/java.policy the following line in grant section:

              permission java.security.AllPermission;


              2) on the client in java somewhere in a init method

              RMISecurityManager securityManager = new RMISecurityManager();
              System.setSecurityManager(securityManager);


              then resolve the remote interface as usual.

              regards,
              patrick heusser

              --
              patrick heusser
              http://www.x8ing.com


              • 4. Re: Accessing EJB3 from an Applet...
                abelmj

                Thanks for the trick wauwau0977, I'll try.

                clebert.suconic, could you tell me why don't you recommend an Applet please?, in my case, as I told you, is not an option, but a requirement?

                • 5. Re: Accessing EJB3 from an Applet...
                  stormy

                  I'm having the same problem.

                  My application works great when it's a full standalone client, but when changing it to an applet, the jndi always returns a javax.naming.reference object instead of returning a bean like it normaly should.


                  wauwau0977, I tried what you said, but it does nothing. My policy is already set to grant all (which helped with other problems by the way), and the RMISecurityManager did nothing on the client.

                  However, I'm running on the same JVM as JBoss, could this be the problem ?

                  Any help is appreciated ;)

                  Tanks.