8 Replies Latest reply on Oct 31, 2006 3:36 PM by Asia Webster

    ejb not bound (no security manager: RMI class loader disable

    Asia Webster Newbie

      I am using JBOSS 4.0.4-GA, J2EE1.4 and XDoclet 1.2.3 I have so far created three Stateful EJBs all of which have this following problem (code included just for one):

      The following code:

      Object objref = initial.lookup("java:comp/env/QuestionFacadeHomeRemote");
      

      Returns the following error:
      QuestionFacadeHomeRemote not bound javax.naming.NameNotFoundException: QuestionFacadeHomeRemote not bound
      I suspect that the reason is in the JNDI tree
      Global JNDI Namespace has the following entry for the QuestionFacadeHomeRemote:
       +- QuestionFacadeHomeRemote (proxy: $Proxy74 implements No ClassLoaders found for: com.rev.sips.ejb.QuestionFacadeHome (no security manager: RMI class loader disabled))
      


      The ejb-jar.xml has the following entry for the bean in question:
       <session id="Session_QuestionFacade">
       <description><![CDATA[An EJB named QuestionFacade]]></description>
       <display-name>QuestionFacade</display-name>
      
       <ejb-name>QuestionFacade</ejb-name>
      
       <home>com.rev.sips.ejb.QuestionFacadeHome</home>
       <remote>com.rev.sips.ejb.QuestionFacade</remote>
       <local-home>com.rev.sips.ejb.QuestionFacadeLocalHome</local-home>
       <local>com.rev.sips.ejb.QuestionFacadeLocal</local>
       <ejb-class>com.rev.sips.ejb.QuestionFacadeSession</ejb-class>
       <session-type>Stateful</session-type>
       <transaction-type>Container</transaction-type>
      
       </session>
      


      and the QuestionFacadeHome.java has the following code in it:
      
      /*
       * Generated by XDoclet - Do not edit!
       */
      package com.rev.sips.ejb;
      
      /**
       * Home interface for QuestionFacade.
       * @generated
       * @wtp generated
       */
      public interface QuestionFacadeHome
       extends javax.ejb.EJBHome
      {
       public static final String COMP_NAME="java:comp/env/ejb/QuestionFacade";
       public static final String JNDI_NAME="QuestionFacadeHomeRemote";
      
       public com.revolution.sips.ejb.QuestionFacade create()
       throws javax.ejb.CreateException,java.rmi.RemoteException;
      
      }
      



      The XDoclet for the bean is:

      /**
       *
       * <!-- begin-user-doc -->
       * A generated session bean
       * <!-- end-user-doc -->
       * *
       * <!-- begin-xdoclet-definition -->
       * @ejb.bean name="QuestionFacade"
       * description="An EJB named QuestionFacade"
       * display-name="QuestionFacade"
       * jndi-name="QuestionFacadeHomeRemote"
       * type="Stateful"
       * transaction-type="Container"
       * view-type="both"
       * local-jndi-name="QuestionFacadeHomeLocal"
       * @ejb.interface generate="local,remote"
       * @ejb.util generate="physical"
       * <!-- end-xdoclet-definition -->
       * @generated
       */
      

      The entry in jboss.xml for this bean is:
       <session>
       <ejb-name>QuestionFacade</ejb-name>
       <jndi-name>QuestionFacadeHomeRemote</jndi-name>
       <local-jndi-name>QuestionFacadeHomeLocal</local-jndi-name>
      
       <method-attributes>
       </method-attributes>
       </session>
      


      I have tried many variations on how JNDI entry is named (including ejb, local and such) but the problem still remains and the entry in the JNDI tree is always
      No ClassLoaders found for: com.rev.sips.ejb.QuestionFacadeHome (no security manager: RMI class loader disabled)
      
      


      I can not grasp what causes this entry. Initially I was using MyEclipse to deploy the code to JBOSS but even when deploying it from the command line I still get all the same problem.



        • 1. Re: ejb not bound (no security manager: RMI class loader dis
          jaikiran pai Master

          Do you see any exceptions in the server.log. If yes, please post them. The most likely cause will be that the com.rev.sips.ejb.QuestionFacadeHome is not found in the classpath. Only the logs can confirm this.

          • 2. Re: ejb not bound (no security manager: RMI class loader dis
            Asia Webster Newbie

            Jaikiran, thanks for your response.
            I have found no relevant exceptions in the server log. It lists step by step how this particular EJB is deployed, no issues there.

            There only one exception in the entire file related to myfaces-impl.jar (I do however have this jar in the lib of the war I am deploying).

            java.io.FileNotFoundException: C:\jboss-4.0.4.GA\server\default\deploy\jbossweb-tomcat55.sar\jsf-libs\myfaces-impl.jar
            

            I do not think this exception is related to my problem.

            • 3. Re: ejb not bound (no security manager: RMI class loader dis
              jaikiran pai Master

              How is your application packaged? Is it an ear or a war?

              From the command line please try the following command on your archive:

              jar -tf myAppName.ear


              replace myAppName.ear with the name and extension of your archive that is deployed in JBoss. Please post the output.

              This will display the contents of your archive. I wanted to make sure that we have classes at the right place and they are being picked up appropriately.

              • 4. Re: ejb not bound (no security manager: RMI class loader dis
                Asia Webster Newbie

                The app is packaged as SIPSEnterprise.ear:

                META-INF/
                META-INF/MANIFEST.MF
                APP-INF/
                APP-INF/lib/
                APP-INF/lib/SIPS.jar
                APP-INF/lib/jboss-j2ee.jar
                APP-INF/lib/jbossall-client.jar
                SIPSEntities.jar
                SIPSJSF.war
                META-INF/application.xml
                

                SIPSEntities.jar contains ejbs and has the following structure:
                META-INF/
                META-INF/MANIFEST.MF
                com/
                com/rev/
                com/rev/sips/
                com/rev/sips/ejb/
                com/rev/sips/ejb/QuestionFacade.class
                com/rev/sips/ejb/QuestionFacadeBean.class
                com/rev/sips/ejb/QuestionFacadeHome.class
                com/rev/sips/ejb/QuestionFacadeLocal.class
                com/rev/sips/ejb/QuestionFacadeLocalHome.class
                com/rev/sips/ejb/QuestionFacadeSession.class
                com/rev/sips/ejb/QuestionFacadeUtil.class
                META-INF/ejb-jar.xml
                META-INF/jboss.xml
                SIPS.jar
                

                and here is application.xml:
                <?xml version="1.0" encoding="UTF-8"?>
                <application id="Application_ID" version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
                 <display-name>
                 SIPSEnterprise</display-name>
                 <module id="myeclipse.1160885910156">
                 <web>
                 <web-uri>SIPSJSF.war</web-uri>
                 <context-root>/SIPSJSF</context-root>
                 </web>
                 </module>
                 <module id="EjbModule_1160889846156">
                 <ejb>SIPSEntities.jar</ejb>
                
                 </module>
                 <module>
                 <java>APP-INF/lib/SIPS.jar</java>
                 </module>
                
                </application>


                • 5. Re: ejb not bound (no security manager: RMI class loader dis
                  jaikiran pai Master

                  I am not sure whether this is the reason, but i see SIPS.jar in two places, one is under APP-INF/lib/ and the other inside SIPSEntities.jar. Give it a try by removing the one in SIPSEntities.jar.

                  Also, i dont think you should have those jboss-j2ee.jar and jbossall-client.jar in your package. I recommend removing these 2 files as well and try it out.

                  • 6. Re: ejb not bound (no security manager: RMI class loader dis
                    Asia Webster Newbie

                    Thanks jaikiran for your comments. I did remove the jboss jars as well as the second sips.jar with no visible benefit. I still get

                    QuestionFacadeHomeRemote (proxy: $Proxy98 implements No ClassLoaders found for: com.rev.sips.ejb.QuestionFacadeHome (no security manager: RMI class loader disabled))
                    

                    in the JNDI tree and
                    QuestionFacadeHomeRemote not bound javax.naming.NameNotFoundException: QuestionFacadeHomeRemote not bound
                    

                    when calling that initial context. the local interface has the same manifestation.

                    • 7. Re: ejb not bound (no security manager: RMI class loader dis
                      jaikiran pai Master

                      How big is your application? If its not too big(and if you are allowed to share the project), mail it to me at jai_forums AT yahoo dot co dot in. Let me give it a try on my setup.

                      • 8. Re: ejb not bound (no security manager: RMI class loader dis
                        Asia Webster Newbie

                        Jaikiran, thanks for your offer, very kind of you.

                        I just (temporarily) resolved the problem by deploying the jar that contains the EJBs in addition to the application ear. (I placed the sipsenterprise.ear as well as sipsentites.jar (which is already contained in the .ear file) into the server deploy directory).

                        So, I figure the problem is related to the packaging of the ear, and this temporary fix will work for me for a while.

                        Thx for your support.