Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JBoss User Help »

[jboss-user] [JNDI/Naming/Network] - Bindind a POJO to JBOSS

scott.stark@jboss.org

2007-06-13


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)anonymous wrote : 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.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4053816#4053816

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4053816
_______________________________________________
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user
©2008 junlu.com - Jax Systems, LLC, U.S.A.