• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Could not access Local Session Bean using JNDI lookup

 
Jack Bush
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi EJB Guru,

I am quite new to EJB 3.0 but have had a good deal of success including using JNDI to lookup Remote Stateless Session Bean in EJB 3.0. However, looking up local Stateless Session Bean prove more challenging with I had anticipated. Here is my code as follows:













Output when running ClientAccessRemoteCalculator gives

1 + 1 = 2
1 - 1 = 0

Output when running ClientAccessLocalCalculator on JBoss AS 4.0.5 gives:

Exception in thread "main" javax.ejb.EJBException: Invalid invocation of local interface (null container)
at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:75)
at $Proxy0.add(Unknown Source) at ClientAccessLocalCalculator.main(ClientAccessLocalCalculator.java:14)


JNDIView in JMX-Console in JBoss:



Output when running ClientAccessLocalCalculator on SJSAS 9.0 gives:

Exception in thread "main" javax.naming.NameNotFoundException: bean.CalculatorLocal not found



I am using Application Client to lookup these Session Beans on Netbeans 5.5, JBoss AS 4.0.5 (EJB3 installer)/SJSAS 9.0

9.0, SDK 1.5.0_11 on Windows XP platform.

Any assistance would be much appreciated.

Many thanks,

Henry
 
Alessandro Ilardo
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI, I've got the same problem and I agree with you about client.

Anyway, this is the code which I'm using in my app client
follo

that returns the following error from unix command line
Caught a NamingException eu.virtualLab.users.UsrSessionRemote not bound
javax.naming.NameNotFoundException: eu.virtualLab.users.UsrSessionRemote not bound


On Jboss Global JNDI Namespace
+- UsrSessionBean (class: org.jnp.interfaces.NamingContext)
| +- local (proxy: $Proxy90 implements interface eu.virtualLab.users.UsrSessionLocal,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
| +- remote (proxy: $Proxy89 implements interface eu.virtualLab.users.UsrSessionRemote,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See this thread; local interfaces are only valid within the same JVM.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Alessandro Ilardo:



If you are looking up a remote interface then change the lookup to:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic