2 Replies Latest reply on Aug 7, 2004 10:43 AM by Shigeru Chiba

    javassist.NotFoundException: java.lang.Object - with securit

    bonsaijboss Newbie

      Hello,

      When I run Javassist 2.6 (in Tapestry 3.0) without security manager, everthing works OK.

      But when I switch to a security manager it throws a NotFoundException: java.lang.Object

      I debugged the code and I figured out that

      getClass().getResourceAsStream("/java/lang/Object.class")

      returns null when using the security manager.

      What permissions should be set to prevent this error?

      Thanks,
      Norbi

        • 1. Re: javassist.NotFoundException: java.lang.Object - with sec
          bonsaijboss Newbie

          The call stack is:

          StandardWrapperValve[ErinorsPortal Servlet]: Servlet.service() for servlet ErinorsPortal Servlet threw exception
          javax.servlet.ServletException
          at org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:834)
          at org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:197)
          at org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:158)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
          at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:98)
          at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:176)
          at java.security.AccessController.doPrivileged(Native Method)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:172)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
          at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
          at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
          at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
          at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
          at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
          at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
          at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
          at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
          at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
          at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
          at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
          at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
          at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
          at java.lang.Thread.run(Unknown Source)
          ----- Root Cause -----
          org.apache.tapestry.enhance.CodeGenerationException
          at org.apache.tapestry.enhance.javassist.ClassMapping.initialize(ClassMapping.java:83)
          at org.apache.tapestry.enhance.javassist.ClassMapping.(ClassMapping.java:48)
          at org.apache.tapestry.enhance.javassist.EnhancedClassFactory.reset(EnhancedClassFactory.java:70)
          at org.apache.tapestry.enhance.javassist.EnhancedClassFactory.(EnhancedClassFactory.java:49)
          at org.apache.tapestry.enhance.DefaultComponentClassEnhancer.createEnhancedClassFactory(DefaultComponentClassEnhancer.java:72)
          at org.apache.tapestry.enhance.DefaultComponentClassEnhancer.(DefaultComponentClassEnhancer.java:66)
          at org.apache.tapestry.engine.AbstractEngine.createComponentClassEnhancer(AbstractEngine.java:2207)
          at org.apache.tapestry.engine.AbstractEngine.setupForRequest(AbstractEngine.java:1262)
          at org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:824)
          at org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:197)
          at org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:158)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
          at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:98)
          at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:176)
          at java.security.AccessController.doPrivileged(Native Method)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:172)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
          at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
          at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
          at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
          at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
          at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
          at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
          at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
          at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
          at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
          at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
          at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
          at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
          at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
          at java.lang.Thread.run(Unknown Source)
          Caused by: javassist.NotFoundException: java.lang.Object
          at javassist.ClassPoolTail.openClassfile(ClassPoolTail.java:302)
          at javassist.ClassPoolTail.checkClassName(ClassPoolTail.java:177)
          at javassist.ClassPool.checkClassName(ClassPool.java:709)
          at javassist.ClassPool.get0(ClassPool.java:572)
          at javassist.ClassPool.get(ClassPool.java:561)
          at org.apache.tapestry.enhance.javassist.ClassMapping.loadType(ClassMapping.java:89)
          at org.apache.tapestry.enhance.javassist.ClassMapping.initialize(ClassMapping.java:73)
          ... 45 more

          • 2. Re: javassist.NotFoundException: java.lang.Object - with sec
            Shigeru Chiba Expert

            Probably, that is because the security manager
            does not allow Javassist to access rt.jar including
            java/lang/Object.class.

            Did you install javassist.jar under ${java.home}/lib/ext/ ?
            If not, please try.

            Otherwise, you can give permissions to javassist.jar to
            access rt.jar. For example, you can include the following
            code in your policy file:

            grant codeBase "file:/home/you/lib/javassist.jar" {
             permission java.security.AllPermission;
            };


            Above, I assume that javassist.jar is under /home/you/lib.