Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] binary weaving not working on some class files

Open a bugzilla for your problem.

> But the puzzling thing is that a class, which does _not_ have any of
> the classes it references missing, does not get woven! It was not
> mentioned at all in the errors I posted, but still in the out/
> directory it does not implement the Interface that I specified in the
> aspect.


Your declare parents will only impact top level types of course - so only
the top most element of each type hierarchy will get Subject - then
nothing else lower in the hierarchy needs it because they all will then
already implement Subject.

Can you narrow it down to the few types that don't weave correctly
and include that information in the bugzilla report?

regards,
Andy.

2008/10/7 David Mohr <dmohr@xxxxxxxxxx>
Hi,
I have been using binary weaving (ajc with -inpath and -aspectpath)
for some projects, but sometimes ajc does not weave the aspects for
some class files.

To be more specific, I'm trying to add an interface to all user defined classes:

public aspect AddInterface {
 declare parents: !java..* && !edu.unm.cs.oal.sharing.* &&
!org.aspectj..* implements Subject;
}

When I try to binary-weave this aspect with
 # ajc -XnotReweavable -inpath in/ -aspectpath aspect/ -d out/
I get the following errors:

---SNIP---
/nfs/home/home1/dmohr/svn/alg-opt/trunk/david/sharing/bw-bug/in/net/sourceforge/pmd/dfa/pathfinder/PathElement.class
[error] can't determine implemented interfaces of missing type
org.apache.tools.ant.Task
when processing declare parents net.sourceforge.pmd.cpd.CPDTask
when processing type mungers
when weaving
when batch building BuildConfig[null] #Files=0
 [Xlint:cantFindType]
(no source information available)
       [Xlint:cantFindType]
/nfs/home/home1/dmohr/svn/alg-opt/trunk/david/sharing/bw-bug/in/net/sourceforge/pmd/dfa/pathfinder/PathElement.class
[error] can't determine implemented interfaces of missing type
org.apache.tools.ant.Task
when processing declare parents net.sourceforge.pmd.cpd.CPDTask
when processing type mungers
when weaving
when batch building BuildConfig[null] #Files=0
 [Xlint:cantFindType]
(no source information available)
       [Xlint:cantFindType]
/nfs/home/home1/dmohr/svn/alg-opt/trunk/david/sharing/bw-bug/in/net/sourceforge/pmd/dfa/pathfinder/PathElement.class
[error] can't determine implemented interfaces of missing type
org.apache.tools.ant.types.EnumeratedAttribute
when processing declare parents net.sourceforge.pmd.cpd.CPDTask$FormatAttribute
when processing type mungers
when weaving
when batch building BuildConfig[null] #Files=0
 [Xlint:cantFindType]
(no source information available)
       [Xlint:cantFindType]
/nfs/home/home1/dmohr/svn/alg-opt/trunk/david/sharing/bw-bug/in/net/sourceforge/pmd/dfa/pathfinder/PathElement.class
[error] can't determine implemented interfaces of missing type
org.apache.tools.ant.types.EnumeratedAttribute
when processing declare parents net.sourceforge.pmd.cpd.CPDTask$FormatAttribute
when processing type mungers
when weaving
when batch building BuildConfig[null] #Files=0
 [Xlint:cantFindType]
(no source information available)
       [Xlint:cantFindType]
/nfs/home/home1/dmohr/svn/alg-opt/trunk/david/sharing/bw-bug/in/net/sourceforge/pmd/dfa/pathfinder/PathElement.class
[error] can't determine implemented interfaces of missing type
org.apache.tools.ant.Task
when processing declare parents net.sourceforge.pmd.ant.PMDTask
when processing type mungers
when weaving
when batch building BuildConfig[null] #Files=0
 [Xlint:cantFindType]
(no source information available)
       [Xlint:cantFindType]
/nfs/home/home1/dmohr/svn/alg-opt/trunk/david/sharing/bw-bug/in/net/sourceforge/pmd/dfa/pathfinder/PathElement.class
[error] can't determine implemented interfaces of missing type
org.apache.tools.ant.Task
when processing declare parents net.sourceforge.pmd.ant.PMDTask
when processing type mungers
when weaving
when batch building BuildConfig[null] #Files=0
 [Xlint:cantFindType]
(no source information available)
       [Xlint:cantFindType]
/nfs/home/home1/dmohr/svn/alg-opt/trunk/david/sharing/bw-bug/in/net/sourceforge/pmd/dfa/pathfinder/PathElement.class
[error] can't determine implemented interfaces of missing type
org.apache.tools.ant.types.EnumeratedAttribute
when processing declare parents
net.sourceforge.pmd.cpd.CPDTask$LanguageAttribute
when processing type mungers
when weaving
when batch building BuildConfig[null] #Files=0
 [Xlint:cantFindType]
(no source information available)
       [Xlint:cantFindType]
/nfs/home/home1/dmohr/svn/alg-opt/trunk/david/sharing/bw-bug/in/net/sourceforge/pmd/dfa/pathfinder/PathElement.class
[error] can't determine implemented interfaces of missing type
org.apache.tools.ant.types.EnumeratedAttribute
when processing declare parents
net.sourceforge.pmd.cpd.CPDTask$LanguageAttribute
when processing type mungers
when weaving
when batch building BuildConfig[null] #Files=0
 [Xlint:cantFindType]
(no source information available)
       [Xlint:cantFindType]
---SNAP---

So in 1.6.2, net/sourceforge/pmd/dfa/pathfinder/PathElement.class is
not even copied over to the output folder, while in 1.6.1 it was
correctly woven (I did specify -Xnot

Yet there are classes not mentioned in any of these error messages,
where the aspect does not get woven! That class does get copied into
the output folder on all aspectj versions which I tried.

Should I post the -showWeaveInfo log, or rather upload the files somewhere?

Thanks for any help!

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


Back to the top