4 Replies Latest reply on Feb 26, 2004 6:37 PM by noleme

    org/jboss/system/ServiceMBeanSupport

    zuurbier

      I try to deploy my first EJB. Created a bean-class, a home-interface and a remote-interface put them in a jar-file. Copied the jar-file to de deploy-folder of jboss-4.0.0DR2. I have made a client application and when I run it, I get a java.lang.NoClassDefFoundError:

      java.lang.NoClassDefFoundError: org/jboss/system/ServiceMBeanSupport
      at java.lang.ClassLoader.defineClass0(Native Method)
      ... (lines left away)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at HelloWorldClient.main(HelloWorldClient.java:19)


      The file jboss-system-client.jar, which I included in the classpath, contains a class org/jboss/system/ServiceMBeanSupportMBean and a class org/jboss/system/ServiceMBean, but no class org/jboss/system/ServiceMBeanSupport

        • 1. Re: org/jboss/system/ServiceMBeanSupport

          You should use JBoss 3.2.1 instead.

          -- Juha

          • 2. Re: org/jboss/system/ServiceMBeanSupport
            zuurbier

            Thanks, indeed with jboss-3.2.1 I get a correct result.

            • 3. Re: org/jboss/system/ServiceMBeanSupport
              noleme

              Does this mean that one cannot write standalone client applications for 4.0DR2 ???????

              • 4. Re: org/jboss/system/ServiceMBeanSupport
                noleme

                OK, here is the deal... One doesn't have to downgrade to 3.x to make the standalone applications running under JBoss 4.0DR2.

                This is the list of libraries needed:

                log4j.jar
                jboss-all-client.jar
                jboss-system.jar
                jboss-jmx.jar
                jboss-remoting.jar
                dom4j.jar

                Also, looks like you DO NOT need to pass this in your environemnt:
                env.put("java.naming.factory.url.pkgs", "org.jboss.naming.client");


                And the final key is:

                Add a file called jndi.properties to your client class path with the follwing content:

                java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
                java.naming.provider.url=jnp://localhost:1099
                java.naming.factory.url.pkgs=org.jboss.naming.client

                (change the host and the port if needed)

                Anyone could argue about the restrictions of this approach, but it will help at least to unit test your beans :)