开发者社区> 问答> 正文

druid 1.0.11 绑定了spring高版本class,我这用第版本的spring报错?报错

@wenshao druid 1.0.10版本后绑定了spring高版本class,我这用低版本的spring报错,能否不在druid中使用特定的spring?

展开
收起
爱吃鱼的程序员 2020-06-14 18:53:03 727 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    错误信息是?

    严重:Exceptionsendingcontextinitializedeventtolistenerinstanceofclassorg.springframework.web.context.ContextLoaderListener
    java.lang.NoClassDefFoundError:org/springframework/beans/factory/parsing/ComponentDefinition
    atcom.alibaba.druid.support.spring.stat.config.DruidStatNamespaceHandler.init(DruidStatNamespaceHandler.java:24)
    atorg.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.initHandlerMappings(DefaultNamespaceHandlerResolver.java:113)
    atorg.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.<init>(DefaultNamespaceHandlerResolver.java:86)
    atorg.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.<init>(DefaultNamespaceHandlerResolver.java:74)
    atorg.springframework.beans.factory.xml.XmlBeanDefinitionReader.createDefaultNamespaceHandlerResolver(XmlBeanDefinitionReader.java:507)
    atorg.springframework.beans.factory.xml.XmlBeanDefinitionReader.createReaderContext(XmlBeanDefinitionReader.java:496)
    atorg.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:476)
    atorg.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:386)
    atorg.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:340)
    atorg.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:315)
    atorg.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126)
    atorg.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
    atorg.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:123)
    atorg.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:91)
    atorg.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
    atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:283)
    atorg.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
    atorg.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
    atorg.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
    atorg.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
    atorg.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994)
    atorg.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)
    atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    atorg.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
    atorg.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    atorg.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
    atorg.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:672)
    atorg.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1861)
    atjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    atjava.util.concurrent.FutureTask.run(FutureTask.java:262)
    atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    atjava.lang.Thread.run(Thread.java:745)
    Causedby:java.lang.ClassNotFoundException:org.springframework.beans.factory.parsing.ComponentDefinition
    atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
    atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
    ...33more
    @wenshao这是以前的一个老项目,spring版本好像是2.02.0就别用了。肯定不兼容数据库连接池,为什么要绑定spring呢?

    引用来自“bjydfq_163”的评论

    数据库连接池,为什么要绑定spring呢?自己拉源码,修改POM,然后重新installdeploy到自己的maven私服吧。
    2020-06-15 11:04:40
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
云栖社区特邀专家徐雷Java Spring Boot开发实战系列课程(第20讲):经典面试题与阿里等名企内部招聘求职面试技巧 立即下载
微服务架构模式与原理Spring Cloud开发实战 立即下载
阿里特邀专家徐雷Java Spring Boot开发实战系列课程(第18讲):制作Java Docker镜像与推送到DockerHub和阿里云Docker仓库 立即下载