3 Replies Latest reply on Jun 30, 2005 3:41 PM by Darran Lofthouse

    Cannot deploy simple session ejb

    Ivan Vuckovic Newbie

      Hi!

      I am having a problem deploying a simple session bean. I cannot see it in JNDI view and I see nothing in the output when I start up JBoss. Is there anything that I should see in an output of JBoss? I am using JUnit to test this EJB but I keep getting javax.naming.NameNotFoundException: ejb not found. I have used XDoclet to generate ejb stuff below. Unfortunately I don't have lot of experience with it.
      My Jboss.xml is as follows :


      <enterprise-beans>

      <!--
      To add beans that you have deployment descriptor info for, add
      a file to your XDoclet merge directory called jboss-beans.xml that contains
      the , and <message-driven></message-driven>
      markup for those beans.
      -->


      <ejb-name>Rate</ejb-name>
      <jndi-name>ejb/Rate</jndi-name>
      <local-jndi-name>RateLocal</local-jndi-name>



      </enterprise-beans>

      <resource-managers>
      </resource-managers>



      My ejb is as follows :
      <enterprise-beans>

      <!-- Session Beans -->

      <![CDATA[Description for Rate]]>
      <display-name>RateBean</display-name>

      <ejb-name>Rate</ejb-name>

      interfaces.RateHome
      interfaces.Rate
      <local-home>interfaces.RateLocalHome</local-home>
      interfaces.RateLocal
      <ejb-class>ejb.RateBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>

        • 1. Re: Cannot deploy simple session ejb
          Darran Lofthouse Master

          Which deploy folder are you copying the jar file to? Have you made sure that the deployment descritptors are in a folder called 'META-INF' at the root of the archive?

          Instead of putting the jar in the deploy folder before starting JBoss try starting JBoss then putting the jar in the deploy folder. This should make it easier to see if your jar is being recognised.

          You should get a few lines in the console output that show the bean being deployed.

          • 2. Re: Cannot deploy simple session ejb
            Ivan Vuckovic Newbie

            I have moved ejb.xml and jboss.xml files in to the META-INF of the root archive but still no luck. I can see .was file being properly deployed and I can all the directeories and ejb class files but I still cannot see anything in my jmx console. What sort of message should I be looking for in JBoss logs/console as the server starts up. If anyone has any idea out there please let me know.

            Thanks

            Ivan

            • 3. Re: Cannot deploy simple session ejb
              Darran Lofthouse Master

              Which deploy folder are you copying the jar file to?

              Can you confirm if this is what your archive structure looks like: -

              interfaces/RateHome.class
              interfaces/Rate.class
              interfaces/RateLocalHome.class
              interfaces/RateLocal.class
              ejb/RateBean.class
              META-INF/ejb-jar.xml
              META-INT/jboss.xml


              Instead of putting the jar in the deploy folder before starting JBoss try starting JBoss then putting the jar in the deploy folder. This should make it easier to see if your jar is being recognised.

              I have an archive that contains two session beans SecurityBeanA and SecurityBeanB, this is the output I get when I deploy it: -

              20:34:26,625 INFO [EjbModule] Deploying SecurityBeanA
              20:34:26,750 INFO [EjbModule] Deploying SecurityBeanB
              20:34:26,890 INFO [EJBDeployer] Deployed: file:/D:/ThirdParty/jboss-4.0.0/serve
              r/default/deploy/SecuritySessions.jar


              If you don't get any messages output to the console have a look in the file server.log in the log folder adjacent to the deploy folder. If there are some messages in there it means that the archive was recognised as an ordinary jar file, this is most likely to be caused by the archive being packaged incorrectly.