• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

jndi settings for statefull session bean

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the following code, I could get reference to the stateless session bean "CalculatorBean", but if the bean is stefull, I could not get a reference to it using the same JNDI settings, how should I change the following code in order to be able to get a reference to the statefull bean? I am using Jboss

Thanks


Properties props = new Properties();
props.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
props.put("java.naming.factory.url.pkgs","org.jboss.naming rg.jnp.interfaces");
props.put("java.naming.provider.url","localhost:1099");
InitialContext ic = new InitialContext(props);
CalculatorRemote calculator = (CalculatorRemote) ic.lookup("example/CalculatorBean/remote");
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

As far as I know, type of bean (stateless or stateful) or any other for that matter has nothing to do with JNDI. There might be some other issue.
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you please put in your jboss.xml and ejb-jar.xml files?
How you look up does not have to change.
It is all in what you have put in these files.

Thanks,
Sandip
 
Water proof donuts! Eat them while reading this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic