• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Calling EJB from Java client

Posts: 24
  • Mark post as helpful
  • send pies
  • 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
  • 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
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic