AspectJ Framework Detection doesn't work in 15.0.2

Answered

Hi,

I've recently upgraded to 15.0.2.  I have a large project which includes AspectJ.  In previous versions of IntelliJ, the AspectJ framework was automatically detected and facets were assigned to each module.  However this does not seem to work anymore.  There are a lot of modules so I don't really like the idea of having to set them up manually (including aspect path, etc).

If I change the compiler to use Ajc and build the project, I'm not sure weaving actually occurs, because when I launch the project exceptions occur which relate to code not being woven.

So, anyone  know why the detection isn't working?  I have both the AspectJ plugin and the Spring AOP plugins installed and enabled.  

Thanks

9 comments
Comment actions Permalink

If the project is Maven-based, it should work.
Are there any exceptions in the log (Help | Show Log) after the import?

0
Comment actions Permalink

Hi,

Thanks for your reply.

The project is Maven based (multi-module).  The only exception I see in the log is this:


2016-01-05 09:16:38,394 [81443276]   INFO - agnostic.FrequentEventDetector - Too many events posted, #2
2016-01-05 09:16:39,201 [81444083]   INFO - agnostic.FrequentEventDetector - Too many events posted, #7
2016-01-05 09:16:39,265 [81444147]   INFO - agnostic.FrequentEventDetector - Too many events posted, #1
2016-01-05 09:16:39,266 [81444148]   INFO - agnostic.FrequentEventDetector - Too many events posted, #1
2016-01-05 09:16:39,266 [81444148]   INFO - agnostic.FrequentEventDetector - Too many events posted, #2
2016-01-05 09:16:39,577 [81444459]   INFO - agnostic.FrequentEventDetector - Too many events posted, #7
2016-01-05 09:16:39,577 [81444459]   INFO - agnostic.FrequentEventDetector - Too many events posted, #7
2016-01-05 09:16:39,577 [81444459]   INFO - agnostic.FrequentEventDetector - Too many events posted, #7
2016-01-05 09:16:39,577 [81444459]   INFO - agnostic.FrequentEventDetector - Too many events posted, #7
2016-01-05 09:16:39,799 [81444681]   INFO - agnostic.FrequentEventDetector - Too many events posted, #5
2016-01-05 09:16:39,799 [81444681]   INFO - agnostic.FrequentEventDetector - Too many events posted, #7
2016-01-05 09:16:39,800 [81444682]   INFO - agnostic.FrequentEventDetector - Too many events posted, #7
2016-01-05 09:16:39,800 [81444682]   INFO - agnostic.FrequentEventDetector - Too many events posted, #5
2016-01-05 09:16:39,801 [81444683]   INFO - agnostic.FrequentEventDetector - Too many events posted, #2
2016-01-05 09:16:39,801 [81444683]   INFO - agnostic.FrequentEventDetector - Too many events posted, #2
2016-01-05 09:16:39,802 [81444684]   INFO - agnostic.FrequentEventDetector - Too many events posted, #7
2016-01-05 09:16:39,802 [81444684]   INFO - agnostic.FrequentEventDetector - Too many events posted, #3
2016-01-05 09:16:39,803 [81444685]   INFO - agnostic.FrequentEventDetector - Too many events posted, #1
2016-01-05 09:16:39,803 [81444685]   INFO - agnostic.FrequentEventDetector - Too many events posted, #1
2016-01-05 09:16:39,804 [81444686]   INFO - agnostic.FrequentEventDetector - Too many events posted, #1
2016-01-05 09:16:39,887 [81444769]   INFO - agnostic.FrequentEventDetector - Too many events posted, #8
java.lang.Throwable
 at com.intellij.openapi.diagnostic.FrequentEventDetector.eventHappened(FrequentEventDetector.java:70)
 at com.intellij.openapi.application.impl.LaterInvocator.invokeLater(LaterInvocator.java:138)
 at com.intellij.openapi.application.impl.ModalityInvokatorImpl.invokeLater(ModalityInvokatorImpl.java:46)
 at com.intellij.openapi.application.impl.ModalityInvokatorImpl.invokeLater(ModalityInvokatorImpl.java:52)
 at com.intellij.openapi.application.impl.ApplicationImpl.invokeLater(ApplicationImpl.java:436)
 at com.intellij.openapi.vfs.impl.VirtualFileManagerImpl.notifyPropertyChanged(VirtualFileManagerImpl.java:213)
 at com.intellij.openapi.vfs.VirtualFile.setCharset(VirtualFile.java:540)
 at com.intellij.openapi.vfs.VirtualFile.setCharset(VirtualFile.java:524)
 at com.intellij.openapi.vfs.encoding.EncodingProjectManagerImpl$9$1.process(EncodingProjectManagerImpl.java:443)
 at com.intellij.openapi.vfs.encoding.EncodingProjectManagerImpl$9$1.process(EncodingProjectManagerImpl.java:427)
 at com.intellij.openapi.vfs.encoding.EncodingProjectManagerImpl$7.visitFile(EncodingProjectManagerImpl.java:381)
 at com.intellij.openapi.vfs.VirtualFileVisitor.visitFileEx(VirtualFileVisitor.java:132)
 at com.intellij.openapi.vfs.VfsUtilCore.visitChildrenRecursively(VfsUtilCore.java:267)
 at com.intellij.openapi.vfs.VfsUtilCore.visitChildrenRecursively(VfsUtilCore.java:299)
 at com.intellij.openapi.vfs.VfsUtilCore.visitChildrenRecursively(VfsUtilCore.java:299)
 at com.intellij.openapi.vfs.encoding.EncodingProjectManagerImpl.a(EncodingProjectManagerImpl.java:378)
 at com.intellij.openapi.vfs.encoding.EncodingProjectManagerImpl.access$300(EncodingProjectManagerImpl.java:64)
 at com.intellij.openapi.vfs.encoding.EncodingProjectManagerImpl$9.run(EncodingProjectManagerImpl.java:427)
 at com.intellij.openapi.vfs.encoding.EncodingProjectManagerImpl.suppressReloadDuring(EncodingProjectManagerImpl.java:404)
 at com.intellij.openapi.vfs.encoding.EncodingProjectManagerImpl$8.run(EncodingProjectManagerImpl.java:418)
 at com.intellij.openapi.progress.impl.CoreProgressManager$5.run(CoreProgressManager.java:227)
 at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:563)
 at com.intellij.openapi.progress.impl.CoreProgressManager$8.run(CoreProgressManager.java:357)
 at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
 at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:446)
 at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
 at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
 at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
 at com.intellij.openapi.application.impl.ApplicationImpl.runProcessWithProgressSynchronously(ApplicationImpl.java:601)
 at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:354)
 at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcessWithProgressSynchronously(ProgressManagerImpl.java:76)
 at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:230)
 at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:183)
 at com.intellij.openapi.vfs.encoding.EncodingProjectManagerImpl.a(EncodingProjectManagerImpl.java:415)
 at com.intellij.openapi.vfs.encoding.EncodingProjectManagerImpl.b(EncodingProjectManagerImpl.java:424)
 at com.intellij.openapi.vfs.encoding.EncodingProjectManagerImpl.setEncoding(EncodingProjectManagerImpl.java:217)
 at org.jetbrains.idea.maven.importing.configurers.MavenEncodingConfigurer.configure(MavenEncodingConfigurer.java:38)
 at org.jetbrains.idea.maven.importing.MavenProjectImporter$1.run(MavenProjectImporter.java:156)
 at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1002)
 at org.jetbrains.idea.maven.utils.MavenUtil$2.run(MavenUtil.java:192)
 at com.intellij.util.DisposeAwareRunnable.run(DisposeAwareRunnable.java:82)
 at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:158)
 at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.a(LaterInvocator.java:337)
 at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:321)
 at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
 at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
 at java.awt.EventQueue.access$200(EventQueue.java:103)
 at java.awt.EventQueue$3.run(EventQueue.java:694)
 at java.awt.EventQueue$3.run(EventQueue.java:692)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
 at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
 at com.intellij.ide.IdeEventQueue.f(IdeEventQueue.java:866)
 at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:654)
 at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:381)
 at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
 at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
 at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

0
Comment actions Permalink

Those are rather diagnostic.
Please attach pom.xml file from one of the modules (you may strip it down to aspectj-maven-plugin and related dependencies).

0
Comment actions Permalink

OK - here's one of them.  This is the module that defines our aspects (attached)



Attachment(s):
pom.xml
0
Comment actions Permalink

Does it help if you change "Settings | Build, Execution, Deployment | Build Tools | Maven | Maven home directory" to "Bundled (Maven 2)" and reimport the project?

0
Comment actions Permalink

Hi,

No it doesn't.  I also tried my installed Maven (3.3.3) and that didn't help either.

It autodetects the 'Web' and 'J2EE' frameworks OK - just not AspectJ.

BTW I can't see how it could be anything to do with the project, as it used to work totally fine (not saying you are saying any different, just reiterating the fact that it did work well at some point).

0
Comment actions Permalink

You see, the facet detection is based on a shared code from the Maven plugin. The behavior means that code just wasn't able to resolve aspectj-maven-plugin. Tinkering with Maven version is one way to affect the resolution process, specifying aspectj-maven-plugin version explicitly is the other.

Just to be sure - did you try to reimport Maven project after changing the version?

0
Comment actions Permalink

Ok - I know what the problem is....

In that pom.xml I sent you - I changed the group id of the aspectj maven plugin because we use a modified version of it (for our company).  I changed the group id to hide the company name.

When I change the group id back to 'org.codehaus.mojo' - the detection works.

I think what must have happened before is the aspectj detection on my project occurred before I started using the modified plugin (we only started using it a few months ago), and even though the group id of  the plugin changed, the project retained the AspectJ facets.

Thanks for your help...:-)

0
Comment actions Permalink

Thanks for letting me know.

That's right, IDEA does not automatically delete facets when corresponding plugins are removed from pom.xml.

0

Please sign in to leave a comment.