2 Replies Latest reply: Jun 11, 2012 1:09 AM by Gajendra Rathore RSS

    Lookups from jboss 7 to jboss 4

    Carlos Rodríguez Newbie

      Hello, a couple years ago I created and deployed 2 applications that work together on jboss 4. Now, I want to migrate one of them (because the other one is too coupled to jboss 4) to jboss 7  but I have a problem when I make the lookups calls. When I make a lookup on my current server (jboss 7) everything works good, but when I try to make the jboss 4 lookups this message is shown



      17:35:06,898 ERROR [stderr] (http-- javax.naming.NameNotFoundException: map-server/ClientBean/remote -- service jboss.naming.context.java.map-server.ClientBean.remote

      17:35:06,902 ERROR [stderr] (http--      at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)

      17:35:06,902 ERROR [stderr] (http--      at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:177)

      17:35:06,902 ERROR [stderr] (http--      at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:113)

      17:35:06,903 ERROR [stderr] (http--      at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:213)

      17:35:06,903 ERROR [stderr] (http--      at javax.naming.InitialContext.lookup(InitialContext.java:392)



      - My original Initial Context code (when the the app was on jboss 4) was this:



           Properties env = new Properties();

           env.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");

           env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");

           env.put("java.naming.provider.url", url);

           InitialContext ctx = new InitialContext(env);



      and I used to make the lookups this way:



           client = (Client) ctx.lookup("Appear/ClientBean/remote");



      - My new Initial Context code (Jboss 7) is this:



           Properties env = new Properties();

           env.put("java.naming.factory.initial", "org.jboss.as.naming.InitialContextFactory"); //this change

           env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");

           env.put("java.naming.provider.url", Params.getValue("com.ogangi.mimampp3.NAMING_PROVIDER_URL"));

           InitialContext ctx = new InitialContext(env);



      and a I still make same the lookups:



           client = (Client) ctx.lookup("Appear/ClientBean/remote");



      Any Idea?