Skip to main content

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

Hi,

first, thank you for your fast reply. I've solved my problem. I'm very sorry because the problem was a very classpath error problem. Writing the ANT script I've omitted one jar lib ( I need to sleep more :)

Matthew Webster ha scritto:
Are the J2EE classes need to compiler your application e.g. javax.servlet.http.HttpServletRequest on the classpath in the weave step?
this was the problem.


best regards and thank you

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
http://w3.hursley.ibm.com/~websterm/


*Stalsy <stalsy@xxxxxxxxx>*
Sent by: aspectj-users-bounces@xxxxxxxxxxx

08/01/2007 08:43
Please respond to
aspectj-users@xxxxxxxxxxx


	
To
	aspectj-users@xxxxxxxxxxx
cc
	
Subject
	[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




_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

------------------------------------------------------------------------

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


--
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