3 Replies Latest reply on Jul 16, 2003 8:44 AM by cazacov

    JBoss 3.2, first steps

    cazacov

      I do my first steps in Java and JBoss.

      1. I have downloaded and installed JRE 1.4.2 and J2SE SDK 1.4.1_02

      2. I got JBoss 3.2.1 with integrated Tomcat and unpacked it

      3. I got last version of Ant and installed it.

      4. I set environment variables JAVA_HOME, JBOSS_DIST and PATH

      5. Using this book (http://wwwswt.fzi.de/~christo/praktikum/j2eeapi/jboss/doc/ch01.html) I built simple stateless session bean with following deployment descriptors:

      ejb-jar.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
      <ejb-jar>
      JBoss Interest Sample Application
      <display-name>Interest EJB</display-name>
      <enterprise-beans>

      <ejb-name>Interest</ejb-name>
      org.jboss.docs.interest.InterestHome
      org.jboss.docs.interest.Interest
      <ejb-class>org.jboss.docs.interest.InterestBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Bean</transaction-type>

      </enterprise-beans>
      </ejb-jar>

      and jboss.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">

      <enterprise-beans>

      <ejb-name>Interest</ejb-name>
      <jndi-name>interest/Interest</jndi-name>

      </enterprise-beans>



      6. Start JBoss server in default configuration

      7. Copy interest.jar to the server deployment directory

      Question:
      In console window appear lines:

      ...
      15:14:54,700 INFO [StatelessSessionContainer] Creating
      15:14:54,780 INFO [StatelessSessionInstancePool] Creating
      15:14:54,780 INFO [StatelessSessionInstancePool] Created
      15:14:54,790 INFO [StatelessSessionContainer] Created
      15:14:54,810 INFO [EjbModule] Created
      15:14:54,810 INFO [ServiceController] returning from create for service jboss.j2ee:jndiName=interest/Interest,service=EJB, invalid transition from CREATED
      15:14:54,820 INFO [EjbModule] Starting
      15:14:54,840 INFO [EjbModule] Started
      ...

      Is it OK ????

      7. Start browser and open JMX console. In jboss.j2ee section I can find my bean:

      jndiName=interest/Interest,service=EJB
      module=interest.jar,service=EjbModule

      7. Build simple client as described in guide.

      Hashtable env = new Hashtable();
      env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      env.put(Context.PROVIDER_URL, "localhost:1099");
      env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces" );

      //get naming context
      Context context = new InitialContext(env);

      //look up jndi name
      Object ref = context.lookup("interest/Interest");

      In last line I get exception:
      java.lang.NoClassDefFoundError: org/jboss/system/ServiceMBeanSupport


      What did I do wrong ?