0 Replies Latest reply on Jul 19, 2005 12:32 AM by lee sharpe

    lookup UUIDKeyGeneratorFactory in standalone client

    lee sharpe Newbie

      Could anyone tell me how to settle this problem please.

      This is my code:

      public class test
      {
      public static void main(String [] args)
      {
      try
      {
      Properties props = new Properties();
      props.put(InitialContext.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      props.put(InitialContext.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      props.put(InitialContext.PROVIDER_URL, "jnp://192.168.1.124:1099");

      Context initial_context = new InitialContext(props);

      KeyGeneratorFactory kgf = (KeyGeneratorFactory)initial_context.lookup("UUIDKeyGeneratorFactory");
      KeyGenerator kg = kgf.getKeyGenerator();

      String key = kg.generateKey().toString();
      System.out.println("Key : " + key);
      }
      catch( NamingException ne )
      {
      ne.printStackTrace();
      }
      catch (Exception e)
      {
      e.printStackTrace();
      }
      }
      }


      This is the error that i got :

      javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory (no security manager: RMI class loader disabled)]
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:713)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at com.vigpro.test.test.main(test.java:42)
      Caused by: java.lang.ClassNotFoundException: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory (no security manager: RMI class loader disabled)
      at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:371)
      at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165)
      at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:631)
      at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:257)
      at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:200)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
      at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
      at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:57)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:637)
      ... 3 more