package does not exist error

Discussion in 'Java' started by Nachiketh, Apr 17, 2004.

  1. Nachiketh

    Nachiketh Guest

    hi,
    i tried compiling this piece of EJB code but it has a basic error, am
    sure the package is present in the standard J2SE(1.4.2v) i have
    downloaded from sun.com. plz help me with this anyone of you.

    code:
    // EJBTestBean.java

    import javax.ejb.*;
    import java.rmi.RemoteException;

    public
    class EJBTestBean implements SessionBean {

    private SessionContext mContext = null;

    public void ejbPassivate() {
    System.out.println("EJBTestBean passivated.");
    }

    public void ejbActivate() {
    System.out.println("EJBTestBean activated.");
    }

    public void ejbCreate() {
    System.out.println("EJBTestBean created.");
    }

    public void ejbRemove() {
    System.out.println("EJBTestBean removed.");
    }

    public void setSessionContext() {
    System.out.println("EJBTestBean context set.");
    mContext = context;
    }

    public String greet()
    {
    return "Hello, I'm an EJB!";
    }

    }

    error :
    D:\Project\EJB\EJBTestBean.java:3: package javax.ejb does not exist
    import javax.ejb.*;
    ^
    D:\Project\EJB\EJBTestBean.java:7: cannot resolve symbol
    symbol : class SessionBean
    location: class EJBTestBean
    class EJBTestBean implements SessionBean {
    ^
    D:\Project\EJB\EJBTestBean.java:9: cannot resolve symbol
    symbol : class SessionContext
    location: class EJBTestBean
    private SessionContext mContext = null;
    ^
    D:\Project\EJB\EJBTestBean.java:29: cannot resolve symbol
    symbol : variable context
    location: class EJBTestBean
    mContext = context;
    ^
    4 errors
    Process javac exited with code 1


    thx,bye
    -Nachiketh
    Nachiketh, Apr 17, 2004
    #1
    1. Advertising

  2. Nachiketh

    Roedy Green Guest

    Roedy Green, Apr 18, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sufia
    Replies:
    0
    Views:
    4,764
    sufia
    Jul 7, 2003
  2. Laurent Leconte
    Replies:
    2
    Views:
    7,581
    Laurent Leconte
    Oct 14, 2003
  3. LT
    Replies:
    7
    Views:
    2,073
    Phlip
    Jul 25, 2004
  4. Replies:
    4
    Views:
    13,230
    Simon Brooke
    Nov 11, 2006
  5. Replies:
    16
    Views:
    842
    Arne Vajhøj
    Feb 24, 2013
Loading...

Share This Page