I am getting the following error when I am trying to run one of my applications:
error the @annotation pointcut expression is only supported at Java 5 compliance level or above
The application uses AspectJ 6.0, AspectJWeaver 1.8, and SpringAspects 4.2 dependencies. I've checked that the JVM that is started is JDK 1.8 and JAVA_HOME is also set to my JDK 1.8 installation. Looking around from similar questions I see that the answer is to make sure that aspectjweaver be set to 1.8 and don't use AspectJ 1.5.4 with anything above JDK 1.6. Is there some other setting or configuration I can check?
A bit more of the stack trace:
Exiting with throwable: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name org.springframework.context.event.internalEventListenerProcessor': Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: error the @annotation pointcut expression is only supported at Java 5 compliance level or above
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.springframework.context.event.internalEventListenerProcessor': Initialization of bean failed;
nested exception is java.lang.IllegalArgumentException:
error the @annotation pointcut expression is only supported at Java 5 compliance level or above
Short: Don't deploy AspectJ 6.0 with conflicting AspectJWeaver 1.8 dependencies.
I suspect this won't be terribly helpful to anyone since the issue was incredibly niche. My local deployment had AspectJ 6.0 jar which came with packaged with it a older version of AspectJWeaver jar. The run command for the application set classpath from /myApp/lib/*.
To find out all the dependencies I did: sudo ps -ef | grep -i myApp followed by lsof -p <pid> > ~/tmp . I was able to use this because while the application had failures the process still started. I noticed an older version of aspectJWeaver in the class path and ended up deleting AspectJ 6.0 jar from my local classpath folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With