0 Replies Latest reply on Jun 13, 2007 3:20 AM by Freethan Meignanam

    Bindind a POJO to JBOSS

    Freethan Meignanam Newbie

      Hi,

      I am trying to bind a POJO to the Jboss context.
      I tried the piece of code for binding

      Object obj = new PaymentAccountsASC();
       try {
      
       Hashtable prop = new Hashtable();
       prop.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
       prop.put(Context.PROVIDER_URL, "jnp://localhost:1099");
       InitialContext ctx = new InitialContext(prop);
      
       ctx.bind("getPaymentAccounts", obj);
      
       } catch (NamingException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
       }

      The above code binds the object to the context.
      When I try looking up from the same project in eclipse, I am able to look it up.
      But when I try to look up from a different project in eclipse, it gives me the following exception (stack trace)
      org.jnp.interfaces.NamingContext.lookup(NamingContext.java:652)org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)javax.naming.InitialContext.lookup(Unknown Source)com.xyz.acc.JNDIPOJOHandler.getPOJOConnector(POJOHandler.java:67)com.infosys.accord.business.handler.execute.BLFJNDIPOJOHandler.executeTestCases(BLFJNDIPOJOHandler.java:105)sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)java.lang.reflect.Method.invoke(Unknown Source)com.infosys.accord.business.handler.generate.BLFExecuteTestCaseUtil$1.run(BLFExecuteTestCaseUtil.java:311)


      I haven't deployed the class file in Jboss, what should I do going further?
      I appreciate your help.

      Freethan.