EJB source code compiling problems


EJB programming & troubleshooting: EJB source code compiling problems

  1. EJB source code compiling problems (5 messages)

    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.

    Threaded Messages (5)

  2. 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.
  3. Just copy a file provided by server with name similar to *ejb*.jar into your classpath...:-)
  4. 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.
  5. thank[ Go to top ]

    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>
  6. thank[ Go to top ]

    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.