Java报错3:java.lang.NoClassDefFoundError: Lorg/springframework/beans/factory/access/BeanFactoryReferen

java.lang.NoClassDefFoundError: Lorg/springframework/beans/factory/access/BeanFactoryReference;
    at java.lang.Class.getDeclaredFields0(Native Method)
    at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
    at java.lang.Class.getDeclaredFields(Class.java:1916)
    at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:110)
    at org.apache.catalina.core.DefaultInstanceManager.populateAnnotationsCache(DefaultInstanceManager.java:314)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:173)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:151)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4501)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5041)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493)
Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.access.BeanFactoryReference
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1275)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1104)
    ... 37 more

出错原因:jar包引用错误(版本错误),因struts与spring整合时,spring我使用了较高版本,但sturts案例中使用的却是低版本,很头疼,基本出错全是导包问题
解决方案:更改spring包

发布了76 篇原创文章 · 获赞 23 · 访问量 19万+
展开阅读全文

java.lang.ClassNotFoundException明明有这个

03-29

java.lang.ClassNotFoundException: org.apache.http.conn.socket.LayeredConnectionSocketFactory at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1891) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1734) at com.crux.wxms.service.BaseService.<init>(BaseService.java:29) at com.crux.wxms.service.RefundService.<init>(RefundService.java:8) at com.crux.wxms.controller.wx.WeiXinPayController.refundTest(WeiXinPayController.java:176) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:832) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:743) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:961) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858) at javax.servlet.http.HttpServlet.service(HttpServlet.java:624) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:442) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1082) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:623) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) 问答

求助spring事务异常,报错报了昨天一天了55555,在线等啊

03-22

# 就是一直都报这个错,昨天一天都没解决,感觉是确实一个方法,NoSuchMethodError:org.springframework.jdbc.datasource.DataSourceTransactionManager.determineTimeout,我导入源码看不到这个方法,只有一个调用它的参数,,,求大牛或者神牛帮帮忙,拜托了。。。。困扰了一天啊,,,,!!!整个人都不好了,在线等!! 报错信息: ``` Exception in thread "main" org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.lang.NoSuchMethodError: org.springframework.jdbc.datasource.DataSourceTransactionManager.determineTimeout(Lorg/springframework/transaction/TransactionDefinition;)I at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:242) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:283) at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:225) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at sun.proxy.$Proxy12.buyOneBook(Unknown Source) at org.Tran.Service.Imp.BuySomeBookImp.buySomeBook(BuySomeBookImp.java:17) at org.Tran.Test.Main.main(Main.java:16) Caused by: java.lang.NoSuchMethodError: org.springframework.jdbc.datasource.DataSourceTransactionManager.determineTimeout(Lorg/springframework/transaction/TransactionDefinition;)I at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:229) ... 10 more ``` 我的springConf.xml配置如下 ``` <?xml version="1.0" encoding="UTF-8" ?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> <context:annotation-config/> <context:component-scan base-package="org.Tran.*"/> <context:property-placeholder location="classpath:org/Tran/db.properties"/> <bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="${jdbc.driver}"/> <property name="url" value="${jdbc.url}"/> <property name="username" value="${jdbc.username}"/> <property name="password" value="${jdbc.password}"/> </bean> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="configLocation" value="classpath:org/Tran/xml/MybatisConf.xml"/> <property name="dataSource" ref="dataSource" /> </bean> <bean id="bookMapper" class="org.mybatis.spring.mapper.MapperFactoryBean"> <property name="mapperInterface" value="org.Tran.DAO.BookDAO"/> <property name="sqlSessionFactory" ref="sqlSessionFactory"/> </bean> <!--1. 事务配置 --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> <property name="nestedTransactionAllowed" value="true"/> </bean> <!-- 启用事务注解! --><!-- <tx:annotation-driven transaction-manager="transactionManager"/> --> <!--2.配置事务属性 --> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="*"/> </tx:attributes> </tx:advice> <!-- 3.配置事务切入点 --> <aop:config> <aop:pointcut expression="execution(* org.Tran.Service.BuyBookInterface.*(..))" id="txPointCut"/> <aop:advisor advice-ref="txAdvice" pointcut-ref="txPointCut"/> </aop:config> </beans> ``` 测试代码: ``` ApplicationContext ctx = new ClassPathXmlApplicationContext("org/Tran/xml/SpringConf.xml"); // BookServiceInterface bookService=ctx.getBean(BookServiceInterface.class); BuySomeBookInterface buybook=ctx.getBean(BuySomeBookInterface.class); buybook.buySomeBook("Jack", Arrays.asList("0001","0002")); ``` 下面是我的jar包![图片说明](https://img-ask.csdn.net/upload/201603/22/1458612915_654266.png) 我的数据库是mysql,表类型也是正常默认的innodb . 问答

weblogic部署war项目报错java.lang.ClassNotFoundException

01-17

<Jan 17, 2018 3:44:42,621 PM CST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID "621173883586108" for task "12" on [partition-name: DOMAIN]. Error is: "weblogic.management.DeploymentException: java.lang.ClassNotFoundException: org.springframework.beans.factory.config.BeanPostProcessor" weblogic.management.DeploymentException: java.lang.ClassNotFoundException: org.springframework.beans.factory.config.BeanPostProcessor at weblogic.application.internal.BaseDeployment.throwAppException(BaseDeployment.java:132) at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:244) at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:52) at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:158) at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:65) Truncated. see log file for complete stacktrace Caused By: java.lang.ClassNotFoundException: org.springframework.beans.factory.config.BeanPostProcessor at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1029) at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:990) at weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:611) at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:543) at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:496) Truncated. see log file for complete stacktrace > <Jan 17, 2018 3:44:42,633 PM CST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application "cppims2".> <Jan 17, 2018 3:44:42,633 PM CST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004 weblogic.management.DeploymentException: java.lang.ClassNotFoundException: org.springframework.beans.factory.config.BeanPostProcessor at weblogic.application.internal.BaseDeployment.throwAppException(BaseDeployment.java:132) at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:244) at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:52) at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:158) at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:65) Truncated. see log file for complete stacktrace Caused By: java.lang.ClassNotFoundException: org.springframework.beans.factory.config.BeanPostProcessor at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1029) at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:990) at weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:611) at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:543) at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:496) Truncated. see log file for complete stacktrace > =========================================== java.lang.ClassNotFoundException: org.springframework.beans.factory.config.BeanPostProcessor找不到这个类,但是war包里面jar中有 ![图片说明](https://img-ask.csdn.net/upload/201801/17/1516175198_716249.png) 应用使用ext+spring+servlet,之前在tomcat里一直都是正常的,现在领导要求使用weblogic,安装了weblogic12c,但是部署项目时失败,麻烦哪位大神帮忙解决一下,不胜感激 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览