gpt4 book ai didi

java - @Annotation 在 Java 5 合规性级别或更高级别受支持

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:54:25 25 4
gpt4 key购买 nike

当我尝试运行我的应用程序之一时出现以下错误:

error the @annotation pointcut expression is only supported at Java 5 compliance level or above

该应用程序使用 AspectJ 6.0、AspectJWeaver 1.8 和 SpringAspects 4.2 依赖项。我已经检查过启动的 JVM 是 JDK 1.8 并且 JAVA_HOME 也设置为我的 JDK 1.8 安装。从类似的问题中环顾四周,我发现答案是确保将 aspectjweaver 设置为 1.8,并且不要将 AspectJ 1.5.4 与 JDK 1.6 以上的任何东西一起使用。我可以检查其他设置或配置吗?

更多的堆栈跟踪:

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

最佳答案

简而言之:不要部署具有冲突的 AspectJWeaver 1.8 依赖项的 AspectJ 6.0。

我怀疑这对任何人都没有太大帮助,因为这个问题非常小众。我的本地部署有 AspectJ 6.0 jar,它与旧版本的 AspectJWeaver jar 一起打包。应用程序的运行命令从/myApp/lib/* 设置类路径。

找出我所做的所有依赖项:sudo ps -ef | grep -i myApp其次是 lsof -p <pid> > ~/tmp .我之所以能够使用它,是因为虽然应用程序出现故障,但该过程仍在启动。我注意到类路径中有一个旧版本的 aspectJWeaver,并最终从我的本地类路径文件夹中删除了 AspectJ 6.0 jar。

关于java - @Annotation 在 Java 5 合规性级别或更高级别受支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36162253/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com