Help coderanch get a
new server
by contributing to the fundraiser
  • 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Calling EJB from Java client

Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends:
Actually i'm working with an IBM WebSphere Application Server on
Windows NT. I already had deployed entity beans and session beans
in an EJB container. In my servlets I used them without troubles.
But when i tried to call them in a Java application (within Visual Age for Java) i got this error message :
Uncaught exception java.lang.NoClassDefFoundError: javax.naming.InitialContext
This is my application code :
import java.rmi.*;
import java.util.*;
import javax.ejb.*;
import javax.naming.*;
class HelloClient {
public HelloClient() {
public static void main(java.lang.String[] args) {
try {
Properties props = new Properties();
Context ctx = new InitialContext(props);
HelloHome home = (HelloHome) ctx.lookup("com/wiley/compbooks/ecommerce/Hello");
Hello hello = home.create();
} catch (Exception e) {
Thanks for your help
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you generate the stub of your ejb?
If not the client can't communicate with EJB container.

See rmic -iiop or cmmand line of WebSphere
I miss the old days when I would think up a sinister scheme for world domination and you would show a little emotional support. So just look at this tiny ad:
We need your help - Coderanch server fundraiser
    Bookmark Topic Watch Topic
  • New Topic