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

简介: <div class="markdown_views"><p>1、异常信息</p><pre class="prettyprint"><code class=" hljs applescript">严重: Exception sending context initialized event <span class="hljs-keyword">to</span> li

1、异常信息

严重: Exception sending context initialized event to listener instance of class or
g.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'httpConnection' defined in file [F:\workspace\.metadata\.plugins\org.ecl
ipse.wst.server.core\tmp1\wtpwebapps\timetable\WEB-INF\classes\com\benben\timeta
ble\common\HttpConnection.class]: Initialization of bean failed; nested exceptio
n is java.lang.IllegalArgumentException: error the @annotation pointcut expressi
on is only supported at Java 5 compliance level or above
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(Ab
stractBeanFactory.java:294)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSi
ngleton(DefaultSingletonBeanRegistry.java:225)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(Abst
ractBeanFactory.java:291)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra
ctBeanFactory.java:193)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInst
antiateSingletons(DefaultListableBeanFactory.java:585)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFac
toryInitialization(AbstractApplicationContext.java:913)
    at org.springframework.context.support.AbstractApplicationContext.refresh(Abstr
actApplicationContext.java:464)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicat
ionContext(ContextLoader.java:385)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(Cont
extLoader.java:284)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(Con
textLoaderListener.java:111)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:
5016)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:
5524)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:15
75)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:15
65)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: error the @annotation pointcut ex
pression is only supported at Java 5 compliance level or above
    at org.aspectj.weaver.tools.PointcutParser.parsePointcutExpression(PointcutPars
er.java:317)
    at org.springframework.aop.aspectj.AspectJExpressionPointcut.buildPointcutExpre
ssion(AspectJExpressionPointcut.java:207)
    at org.springframework.aop.aspectj.AspectJExpressionPointcut.buildPointcutExpre
ssion(AspectJExpressionPointcut.java:193)
    at org.springframework.aop.aspectj.AspectJExpressionPointcut.checkReadyToMatch(
AspectJExpressionPointcut.java:182)
    at org.springframework.aop.aspectj.AspectJExpressionPointcut.getClassFilter(Asp
ectJExpressionPointcut.java:163)
    at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:209)
    at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:263)
    at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.j
ava:295)
    at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.
findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:117)
    at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.
findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:87)
    at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.
getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:68)
    at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfN
ecessary(AbstractAutoProxyCreator.java:359)
    at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postPro
cessAfterInitialization(AbstractAutoProxyCreator.java:322)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.j
ava:407)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.initializeBean(AbstractAutowireCapableBeanFactory.java:1461)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    ... 20 more

五月 15, 2015 3:29:25 下午 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class co
m.benben.timetable.device.component.listener.SocketListener
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'httpConnection' defined in file [F:\workspace\.metadata\.plugins\org.ecl
ipse.wst.server.core\tmp1\wtpwebapps\timetable\WEB-INF\classes\com\benben\timeta
ble\common\HttpConnection.class]: Initialization of bean failed; nested exceptio
n is java.lang.IllegalArgumentException: error the @annotation pointcut expressi
on is only supported at Java 5 compliance level or above
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(Ab
stractBeanFactory.java:294)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSi
ngleton(DefaultSingletonBeanRegistry.java:225)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(Abst
ractBeanFactory.java:291)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra
ctBeanFactory.java:193)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInst
antiateSingletons(DefaultListableBeanFactory.java:585)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFac
toryInitialization(AbstractApplicationContext.java:913)
    at org.springframework.context.support.AbstractApplicationContext.refresh(Abstr
actApplicationContext.java:464)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicat
ionContext(ContextLoader.java:385)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(Cont
extLoader.java:284)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(Con
textLoaderListener.java:111)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:
5016)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:
5524)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:15
75)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:15
65)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: error the @annotation pointcut ex
pression is only supported at Java 5 compliance level or above
    at org.aspectj.weaver.tools.PointcutParser.parsePointcutExpression(PointcutPars
er.java:317)
    at org.springframework.aop.aspectj.AspectJExpressionPointcut.buildPointcutExpre
ssion(AspectJExpressionPointcut.java:207)
    at org.springframework.aop.aspectj.AspectJExpressionPointcut.buildPointcutExpre
ssion(AspectJExpressionPointcut.java:193)
    at org.springframework.aop.aspectj.AspectJExpressionPointcut.checkReadyToMatch(
AspectJExpressionPointcut.java:182)
    at org.springframework.aop.aspectj.AspectJExpressionPointcut.getClassFilter(Asp
ectJExpressionPointcut.java:163)
    at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:209)
    at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:263)
    at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.j
ava:295)
    at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.
findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:117)
    at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.
findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:87)
    at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.
getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:68)
    at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfN
ecessary(AbstractAutoProxyCreator.java:359)
    at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postPro
cessAfterInitialization(AbstractAutoProxyCreator.java:322)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.j
ava:407)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.initializeBean(AbstractAutowireCapableBeanFactory.java:1461)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    ... 20 more

2、解决
度娘之后,说是org.aspect包的问题。我的包是1.6.2版本的。升级到1.7.3版本后,问题得到解决

  <org.aspectj.version>1.6.2</org.aspectj.version>

换成:

  <org.aspectj.version>1.7.3</org.aspectj.version>
目录
相关文章
|
2天前
|
Java
如何在 Java 中处理“Broken Pipe”异常
在Java中处理“Broken Pipe”异常,通常发生在网络通信中,如Socket编程时。该异常表示写入操作的另一端已关闭连接。解决方法包括:检查网络连接、设置超时、使用try-catch捕获异常并进行重试或关闭资源。
|
4天前
|
存储 安全 Java
如何避免 Java 中的“ArrayStoreException”异常
在Java中,ArrayStoreException异常通常发生在尝试将不兼容的对象存储到泛型数组中时。为了避免这种异常,确保在操作数组时遵循以下几点:1. 使用泛型确保类型安全;2. 避免生类型(raw types)的使用;3. 在添加元素前进行类型检查。通过这些方法,可以有效防止 ArrayStoreException 的发生。
|
5天前
|
人工智能 Oracle Java
解决 Java 打印日志吞异常堆栈的问题
前几天有同学找我查一个空指针问题,Java 打印日志时,异常堆栈信息被吞了,导致定位不到出问题的地方。
19 2
|
9天前
|
Java 索引
如何避免在 Java 中引发`StringIndexOutOfBoundsException`异常
在Java中,处理字符串时若访问了不存在的索引,会抛出`StringIndexOutOfBoundsException`异常。为避免此异常,应确保索引值在有效范围内,例如使用`length()`方法检查字符串长度,并确保索引值不小于0且不大于字符串长度减1。
|
11天前
|
安全 Java 数据安全/隐私保护
如何配置 Java 安全管理器来避免访问控制异常
配置Java安全管理器以防止访问控制异常,需在启动JVM时通过 `-Djava.security.manager` 参数启用,并设置安全策略文件,定义权限规则,限制代码执行操作,确保应用安全。
|
17天前
|
Java
让星星⭐月亮告诉你,Java异常分类[Throwable(Error/Exception(RuntimeException/其他异常)) 检查时异常 非检查时异常]
本文深入解析了Java异常处理机制,重点介绍了`Throwable`类及其子类`Error`和`Exception`,并通过实例代码、流程图和表格详细解释了异常的分类、区别及处理方法,帮助读者掌握异常处理的关键技巧,提升程序的稳定性和健壮性。
37 1
|
22天前
|
Java 程序员
关于java异常
关于java异常
19 5
|
22天前
|
存储 Java 编译器
【一步一步了解Java系列】:认识异常类
【一步一步了解Java系列】:认识异常类
20 2
|
22天前
|
安全 Java 编译器
Java异常
Java异常——Exception
19 0
|
4天前
|
监控 安全 Java
在 Java 中使用线程池监控以及动态调整线程池时需要注意什么?
【10月更文挑战第22天】在进行线程池的监控和动态调整时,要综合考虑多方面的因素,谨慎操作,以确保线程池能够高效、稳定地运行,满足业务的需求。
71 38