-
spring 项目启动报错org.springframework.beans.factory.annotation.InjectionMetadata5
请帮忙看下这个是什么问题。
严重: Servlet /yage threw load() exception
java.lang.NoSuchMethodError: org.springframework.beans.factory.annotation.InjectionMetadata.<init>(Ljava/lang/Class;)V
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:350)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(PersistenceAnnotationBeanPostProcessor.java:296)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:823)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:496)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:459)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:632)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:589)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:646)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:509)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:450)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4045)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4351)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2012-1-4 15:00:41 org.apache.coyote.http11.Http11Protocol start
问题补充:renpeng301 写道NoSuchMethodError 找不到方法 你用的jar不对·· 检查你的springjar 看看 Spring 2.0开始 引入了一些用于配置的annotation
我用的是spring2.5的JAR,spring-servlet.xml中引用的是
xmlns:mvc="http://www.springframework.org/schema/mvc"
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
是不是spring用的JAR的版本太低了?2012年1月04日 23:02
6个答案 按时间排序 按投票排序
-
检查一下版本不匹配:
PersistenceAnnotationBeanPostProcessor来自spring-orm jar包
InjectionMetadata 来自spring-beans jar包
检查这两个jar版本是否一致2012年1月06日 11:04
-
public class InjectionMetadata extends Object Internal class for managing injection metadata. Not intended for direct use in applications. Used by AutowiredAnnotationBeanPostProcessor, CommonAnnotationBeanPostProcessor and PersistenceAnnotationBeanPostProcessor. Since: 2.5 Author: Juergen Hoeller 这个2.5就有了 应该不是版本的问题可能存在下面问题 1.jar版本冲突 2.你debug下看看,工厂有没有注入成功。。。。
2012年1月05日 09:07
-
NoSuchMethodError 找不到方法 你用的jar不对·· 检查你的springjar 看看 Spring 2.0开始 引入了一些用于配置的annotation
2012年1月05日 08:38
相关推荐
- springcloud启动报错org.springframework.beans.factory.BeanCreationException
- SpringBoot启动报错:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean
- SpringBoot启动报错:org.springframework.beans.factory.UnsatisfiedDependencyException Error creating
- SpringBoot启动报错解决:org.springframework.beans.factory.UnsatisfiedDependencyException
- 采坑记录:解决web启动报错StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException
相关推荐
org.springframework.beans.factory.annotation org.springframework.beans.factory.config org.springframework.beans.factory.parsing org.springframework.beans.factory.serviceloader org.springframework....
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @...
nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator]: ...
在`org.springframework.beans.factory.annotation`包中,我们可以找到AutowiredAnnotationBeanPostProcessor,它是处理@Autowired注解的关键。 5. **@Service**、**@Repository**、**@Controller**:这些是Spring ...
14. <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" /> 15. 16. <!-- 对模型视图名称的解析,即在模型视图名称添加前后缀 --> 17. <bean class="org....
<bean class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer"> <value>classpath:jdbc.properties <!-- 配置數據源 --> <bean id="dataSource" class="org.apache....
`org.springframework.beans.factory.BeanFactory`是Bean容器的接口,提供了更基础的Bean管理功能。 - **AOP API**:如`org.springframework.aop.framework.ProxyFactoryBean`,用于创建代理对象,实现代理模式;`...
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet; import org....
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @...
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import java....
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.spring...
在`org.springframework.beans.factory.annotation`包下,`@Autowired`注解用于自动装配bean,而`@Qualifier`则用于指定特定的bean实例。 3. **AOP**:Spring的AOP模块允许开发者定义“切面”,这些切面可以封装横...
spring 3.2.3 参考文档这个版本在官网上文档都很难找,但是有归档的地址 大家不要下这个,可以到官网下载,我这里就是存一下档https://docs.spring.io/spring/docs/3.2.3.RELEASE/spring-framework-reference/html/
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [applicationContext.xml]; nested exception is java.lang....
2. 依赖注入(Dependency Injection):在`org.springframework.beans.factory.annotation`包下,有如AutowiredAnnotationBeanPostProcessor等类,它们实现了基于注解的依赖注入。 3. AOP代理(AOP Proxy):在`org...
例如,`org.springframework.beans.factory.annotation.Autowired`注解用于实现依赖注入,`org.springframework.web.bind.annotation.RequestMapping`用于处理HTTP请求映射,`org.springframework.context....
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.test.web.servlet.MockMvc; import ...
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.spring...
源码中,我们可以看到 `org.springframework.beans.factory.annotation.Autowired` 注解用于自动装配依赖,以及 `org.springframework.beans.factory.BeanFactory` 和 `org.springframework.beans.factory.config....