×

Loading...

Topic

This topic has been archived. It cannot be replied.
  • 工作学习 / IT技术讨论 / Visual Age3.0/3.5. I wrote a HelloWorld EJB in Visual Age. It's ok when running test client made by VAJ. When running the HelloClient writen by myself, such exceptions will show when I try to new InitialContext(props). Pls help.
    main().......
    InitialContext ctx = new InitialContext(props);
    ...................

    Debugger Stack Trace Report:

    Thread[main,5,main] (Alive)
    Uncaught exception (java.lang.NoClassDefFoundError: javax.naming.InitialContext)

    HelloClient.main(String [])
    args=([Ljava.lang.String;) [Ljava.lang.String;@4ae1
    iniCtx=(javax.naming.InitialContext) null
    • It is a piece of cake to shoot your problem: You need to import javax.naming.* package into the CLASSPATH.
      • thank you! it really work!