2 Replies Latest reply on Jul 13, 2007 10:59 AM by omotelet

    A javassist is in the problem in the WEB application

    ajjjian

      The general java application which does with the javassist is used to test to without problem.But if put while adjusting to use in the Web application and then will go wrong:
      CtClass cc = ClassPool.getDefault().get("com.web.zx.Tcontent"); javassist.NotFoundException: com.web.zx.Tcontent.
      But I adjust to use with the test procedure of without problem..Excuse me, is this the reason why?

        • 1. Re: A javassist is in the problem in the WEB application
          hlship
          • 2. Re: A javassist is in the problem in the WEB application
            omotelet

            Hi,
            I think I have the same problem thus maybe I can help to formulate it.

            I use javassist in an eXist extension. This extension comes as a jar package automatically loaded by eXist.
            Let com.Foo.class com.Bar.class 2 classes contained in the package myCom.jar

            If I call in Foo
            ClassPool.getDefault().get("com.Bar") I got an javassist.NotFoundException: com.Bar.

            Nevertheless when I run eXist form inside an IDE and providing Foo and Bar as part of the build path of eXist I have no problem...

            The problem seems to arise with multiple bootloaders in order to overpass it you may use the following hint:

            try {
            pool.get("com.Bar");
            } catch (NotFoundException e) {
            pool.appendClassPath(new ClassClassPath(Class.forName("com.Bar")));
            pool.get("com.Bar");
            }


            Regards,
            olivier
            PS thanx to matthieu for the hint