1 Reply Latest reply on Apr 12, 2006 4:10 AM by Kurt De Wit

    Dynamic Class Loading

    Kurt De Wit Newbie

      Hello,


      Could somebody explain what to do if you want to enable dynamic class loading for J2EE application clients (Swing client to be more precisely).

      According to the documentation, the WebService, listening at http://[host_name]:8083 provides the dynamic class loading service.

      I also found that you need to set some system properties at client application level to find the class providing service.

      The statement I invoke at client side is
      java -cp .;C:\JBossAS-stable\jboss-4.0.2_1\client\jbossall-client.jar;jndi.properties -Djava.security.policy=client.policy -Djava.security.manager=java.rmi.RMISecurityManager -Djava.rmi.server.codebase=http://sinfonix:8083/ client.DynamicClient

      The client.policy file contains:
      grant{
      //permission java.net.SocketPermission "*:1024-", "accept, connect";
      //permission java.io.FilePermission "${/}dynamicloading${/}-", "read";
      permission java.security.AllPermission;
      };

      I first tried the first 2 statements but since I'm not sure what to put as java.io.FilePermission I replaced it with the AllPermission.

      My jndi.properties file contains:
      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
      java.naming.provider.url=jnp://sinfonix:1099

      When I call the previous mentionned start-up command and when I enable logging. I get the following message (truncated);
      FINE: main: name = "java.rmi.dgc.VMID", codebase = "http://SINFONIX:8083/", defaultLoader = sun.misc.Launcher$AppClassLoader@169e11
      11-apr-2006 16:30:42 sun.rmi.server.LoaderHandler loadClass
      FINER: main: class "java.rmi.dgc.VMID" found via defaultLoader, defined by null
      11-apr-2006 16:30:42 sun.rmi.server.LoaderHandler loadClass
      FINE: main: name = "[B", codebase = "", defaultLoader = sun.misc.Launcher$AppClassLoader@169e11
      11-apr-2006 16:30:42 sun.rmi.server.LoaderHandler loadClass
      FINER: main: class "[B" found via defaultLoader, defined by null
      11-apr-2006 16:30:42 sun.rmi.server.LoaderHandler loadClass
      FINE: main: name = "java.rmi.server.UID", codebase = "http://SINFONIX:8083/", defaultLoader = sun.misc.Launcher$AppClassLoader@169e11
      11-apr-2006 16:30:42 sun.rmi.server.LoaderHandler loadClass
      FINER: main: class "java.rmi.server.UID" found via defaultLoader, defined by null
      Exception in thread "main" java.lang.NoClassDefFoundError: ejb/DynamicLoadingRemoteHome
      at client.DynamicClient.(DynamicClient.java:30)
      at client.DynamicClient.main(DynamicClient.java:48)

      My enterprise application is deployed as an EAR file which contains nothing more than a stateless session bean with one method returning a String. (HelloWorld like example).

      Any help or advise would be greatly appreciated !!! Thank you very much.


      Regards,
      Kurt