Ask the Expert

Implementing an EJB with a LocalHome using JBoss

I am trying to implement an EJB with a LocalHome using JBoss:
HelloLocal
   Object refLocal = context.lookup("HelloLocal"); 
   .......

But it throws an exception:
javax.naming.CommunicationException [Root exception is
java.lang.ClassNotFoundException:
org.jboss.ejb.plugins.local.LocalHomeProxy (no security manager: RMI
class loader disabled)]
How can I solve this problem?

    Requires Free Membership to View

If you are NOT dynamically downloading the EJB stub, you need to make sure that the generated stub for the EJB is available locally, i.e. in the classpath.

If you ARE downloading the EJB stub dynamically, you need:

  • A) An RMISecurity Manager configured, as follows:

  • if (System.getSecurityManager() == null)
       {
          System.setSecurityManager(new RMISecurityManager());
       }

  • B) Your client must also have sufficient access through the appropriate socket.

  • C) You need to add file download permission in your client policy file, as follows:


  • grant codebase someURL { permission java.io.FilePermission "/path/to/downloads", "read"; };
  • D) Then your client must be started as follows:

  • java -Djava.security.policy=java.policy com.yourpackage.yourclient

    This was first published in September 2004

    There are Comments. Add yours.

     
    TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

    REGISTER or login:

    Forgot Password?
    By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
    Sort by: OldestNewest

    Forgot Password?

    No problem! Submit your e-mail address below. We'll send you an email containing your password.

    Your password has been sent to: