0 Replies Latest reply on Feb 9, 2004 2:10 AM by victor01hk

    Unable to run the client application

    victor01hk Newbie

      I have deploy simple EJB with the following xml

      ejb-jar file
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE ejb-jar
      PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN'
      'http://java.sun.com/j2ee/dtds/ejb-jar_2_0.dtd'>
      <ejb-jar>
      HelloWorld application
      <display-name>HelloWorld</display-name>
      <enterprise-beans>

      <ejb-name>Hello</ejb-name>
      com.sample.HelloWorldHome
      com.sample.HelloWorld
      <ejb-class>com.sample.HelloWorldBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Bean</transaction-type>

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

      jboss.xml

      false
      <enterprise-beans>

      <ejb-name>Hello</ejb-name>
      <jndi-name>Hello</jndi-name>

      </enterprise-beans>


      the class file code :

      Hashtable env = new Hashtable();
      env.put(Context.INITIAL_CONTEXT_FACTORY,
      "org.jnp.interfaces.NamingContextFactory");
      env.put(Context.PROVIDER_URL, "localhost:1099");
      env.put("java.naming.factory.url.pkgs",
      "org.jboss.naming:org.jnp.interfaces");
      try
      {
      InitialContext ctx = new InitialContext(env);
      Object obj = ctx.lookup( "Hello" );
      HelloWorldHome home =
      (HelloWorldHome)javax.rmi.PortableRemoteObject.narrow(
      obj, HelloWorldHome.class );
      HelloWorld helloWorld = home.create();
      System.out.println( helloWorld.hello());
      ........................

      the class is a simple class file

      when I run this class file, the following error prompt in the screen

      Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/security/Se
      curityAssociation
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:3
      9)
      at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:173)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
      at $Proxy0.create(Unknown Source)
      at HelloWorldClient.main(HelloWorldClient.java:22)

      However, the ejb deploy in the Jboss3.2.1 with tomcat4.1.28 is fine, no error generated.

      I dont know what's the problem because I try it few months ago it worked fine.
      Thanks for help.