Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Mixin not recognized

Hi Simeon,
it seems like Eclipse is opening your aspect with the plain Java editor instead of the AspectJ editor. I usually use .aj extension for aspects to have Eclipse open them with the right editor. Otherwise, right click on the file and select the AspectJ editor to open the file.

The fact that errors does not appear in the problems view is because Eclipse uses two different approaches for finding errors : one is based on builders, and is what the problems view and the package explorer decorations report, which are reported during project build; the other is the inline editor problems, that are computed as you type. In this case, there are no "real" errors, so the AspectJ builder does not report any error to the problem view, but the editor is the java one and does not understands AspectJ syntax, reporting these "inline" errors.

Hope this helps,
Simone

Leyzerzon, Simeon wrote:
I'm trying to create a mixin inside an AJ project in MyEclipse:

public interface IDaoMixin {

        public static aspect Impl {
                ....
        }

        public void setJdbcTemplate(JdbcTemplate template);

}

and it gives me the following:

Multiple markers at this line
        - Syntax error on token "aspect", class
         expected
        - aspect cannot be resolved to a type
        - The interface IDaoMixin cannot define an
         initializer

What ccould be a problem here?  What's interesting, is that the Problems view in Eclipse doesn't register a problem, it only appears inside the editor.

Here's the .project file:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
        <name>GlobalMarketAnalytics</name>
        <comment></comment>
        <projects>
        </projects>
        <buildSpec>
                <buildCommand>
                        <name>org.eclipse.ajdt.core.ajbuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
                <buildCommand>
                        <name>com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
                <buildCommand>
                        <name>com.genuitec.eclipse.springframework.springbuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
        </buildSpec>
        <natures>
                <nature>org.eclipse.ajdt.ui.ajnature</nature>
                <nature>com.genuitec.eclipse.springframework.springnature</nature>
                <nature>com.genuitec.eclipse.ast.deploy.core.deploymentnature</nature>
                <nature>org.eclipse.jdt.core.javanature</nature>
        </natures>
</projectDescription>

Thank you in advance.
Simeon
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


--
Simone Gianni            CEO Semeru s.r.l.           Apache Committer
http://www.simonegianni.it/



Back to the top