5 Replies Latest reply on Sep 6, 2004 9:47 PM by Aline

    Aspect on JSP

    Aline Newbie

      Hi, I want to now how can I apply a Aspect on JSP.

      I read some papers, and I now that a JSP is like a Servlet... if can I apply a Aspect on a Servlet it is true with a JSP???

      If it's is true, someone have a example with JSP???

      Tnks' Aline.

        • 1. Re: Aspect on JSP
          jlukiano Newbie

          It is not possible to use the AopC compiler as you don't have the .class files in this moment, so the only possible alternative is to enable the EnableTransformer flag on \conf\jboss-service.xml.
          Have you tried?

          In spite of this, I'm not sure the container that create the jsp servlet is under the wings of the AspectManagerService.

          • 2. Re: Aspect on JSP
            Bill Burke Master

            I don't think JSP aspectizing will work as it uses a different classloader. We will be improving our classloader integration shortly.

            Can you verify JSPs don't work?

            I do think it will work if you precompile your jsps.

            Thanks and apologies.

            Bill

            • 3. Re: Aspect on JSP
              Aline Newbie

              Hi Bill,

              I tried to use, jspc (created a *.java and a *.class) and aopc, the deploy was ok but when I called my page I received this error.

              Do you have any idea about this?

              Ps.: I named my page erro2.jsp


              21:54:30,255 INFO [TomcatDeployer] deploy, ctxPath=/erros, warUrl=file:/D:/jbos
              s-4.0.0DR4/server/default/tmp/deploy/tmp54054erros-exp.war/
              21:55:54,066 INFO [STDOUT] [warn] AOP Instrumentor failed to transform erro2
              21:55:54,066 INFO [STDOUT] java.lang.RuntimeException: ***** trying to convertR
              eferences of class: erro2 of ref org.apache.jasper.runtime.JspException
              21:55:54,066 INFO [STDOUT] at org.jboss.aop.instrument.Instrumentor.convert
              References(Instrumentor.java:742)
              21:55:54,066 INFO [STDOUT] at org.jboss.aop.instrument.Instrumentor.transfo
              rm(Instrumentor.java:775)
              21:55:54,066 INFO [STDOUT] at org.jboss.aop.AspectManager.translate(AspectM
              anager.java:508)
              21:55:54,066 INFO [STDOUT] at org.jboss.aop.AspectManager.transform(AspectM
              anager.java:462)
              21:55:54,066 INFO [STDOUT] at org.jboss.mx.loading.RepositoryClassLoader.fi
              ndClass(RepositoryClassLoader.java:576)
              21:55:54,066 INFO [STDOUT] at java.lang.ClassLoader.loadClass(ClassLoader.j
              ava:299)
              21:55:54,076 INFO [STDOUT] at org.jboss.mx.loading.RepositoryClassLoader.lo
              adClassLocally(RepositoryClassLoader.java:160)
              21:55:54,076 INFO [STDOUT] at org.jboss.mx.loading.ClassLoadingTask$ThreadT
              ask.run(ClassLoadingTask.java:119)
              21:55:54,076 INFO [STDOUT] at org.jboss.mx.loading.LoadMgr3.nextTask(LoadMg
              r3.java:351)
              21:55:54,076 INFO [STDOUT] at org.jboss.mx.loading.RepositoryClassLoader.lo
              adClassImpl(RepositoryClassLoader.java:472)
              21:55:54,076 INFO [STDOUT] at org.jboss.mx.loading.RepositoryClassLoader.lo
              adClass(RepositoryClassLoader.java:377)
              21:55:54,076 INFO [STDOUT] at java.lang.ClassLoader.loadClass(ClassLoader.j
              ava:255)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardWrapper.isCo
              ntainerProvidedServlet(StandardWrapper.java:1461)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardWrapper.load
              Servlet(StandardWrapper.java:918)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardWrapper.allo
              cate(StandardWrapper.java:687)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve
              .invoke(StandardWrapperValve.java:144)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext
              .invokeNext(StandardValveContext.java:104)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.inv
              oke(StandardPipeline.java:520)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve
              .invokeInternal(StandardContextValve.java:198)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve
              .invoke(StandardContextValve.java:152)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext
              .invokeNext(StandardValveContext.java:104)
              21:55:54,076 INFO [STDOUT] at org.jboss.web.tomcat.security.JBossSecurityMg
              rRealm.invoke(JBossSecurityMgrRealm.java:277)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext
              .invokeNext(StandardValveContext.java:102)
              21:55:54,076 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssocia
              tionValve.invoke(SecurityAssociationValve.java:80)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext
              .invokeNext(StandardValveContext.java:102)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.inv
              oke(StandardPipeline.java:520)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.in
              voke(StandardHostValve.java:137)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext
              .invokeNext(StandardValveContext.java:104)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.i
              nvoke(ErrorReportValve.java:117)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext
              .invokeNext(StandardValveContext.java:102)
              21:55:54,076 INFO [STDOUT] at org.jboss.web.tomcat.tc5.jca.CachedConnection
              Valve.invoke(CachedConnectionValve.java:122)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext
              .invokeNext(StandardValveContext.java:102)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.valves.AccessLogValve.inv
              oke(AccessLogValve.java:535)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext
              .invokeNext(StandardValveContext.java:102)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.inv
              oke(StandardPipeline.java:520)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.
              invoke(StandardEngineValve.java:109)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext
              .invokeNext(StandardValveContext.java:104)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.inv
              oke(StandardPipeline.java:520)
              21:55:54,076 INFO [STDOUT] at org.apache.catalina.core.ContainerBase.invoke
              (ContainerBase.java:929)
              21:55:54,076 INFO [STDOUT] at org.apache.coyote.tomcat5.CoyoteAdapter.servi
              ce(CoyoteAdapter.java:160)
              21:55:54,076 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.proc
              ess(Http11Processor.java:793)
              21:55:54,096 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http1
              1ConnectionHandler.processConnection(Http11Protocol.java:702)
              21:55:54,096 INFO [STDOUT] at org.apache.tomcat.util.net.TcpWorkerThread.ru
              nIt(PoolTcpEndpoint.java:571)
              21:55:54,096 INFO [STDOUT] at org.apache.tomcat.util.threads.ThreadPool$Con
              trolRunnable.run(ThreadPool.java:644)
              21:55:54,096 INFO [STDOUT] at java.lang.Thread.run(Thread.java:536)
              21:55:54,096 INFO [STDOUT] Caused by: javassist.NotFoundException: org.apache.j
              asper.runtime.JspException
              21:55:54,096 INFO [STDOUT] at javassist.ClassPool.get(ClassPool.java:372)
              21:55:54,096 INFO [STDOUT] at org.jboss.aop.instrument.Instrumentor.convert
              References(Instrumentor.java:729)
              21:55:54,096 INFO [STDOUT] ... 44 more

              • 4. Re: Aspect on JSP
                Bill Burke Master

                Can you send me a mini testcase? It would speed things up for us to fix.

                bill@jboss.org, kabir.khan@jboss.org

                Thanks,

                Bill

                • 5. Re: Aspect on JSP
                  Aline Newbie

                  Hi Bill, I sent de files... to emails.