• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error:CalculatorBeanRemote not bound

 
Khushwinder Chahal
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Good People,

I am developing a sample EJB3 application in eclipse3.4. I am following the following steps:

1) First of all i am creating an EJB project (testEJB) in the eclipse. While creating this Project i am selecting the options of 1) Create an EJB Client Jar Module (testEJBClient) to hold the client interfaces and classes and 2) Add Project to an EAR (testEJBEAR) for this project. So it will create three different projects with the given names in the eclipse.
2) Now in the project testEJB i will create a stateless session bean. Its corresponding remote interface will be automatically created in the testEJBClient. Now i will declare a simple method hello() in the remote interface and will implement it in the testEJB.
So this completes my ejb beans.
3) Now in the third step i am creating a dynamic web project (with jboss as server). In this project's properties, in the java EE Module Dependencies section i am giving reference to both the testEJB.jar and testEJBClient.jar so that i can access the method in my jsp or servlets. My index.jsp is looks like:



But when i am trying to run this file it is giving the following exception :

Error:com.CalculatorBeanRemote not bound

I am trying to solve this from last 3 days but still not successful. If any one has any idea please help me.
I am also attaching the log file of jboss server.

Regards,
Khushwinder

 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Going by the initial context properties, you are using JBoss Application Server.

calculator = (CalculatorBeanRemote)ctx.lookup(CalculatorBeanRemote.class.getName());


The jndi name you are using here, is incorrect. Follow the steps mentioned here and find out the jndi-name of the remote interface for your bean. Then use that jndiname to lookup the bean. By default, in JBoss if you are deploying the EJB in a jar, the jndi-name is EJBName/remote (for remote interface) and EJBName/local (for local interface).
 
Khushwinder Chahal
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Jaikiran.
I needed to use the JNDI name like



where CalculatorBeanEAR is my EAR file name.

Regards to you.


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic