Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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 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

problem with creating client in J2ee

Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have successfully created a bean and deployed it in J2EE server. My next step according to the head first ejb is to create a client. But when compiling the code for AdviceClient(the client) I get the following error message:

C:\projects\advice>javac cannot resolve symbol
symbol : class context
location: class AdviceClient
context ic=new InitialContext();
1 error

Please tell me what I am doing wrong. The following code is the code for AdviceClient.

import javax.naming.*;
import java.rmi.*;
import headfirst.*;
import javax.rmi.*;
import javax.ejb.*;

public class AdviceClient{

public static void main (String[] args){
new AdviceClient().go();
public void go(){

context ic=new InitialContext();
Object o=ic.lookup("Advisor");

AdviceHome home=(AdviceHome) PortableRemoteObject.narrow(o, AdviceHome.class);

Advice advisor=home.create();
}catch (Exception ex){

Many thanks,
Posts: 4107
Hibernate Fedora Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Context should start with Capital "C". It seems you have "context" instead.

alex mueer
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Vijitha,

Thank you so much for your help. It worked. you are great.

Thank you
sunglasses are a type of coolness prosthetic. Check out the sunglasses on this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic