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
import javax.ejb.EJBException;
^
OpBean.java:32: package javax.ejb does not exist
import javax.ejb.SessionBean;
^
OpBean.java:33: package javax.ejb does not exist
import javax.ejb.SessionContext;
......................
==========================================================
Could some one tell me what the problem it is? Thank in advance.
Note: I am using JOnAS as Application server.
-
EJB source code compiling problems (5 messages)
- Posted by: blue disel
- Posted on: May 02 2005 08:37 EDT
Threaded Messages (5)
- EJB source code compiling problems by Jay Khimani on May 03 2005 23:50 EDT
- EJB source code compiling problems by Sanket Raut on May 04 2005 08:47 EDT
- EJB source code compiling problems by Udayan Patel on May 06 2005 12:55 EDT
- thank by blue disel on May 11 2005 18:00 EDT
- thank by Jay Khimani on May 12 2005 00:51 EDT
-
EJB source code compiling problems[ Go to top ]
- Posted by: Jay Khimani
- Posted on: May 03 2005 23:50 EDT
- in response to blue disel
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. -
EJB source code compiling problems[ Go to top ]
- Posted by: Sanket Raut
- Posted on: May 04 2005 08:47 EDT
- in response to Jay Khimani
Just copy a file provided by server with name similar to *ejb*.jar into your classpath...:-) -
EJB source code compiling problems[ Go to top ]
- Posted by: Udayan Patel
- Posted on: May 06 2005 12:55 EDT
- in response to blue disel
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. -
thank[ Go to top ]
- Posted by: blue disel
- Posted on: May 11 2005 18:00 EDT
- in response to blue disel
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?
compiling:
javac -classpath <path to j2ee.jar> <java file>
runing:
java -classpath <path to j2ee.jar> <client java class> -
thank[ Go to top ]
- Posted by: Jay Khimani
- Posted on: May 12 2005 00:51 EDT
- in response to blue disel
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.