4 Replies Latest reply on Apr 19, 2009 6:59 AM by jrookie_2402

    Missing SecurityContextInterceptor while starting a HelloWor

      Hello all,
      I try to run a very simple ejb3 application under JBoss5.0.
      It's just Hello World where you give a name and get the reply "Hello ". When I try to start the client I get this message:

      org.jboss.proxy.ejb.SecurityContextInterceptor (no security manager: RMI class loader disabled)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:668)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
      at javax.naming.InitialContext.lookup(Unknown Source)
      at de.akdabas.jli.j2ee.ejb.HelloWorldClient.main(HelloWorldClient.java:37)

      In line 37 of my program there is:

      InitialContext ctx = new InitialContext(env);
      Object objRef = ctx.lookup("ejb/HelloWorld");

      Do I have to set up a security policy, if I try to run a ejb3 application? Or is it something else?
      Deployment of that bean looks alright:

      11:42:35,656 INFO [EjbDeployer] installing bean: ejb/HelloWorld.jar#HelloWorld,uid27633413
      11:42:35,656 INFO [EjbDeployer] with dependencies:
      11:42:35,656 INFO [EjbDeployer] and supplies:
      11:42:35,656 INFO [EjbDeployer] jndi:ejb/HelloWorld
      11:42:35,890 INFO [EjbModule] Deploying HelloWorld
      11:42:35,953 WARN [EjbModule] EJB configured to bypass security. Please verify if this is intended. Bean=HelloWorld Deployment=vfszip:/F:/Entwicklung/JBos
      s_5.0/jboss-5.0.0.GA/server/default/deploy/HelloWorldApp.ear/HelloWorld.jar
      11:42:36,609 INFO [ProxyFactory] Bound EJB Home 'HelloWorld' to jndi 'ejb/HelloWorld'

      Is there anyone who has an idea ??
      regards
      JRookie









        • 1. Re: Missing SecurityContextInterceptor while starting a Hell
          peterj

          Most likely you are just missing some JAR files in your client's classpath. You should have jbossall-client.jar, your client's JAR file and a JAR file containing the interface(s) for your EJB(s).

          • 2. Re: Missing SecurityContextInterceptor while starting a Hell

            Hi Peter,
            thanks for the quick answer.
            Am I right, if I say ejb3 applications do not need a specific security configuration, they just run like servlets or JSPs on a JBoss 5.0 ?

            regards
            JRookie

            • 3. Re: Missing SecurityContextInterceptor while starting a Hell
              peterj

              I think that is comparing apples and oranges. Using a stand-alone Java client to access an EJB is more like using a stand-alone client to access RMI, a JMS destination, or a web service. Servlets and JSPs, on the other hand are typically accessed via a browser.

              The so-called security error you got is a common error when you are missing JAR files. I think what happens is that the JVM recognizes you are attempting to access a remote method and thus assumes the reason for the failure is security-related, but it usually is not.

              • 4. Re: Missing SecurityContextInterceptor while starting a Hell

                Ok, I got it.
                The messages

                org.jboss.proxy.ejb.SecurityContextInterceptor (no security manager: RMI class loader disabled)
                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:668)

                don't mean there is a security problem, but give a hint that jars are missing within my client runtime enviroment, here maybe jndi.jar
                Ok, I had a jbossall-client.jar belonging to my example and there were obviously things missing. The jbossall-client.jar I found in the %jboss_home%/client directory only keeps a manifest file, that lists all jars available in the /client directory. I copied the contents of %jboss_home/client to the /lib directory of my example and started the client again from the /classes directory of my example .... and it worked !!
                Thanks for all
                JRookie