Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hello world example using EJB 3

 
rajiv raghunandan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just started reading EJB 3 and tried executing a simple Hello world example but ran into some problems. I am using Eclipse along with Weblogic server 10.
I created an EJB project and within it I created a stateless session bean with a remote interface.
The code for the interface is

The code for the bean is

The client code is as follows


I get the following exception


The session bean is getting deployed on the server without any issues and I am able to see it in the deployment list. I am unsure if there is a need for me to use the properties within the client and if thats a reason for the exception. Can anyone help me out in telling me what I am doing wrong . Also can anyone tell me if the format I am using in the lookup is correct.
 
rajiv raghunandan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
also i forgot to mention that i included weblogic.jar in the build path and i am deploying the session bean directly onto the weblogic server through eclipse
 
S Sravs
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rajiv raghunandan wrote:also i forgot to mention that i included weblogic.jar in the build path and i am deploying the session bean directly onto the weblogic server through eclipse


Hi did you find the solution please let me know,i am getting the same problem with same constraints
Thanks
Sravs
 
Michael Drona
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's an example I have that works

Hello.java


HelloBean.java



HelloClient.java


compress the whole org thing into a jar
jar cvf hello.jar org

deploy the jar on the wl server and then run the client.
 
S Sravs
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey
I am working on Eclipse and Weblogic. In eclipse i didn't remove the Weblogic libraries while debugging so i got that exception
Thanks
Sravanthi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic