0 Replies Latest reply on Sep 2, 2013 10:28 AM by harshal.more

    Migration issue from Jboss4.0.5 GA to Jboss7.1.1 Final

    harshal.more

      Hi All,

       

      I am having problem related to Naming in Jboss7.1.1 Final build, while creating InitialContext inside thread we found that the context is empty, there is no naming binding in the contxt. I am creating this context using java:comp/env., We are able to get this context when there is and request and response navigation but when system create the context inside the Asynchronous thread the it gives us an exception Naming not found. We haven't used any EJB concept and not even planning to do so.

       

      I also tries other option by making the HashMap entry for naming binding, and able to get the list of binding using below code snippest In Jboss4.0.5 GA and it works as per expectation.

      Context ct = (Context) ctx.lookup("java:comp/env");

      NamingEnumeration<?> names = ct.listBindings(""); 

      while (names.hasMoreElements()) {

        Binding binding = (Binding) names.next();

        System.out.println("binded name: " + binding.getName() +" "+ct.lookup(binding.getName()));

      }

       

      but when deplyed same code I am getting Naming exception for [NamingEnumeration<?> names = ct.listBindings("");] on Jboss7.1.1 and funny thing is that when I am trying to get the data from the same context [Context ct = (Context) ctx.lookup("java:comp/env");] it returns proper value.

       

      String dataSourceName = (String) ct.lookup("dataSourceName");

      ds = (DataSource) ctx.lookup(dataSourceName);

       

      So the final Questions are

      1. Is Jboss 7.1.1 is stable version?

      2. How to get InitialContext inside run() method of Thread., Did I need to modify NamingContextFactory and provider URL.

      3. What could be possible reasons for  ct.listBindings("");  returns Naming Exception.

       

      Please reply this, It tooks three days for Migration.

       

      Thanks In Advance.