Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Hello world example using EJB 3

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic