hi, i am a new to EJB developement. I help the problem to compile the EJB's java files.
There r always error while i compile the file, it seems that the compiler cant import the required EJB package. For example, when i compile the OpBean.java, there r the following errors:
OpBean.java:31: package javax.ejb does not exist
OpBean.java:32: package javax.ejb does not exist
OpBean.java:33: package javax.ejb does not exist
Could some one tell me what the problem it is? Thank in advance.
Note: I am using JOnAS as Application server.
If you are using weblogic, include weblogic.jar in your classpath and then compile. if you are using any other app server, include corresponding jar file in classpath b4 compiling your ejb.
Just copy a file provided by server with name similar to *ejb*.jar into your classpath...:-)
put j2ee.jar in your classpath for weblogic its called weblogic.jar. I would use sun's j2ee.jar as long as I am not using vendor specific classes.
thanks all for helping me.
but i still have the pb compiling and running my EJB and EJB client.
did i use the correct commande for compiling?
javac -classpath <path to j2ee.jar> <java file>
java -classpath <path to j2ee.jar> <client java class>
ur ejb client will need ur remote and home interface in ur class path along with the j2ee jar. if u have not suppllied remote and home in ur classpath, include it and then try to compile ur ejb client.