Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Bytecode weaving problems

Hi All,

I try to weave binary aspects with some java bytecode classes using an ANT task. I just have source code of the aspects. So I first compile separately my aspects and than I weave them with my java ( pre-compiled .class ) code. My ANT script is:

......
<taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">
       <classpath>
             <pathelement location="${lib.dir}/aspectjtools.jar"/>
       </classpath>
   </taskdef>
......
<!-- Aspect compilation -->
   <target name="compile" depends="prepare">
       <ajc destdir="${repos.J2EE.aspect.dir}">
<classpath refid="classpathAJ" /> <src location="${repos.J2EE.aspect.dir}" />
       </ajc>
   </target>
......
<!-- Bytecode weaving. Classpath includes tomcat, aspectj, and target application necessary libs -->
<target name="weave" depends="compile">
<iajc destdir="${deploy.J2EE.out.webinf.classes.dir}" inpathDirCopyFilter="**/CVS/*,**/*.java">
           <!-- Java classes-->
           <inpath>
               <pathelement location="${target.J2EE.classes.dir}"/>
               <pathelement location="${target.J2EE.all.dir}"/>
           </inpath>
           <!-- Binary aspect -->
           <aspectpath location="${repos.J2EE.aspect.dir}" />
           <classpath refid="classpath" />
       </iajc>
   </target>


So the compilation is ok, but when "weave task" is executed I receive many errors like the following:

[iajc] C:\....profile\AddFeedAction.class [error] can't determine superclass of missing type javax.servlet.http.HttpServletRequest
    [iajc] when weaving classes
    [iajc] when weaving
    [iajc] when batch building BuildConfig[null] #Files=0
    [iajc] [Xlint:cantFindType]
    [iajc] (no source information available)
[iajc] C:\....profile\AddFeedAction.class [error] can't determine superclass of missing type javax.servlet.http.HttpSession
    [iajc] when weaving classes
    [iajc] when weaving
    [iajc] when batch building BuildConfig[null] #Files=0
    [iajc] [Xlint:cantFindType]
    [iajc] (no source information available)
[iajc] C:\....profile\AddFeedAction.class [error] can't determine superclass of missing type javax.servlet.http.HttpServletRequest
    [iajc] when weaving classes
    [iajc] when weaving
    [iajc] when batch building BuildConfig[null] #Files=0
    [iajc] [Xlint:cantFindType]
    [iajc] (no source information available)
    .........

It seems to be a classpath error, but I have included all necessary libs.

Can you help me please? Where I am wrong?

best regards

--
Stalsy

 HomePage   --:. http://www.stalsy.it
 Blog       --:. http://blog.stalsy.com
 Public Key --:. http://www.stalsy.it/key.php
E-Mail --:. stalsy@xxxxxxxxx MSN --:. faricci@xxxxxxxx
 Skype      --:. www.stalsy.it






Back to the top