EJB programming & troubleshooting: Getting Error : Package javax.ejb does not exist

  1. Getting Error : Package javax.ejb does not exist (8 messages)

    Hello friends,

    I am new to EJB and I have written a small program which
    is not compiling. Its a statefulSession bean.

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

    public interface Trader extends EJBObject

    public TradeResult buy(String customerName, String stockSymbol, int shares)

        throws ProcessingErrorException, RemoteException;

     public TradeResult sell(String customerName, String stockSymbol, int shares)

        throws ProcessingErrorException, RemoteException;

      public double getBalance()
        throws RemoteException;


    When I compile the above program, it says that

     i) Package javax.ejb does not exist


    ii) Cannot resolve synbol class EJBObject

    I think the problem is with the classpath.
    I am using weblogic 5.1.0.
    Please help.



  2. This is definitely a classpath problem.Make sure that the \\weblogic\lib\weblogicaux.jar which comprises the javax classes is in the classpath during compilation
  3. If it is possible.Just unjar under the LIB dir and classes dir
  4. 1).set the clas path between your current working dirctory and weblogic LIB and CLASSES dir.This may be the class path probs.

    2).Bythe way,lemme know wht type of weblogic and JDK you are using.
  5. I installed Weblogic10 on my Xp. Installation was fine. I am getting the error "package javax.ejb doesn't exist" I have seen your reply regarding this error. I was unable to locate "lib\weblogicaux.jar". I installed weblogic on my "D:\weblogic10". and JDK1.5 is installed on "C:\java". There I didn't find any "lib" directory. Without finding the jar file, how can I set the class path? The same problem I got when I installed weblogic 9.1,7.0 with fresh downloads. How can I solve this?
  6. Hai,

    Initially everybody get sometimes the same problem.
    Don't worry. It is the problem with classpath.
    The classpath might have not set correctly.
    Goto windows-nt system environment then select the classpath variable and set the weblogicaux.jar with correct path.

  7. Setting the classpath from windows start-> setting etc
    may help you in compiling the classes but u will again face problem while deploying ur bean , to avoid that set the classpath in the startup script of ur weblogic and start ur weblogic server using that script instead of the console
  8. IF you have J2EE kit add J2EE_HOME\lib\j2ee.jar in your classpath
  9. Haii,
    If u r using weblogic ..set the class path to .jar file
    if u r using J2EE.. set J2EE_HOME and JAVA_HOME path..

    it will be working perfectly

    keep in touch : kgjawahar@hotmail.com