1 Reply Latest reply on Jun 26, 2008 4:53 AM by milind chaudhari

    [ram] registration is not done -> stop

    Nagaraju Telukuntla Newbie

      Hi ,
      I am creating topic dynamicaaly. and immidietlly iam lookup the same topic that time its showing , topic in not bounded.

      please find the code bellow

      creating dynamic topic:

      private boolean createJbossTopic(String topicName) throws Exception
      boolean createStatus=false;
      Topic topic=null;
      RMIAdaptor server=null;
      Hashtable env = new Hashtable();
      Context ctx=null;
      String PROVIDER_URL = "jnp://";
      try {
      ctx = new InitialContext(env);
      catch(Exception e){
      System.out.println("InitialContext problem::"+ e.getMessage());
      server = (RMIAdaptor)ctx.lookup("jmx/invoker/RMIAdaptor");
      catch(Exception es){
      System.out.println("jmx/invoker/RMIAdaptor problem::"+ es.getMessage());

      server.invoke(destinationManager, "createTopic", new Object[]{topicName,"topic/"+topicName+""},new String[]{String.class.getName(), String.class.getName()});
      topic = (Topic) ctx.lookup("topic/"+topicName);

      // System.out.println("Got topic--> " + ctx.toString());

      return createStatus;

      // here i am lookup the same topic
      public boolean dummy(String sender)
      boolean result=false;
      System.out.println(":: Begin Dummy methode");
      TopicConnectionFactory cf;
      Hashtable env = new Hashtable();
      // env.put(Context.PROVIDER_URL, "localhost");
      env.put(Context.PROVIDER_URL, "jnp://");
      System.out.println("Before Thread sleep");
      System.out.println("After Thread sleep");
      }catch (Exception e) {
      System.out.println("Exception Thread sleep-->"+e.getMessage());
      // Thread.yield();
      Context ctx = new InitialContext(env);
      cf = (TopicConnectionFactory) ctx.lookup("/ConnectionFactory");
      Topic destination = (Topic)ctx.lookup("topic/"+sender);
      System.out.println("Found Topic");
      System.out.println("After Topic checking-->"+result);
      }catch (Exception e) {
      System.out.println("Exception Checking topic sleep-->"+e.getMessage());

      return result;

      because this topic has to be refer by the flex client.
      for us front end is flex.

      Please clarify me , its very urgent for us