1 Reply Latest reply on Dec 16, 2004 7:21 AM by narayanrm

    Class.forName("StuDao").newInstance() throw Exception:ClassL

    gaocya

      Hi All,

      I'm getting java.lang.ClassNotFoundException when attempting the following operation in stateless session ejb.
      Class cls = ("com.sma.dao.StuDao");
      Object obj = cls.newInstance();


      Can anybody give me some suggestions?


      Thanks in advance.

        • 1. Re: Class.forName(
          narayanrm



          If the current class loader cannot find the class in that path it throws this error.

          Where from are you executing this piece of code? Put that class file in the class path and then try. or you might have to package this class also in the same jar