Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] how to do Tomcat 5.0.12 do the ajc compiler ?

Thanks Robin, I´ll try



Valter




From: "Ron Bodkin" <rbodkin@xxxxxxxxxxxxxx>
Reply-To: aspectj-users@xxxxxxxxxxx
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users] how to do Tomcat 5.0.12 do the ajc compiler ?
Date: Thu, 13 May 2004 08:26:12 -0700

I have been able to get it working for Tomcat 4.1.24 without modifications. I used the COMMAND_EDITOR extension point to the aspectj compiler task that adds any classpath library whose name ends with Weave.jar to the aspectpath (see attached).

This note describes how to configure Tomcat 4.x to use AspectJ to
compile JSP files.

It uses the ajee.adapters.AutoAspectpathRewriter (attached) to
set up an aspectpath that includes any jars on the classpath that are
named *Weave.jar.

1. Server configuration:
<!-- in %TOMCAT_HOME%/conf/web.xml or in app/WEB-INF/web.xml -->
    <servlet>
        <servlet-name>ajsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>logVerbosityLevel</param-name>
            <param-value>DEBUG</param-value>
        </init-param>
        <init-param>
            <param-name>compiler</param-name>
<param-value>org.aspectj.tools.ant.taskdefs.Ajc11CompilerAdapter</param-value>
        </init-param>
        <init-param>
            <param-name>fork</param-name>
            <param-value>FALSE</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>

<!-- in app/WEB-INF/web.xml for apps that use AspectJ with JSPs (or
in %TOMCAT_HOME%/conf/web.xml to always use AspectJ with JSPs)  -->
  <servlet-mapping>
    <servlet-name>ajsp</servlet-name>
    <url-pattern>*.jsp</url-pattern>
  </servlet-mapping>

2. Command line set up of variables (for Windows command processor):
Set CATALINA_OPTS=-Dorg.aspectj.tools.ant.taskdefs.AjcTask.COMMAND_EDITOR=ajee.adapters.AutoAspectpathRewriter

3. Install the relevant jars:
copy %ASPECTJ_HOME%\lib\aspectjtools.jar %TOMCAT_HOME%\common\lib
copy %ASPECTJ_HOME%\lib\aspectjrt.jar %TOMCAT_HOME%\common\lib
copy eopSupportWeave.jar %TOMCAT_HOME%\common\lib

copy <your aspect jar>Weave.jar %TOMCAT_HOME%\common\lib
or
copy <your aspect jar>Weave.jar app\WEB-INF\lib

4. When you change your aspects, you will need to delete any
   precompiled jsp files; the Tomcat jsp engine (jasper) will not
   recognize dependency on aspects. E.g.,

del %TOMCAT_HOME%\work\Standalone\localhost\<app>\*.java
del %TOMCAT_HOME%\work\Standalone\localhost\<app>\*.class

Ron

Ron Bodkin
Chief Technology Officer
New Aspects of Software
o: (415) 824-4690
m: (415) 509-2895

> ------------Original Message------------
> From: Jordi alvarez Canal <jalvarezc@xxxxxxx>
> To: "valtercamargo@xxxxxxxxxxx" <valtercamargo@xxxxxxxxxxx>, "aspectj-users@xxxxxxxxxxx" <aspectj-users@xxxxxxxxxxx>
> Date: Thu, May-13-2004 7:12 AM
> Subject: RE: [aspectj-users] how to do Tomcat 5.0.12 do the ajc compiler ?
>
> Hi Valter, we have done that for Tomcat 4.1. What we have done is
> to modify Tomcat 4.1 code in order to properly use AspectJ Ant
> tasks.
>
> I have not looked into Tomcat 5, and I do not know wether it is
> necessary or not to go into Tomcat code (I am not sure about that).
>
> Maybe I am wrong, but I think that the problem with your
> modifications is that: AspectJ compiler produces the same result
> as the Java compiler does, because it only receives as input the
> Java file corresponding to the .jsp servlet.
>
> I guess you need to tell to the executed ant task which aspects
> you want to compile/weave with the servlet java file. One
> possibility that could work fine is to define your own Ant task
> extending the AspectJ Ant task. With this extension you could try
> to fill these gaps and set the appropiate parameters for the
> extended Ant task (I do not know if this would work for your
> situation... but you can try/evaluate it).
>
> greetings,
> Jordi
>
> :Hi All,
> :
> :
> :   I am working with aspect-development to Web, thus I need
> :to do the Tomcat
> :5 use the ajc compiler....
> :  I have modified the web.xml file the way showed below.
> :After this, I
> :copied the aspectjtools.jar to the common/lib directory and
> :the
> :aspectjrt.jar to jakarta-tomcat/bin. However, it´s not
> :working.... I think
> :that Tomcat is still using javac.
> :
> :  Somebody knows what´s wrong ?
> :
> :  <servlet>
> :        <servlet-name>jsp</servlet-name>
> :          ...
> :                <init-param>
> :                      <param-name>compiler</param-name>
> :
> :<param-value>org.aspectj.tools.ant.taskdefs.Ajc11CompilerAd
> :apter</param-value>
> :              </init-param>
> :
> :        <init-param>
> :          ...
> :        </init-param>
> :
> :	  <load-on-startup>3</load-on-startup>
> :    </servlet>
> :
> :
> :Thanks in advance,
> :
> :
> :
> :Valter Camargo
> :
> :
> :
> :
> :>From: André Dantas Rocha <ad-rocha@xxxxxxxxxx>
> :>Reply-To: aspectj-users@xxxxxxxxxxx
> :>To: <aspectj-users@xxxxxxxxxxx>
> :>Subject: RES: [aspectj-users] AspectJ 1.2 release
> :candidate 2 now
> :>available.
> :>Date: Thu, 13 May 2004 09:42:16 -0300
> :>
> :>I'm currently using AJDT 1.1.8 and AspectJ 1.2rc1. How do
> :I install the new
> :>AspectJ version (1.2rc2) for use with AJDT/eclipse?
> :>
> :>Thanks
> :>
> :>-----Mensagem original-----
> :>De: aspectj-users-admin@xxxxxxxxxxx
> :>[mailto:aspectj-users-admin@xxxxxxxxxxx]
> :>Em nome de Adrian Colyer
> :>Enviada em: quinta-feira, 13 de maio de 2004 05:44
> :>Para: aspectj-users@xxxxxxxxxxx;
> :aspectj-announce@xxxxxxxxxxx
> :>Cc: aspectj-dev@xxxxxxxxxxx
> :>Assunto: [aspectj-users] AspectJ 1.2 release candidate 2
> :now available.
> :>
> :>We are pleased to announce that the second release
> :candidate for
> :>AspectJ-1.2 is now available from the download page at
> :>http://eclipse.org/aspectj or directly from
> :>http://download.eclipse.org/technology/ajdt/aspectj-1.2rc2
> :.jar
> :>
> :>We hope to release 1.2 shortly. As ever, please upgrade
> :any old 1.1.1 or
> :>1.2rc1 projects and help us flush out any remaining bugs
> :before the final
> :>release.
> :>
> :>The definition of the AspectJ language is unchanged in the
> :1.2 release.
> :>Instead, AspectJ 1.2 provides major improvements to the
> :functionality of
> :>the
> :>supporting tools. Compilation times are greatly reduced,
> :error messages
> :>have
> :>been improved, incremental compilation support is
> :extended, and the ajdoc
> :>tool is back. Detailed release notes for all these updates
> :and more are
> :>available at:
> :>
> :>http://dev.eclipse.org/viewcvs/indextech.cgi/~checkout~/as
> :pectj-home/doc/REA
> :>DME-12.html
> :>
> :>
> :>The biggest change since 1.2rc1 has been the provision of
> :a new cflow
> :>implementation that exploits ThreadLocals on JVMs that
> :support them. This
> :>results in a performance boost and memory usage reduction
> :for heavily
> :>threaded programs making use of cflow.
> :>
> :>Patches and contributions were submitted by George Harley,
> :Matthew Webster,
> :>Martin Lippert, and Arno Schmidmeier. We are always very
> :grateful for these
> :>contributions that help improve the compiler and
> :supporting tools.
> :>
> :>Easy to reproduce bugs were submitted by Nicholas
> :Lesiecki, Ramnivas
> :>Laddad,
> :>Ron Bodkin, Sian Whiting, Eric Bodden, Mariano Ceccato,
> :Antti Karanta, Umit
> :>Vardar, Nick Brett, Miguel Monteiro, Rafael Chaves, Eric
> :Jain, Arno
> :>Schmidmeier, Attila Lendvai, Daniel McAllansmith, Laurie
> :Hendren and Oege
> :>De
> :>Moor.  We recognize the difficulty of producing clear
> :minimal test cases
> :>from bugs found in large systems and appreciate the work
> :that goes into
> :>these reports.
> :>
> :>We appreciate your help in squashing any bugs in this
> :release before 1.2.0
> :>(please also try out the new ajdoc on your projects).  If
> :you find any
> :>bugs,
> :>please submit a reproducible test case to
> :http://dev.eclipse.org (-> Bug
> :>Reports) (product AspectJ, component Compiler).
> :>
> :>Thanks and stay in touch,
> :>The AspectJ Team
> :>_______________________________________________
> :>aspectj-users mailing list
> :>aspectj-users@xxxxxxxxxxx
> :>http://dev.eclipse.org/mailman/listinfo/aspectj-users
> :>_______________________________________________
> :>aspectj-users mailing list
> :>aspectj-users@xxxxxxxxxxx
> :>http://dev.eclipse.org/mailman/listinfo/aspectj-users
> :>
> :>_______________________________________________
> :>aspectj-users mailing list
> :>aspectj-users@xxxxxxxxxxx
> :>http://dev.eclipse.org/mailman/listinfo/aspectj-users
> :
> :___________________________________________________________
> :______
> :MSN Hotmail, o maior webmail do Brasil.
> :http://www.hotmail.com
> :
> :_______________________________________________
> :aspectj-users mailing list
> :aspectj-users@xxxxxxxxxxx
> :http://dev.eclipse.org/mailman/listinfo/aspectj-users
>
<< AutoAspectpathRewriter.java >>

_________________________________________________________________
MSN Messenger: converse com os seus amigos online. http://messenger.msn.com.br



Back to the top