Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6330581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:53:51+00:00 2026-05-24T17:53:51+00:00

I am using aspectJ to inject an interface implementation. Eclipse compiles everything just fine.

  • 0

I am using aspectJ to inject an interface implementation.
Eclipse compiles everything just fine.
However the project has to be built with ant as well.

iajc task fails with:
” type Foo must implement the inherited abstract method Bar.doThings() ”
where Bar is the interface that has an intertype (ITD) implementation.

code looks like this (in their respective files):

class Foo extends BaseFoo {...}
abstract class BaseFoo implements Bar {...}
interface Bar{ 
     void doThings{} 
     public static aspect Implementation {
           void Bar.doThings() {
               //whatever
            }
     }
 }

weaving messages do show class BaseFoo having the method doThings() intertyped
but Foo does not.
and consequently fails with “must implement …” error.

I am pretty sure that I have similar situations working correctly within my common.jar.
This happens when I am compiling another module where Bar is defined and ITD/implemented within the common.jar. The common.jar is specified correctly in <iajc .... aspectPathRef..> otherwise the BaseFoo would not have gotten intertyped.

So it looks like the compiler is not seeing the implementation inherited from the base class where it was intertyped.

Here is what iajc looks like :

   <iajc destdir="${build.dir}" sourceroots="${javasrc.dir}"`
            source="1.6"
            classpathref="classpath" 
            Xlint="warnings" 
            aspectPathRef="aspectlib"
            showWeaveInfo="true" />

where aspectlib is includes apsectjrt.jar and my common.jar

and one more thing: eclipse project that does compile and run is not divided into common and other modules – all the src dirs are just imported into a single aggregate project.

So please – what is wrong here ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T17:53:52+00:00Added an answer on May 24, 2026 at 5:53 pm

    Here is a link to the bug I submitted to aspectj bugzilla
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=354683

    I distilled the problem down to this :
    Having aspects and interfaces defined in a jar – hierarchical interfaces and their hierarchical implementations do not get woven correctly in a target project in both eclipse and command line.

    Here is all of the code in the “jar” project :

    public interface CommonData {void getData();}
    public interface CommonDataImpl extends CommonData {}
    public aspect CommonDataImplementation {
         public void CommonDataImpl.getData() {}
    }
    public interface DerivedCommonDataInterface extends CommonData {
        void getDerivedData();
    }
    public interface DerivedCommonDataInterfaceImpl 
               extends DerivedCommonDataInterface, CommonDataImpl {}
    public aspect DerivedCommonDataInterfaceImplementation {
        public void DerivedCommonDataInterfaceImpl.getDerivedData() {}
    }
    

    Note that “derived” interface extends another and so does its implementation extends the “common” implementation.

    Here is the whole of the target project:

    public abstract class AbstractBaseClass <T extends Whatever> 
        implements DerivedCommonDataInterfaceImpl {}
    public class DerivedClass extends AbstractBaseClass {}
    

    The build.xml files would be a waste of space here – you can download the tar from the bug attachement(link above).
    So until somebody from aspectj project weighs in on it – this is the answer.

    And even though this problem is a pretty serious issue and would make it a showstopper for many situations, I am going to aggregate all of my actual work into a single eclipse/ant project via symlinks or svnexternals or whatever because implementing interfaces via ITD is it – the amount of code I have deleted and have yet to delete thanks to ITD is hard to overestimate.

    Big thumbs up to you aspectj people (bugs an’ all 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using org.aspectj.lang.annotation.Pointcut . I have an interface com.home.learn.Try. I want a pointcut
I'm using Spring and AspectJ to do some nice weaving and I just ran
I think about using AspectJ in an existing project. I have several pure Java
Using JDeveloper , I started developing a set of web pages for a project
I have an application using AspectJ with load time weaving to advise various methods.
I am using Spring's declarative transactions (the @Transactional annotation) in aspectj mode. It works
I have to use Annotation Processing (apt) and AspectJ in the same Maven project.
If I just add <aop:aspectj-autoproxy proxy-target-class=false/> to the start of my spring context, every
Using AspectJ, how do you replace an existing annotation? I have the following code
So, I've started looking into using AspectJ to handle processing events when the state

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.