package does not exist error

N

Nachiketh

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top