Druid多数据源配置报错

问题描述

各位大侠我在Spring.xml文件里配置了两个datasource,然后项目启动就报如下错误了,求帮助!org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:227)-Contextinitializationfailedorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'org.springframework.jmx.export.MBeanExporter#0'definedinURL[jar:file:portal-config-2.2.28.jar!/applicationContext.xml]:Invocationofinitmethodfailed;nestedexceptionisorg.springframework.jmx.export.UnableToRegisterMBeanException:UnabletoregisterMBean[{CreateTime:"2015-02-2818:02:23",ActiveCount:0,PoolingCount:5,CreateCount:5,DestroyCount:0,CloseCount:0,ConnectCount:0,Connections:[{ID:838794668,ConnectTime:"2015-02-2818:02:26",UseCount:0,LastActiveTime:"2015-02-2818:02:26"},{ID:2012626361,ConnectTime:"2015-02-2818:02:27",UseCount:0,LastActiveTime:"2015-02-2818:02:27"},{ID:117686720,ConnectTime:"2015-02-2818:02:31",UseCount:0,LastActiveTime:"2015-02-2818:02:31"},{ID:1626639887,ConnectTime:"2015-02-2818:02:32",UseCount:0,LastActiveTime:"2015-02-2818:02:32"},{ID:648088608,ConnectTime:"2015-02-2818:02:34",UseCount:0,LastActiveTime:"2015-02-2818:02:34"}]}[{ID:838794668,poolStatements:[]},{ID:2012626361,poolStatements:[]},{ID:117686720,poolStatements:[]},{ID:1626639887,poolStatements:[]},{ID:648088608,poolStatements:[]}]]withkey'pageDataSource';nestedexceptionisjavax.management.InstanceAlreadyExistsException:QOSS:type=DruidDataSourceatorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)atorg.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)atorg.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)atorg.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)atorg.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)atorg.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)atorg.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)atorg.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)atcom.cnc.portal.web.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:52)atorg.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)atorg.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)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:633)atorg.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1558)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)atjava.lang.reflect.Method.invoke(Method.java:483)atorg.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)atcom.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)atcom.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)atorg.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:620)atorg.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:567)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)atjava.lang.reflect.Method.invoke(Method.java:483)atorg.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)atcom.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)atcom.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)atjavax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1466)atjavax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)atjavax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1307)atjavax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1399)atjavax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:828)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)atjava.lang.reflect.Method.invoke(Method.java:483)atsun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)atsun.rmi.transport.Transport$1.run(Transport.java:178)atsun.rmi.transport.Transport$1.run(Transport.java:175)atjava.security.AccessController.doPrivileged(NativeMethod)atsun.rmi.transport.Transport.serviceCall(Transport.java:174)atsun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:557)atsun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:812)atsun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:671)atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)atjava.lang.Thread.run(Thread.java:745)Causedby:org.springframework.jmx.export.UnableToRegisterMBeanException:UnabletoregisterMBean[{CreateTime:"2015-02-2818:02:23",ActiveCount:0,PoolingCount:5,CreateCount:5,DestroyCount:0,CloseCount:0,ConnectCount:0,Connections:[{ID:838794668,ConnectTime:"2015-02-2818:02:26",UseCount:0,LastActiveTime:"2015-02-2818:02:26"},{ID:2012626361,ConnectTime:"2015-02-2818:02:27",UseCount:0,LastActiveTime:"2015-02-2818:02:27"},{ID:117686720,ConnectTime:"2015-02-2818:02:31",UseCount:0,LastActiveTime:"2015-02-2818:02:31"},{ID:1626639887,ConnectTime:"2015-02-2818:02:32",UseCount:0,LastActiveTime:"2015-02-2818:02:32"},{ID:648088608,ConnectTime:"2015-02-2818:02:34",UseCount:0,LastActiveTime:"2015-02-2818:02:34"}]}[{ID:838794668,poolStatements:[]},{ID:2012626361,poolStatements:[]},{ID:117686720,poolStatements:[]},{ID:1626639887,poolStatements:[]},{ID:648088608,poolStatements:[]}]]withkey'pageDataSource';nestedexceptionisjavax.management.InstanceAlreadyExistsException:QOSS:type=DruidDataSourceatorg.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:602)atorg.springframework.jmx.export.MBeanExporter.registerBeans(MBeanExporter.java:527)atorg.springframework.jmx.export.MBeanExporter.afterPropertiesSet(MBeanExporter.java:413)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)...56moreCausedby:javax.management.InstanceAlreadyExistsException:QOSS:type=DruidDataSourceatcom.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437)atcom.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898)atcom.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966)atcom.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900)atcom.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324)atcom.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)atorg.springframework.jmx.support.MBeanRegistrationSupport.doRegister(MBeanRegistrationSupport.java:169)atorg.springframework.jmx.export.MBeanExporter.registerBeanInstance(MBeanExporter.java:647)atorg.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:592)...60more

解决方案

时间: 2024-09-20 15:29:38

Druid多数据源配置报错的相关文章

springMVC配置报错,求大神帮忙

问题描述 springMVC配置报错,求大神帮忙 解决方案 解决方案二: 解决方案三: 解决方案四: 解决方案五: No mapping found for HTTP request with URI [/demo/index.html] in DispatcherServlet with name 'spring' 说的很明白了 解决方案六: 建立也demo文件夹,把index.html挪进去. 解决方案七: RequestMapping("/demo/*")试试

spring mvc-springmvc 和velocity 配置 报错 VelocityEngineFactory NoClassDefFoundError

问题描述 springmvc 和velocity 配置 报错 VelocityEngineFactory NoClassDefFoundError spring 4.1.6.RELEASE maven方式. 报错如下: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountController': Injection of autowired dependenc

spring.net 泛型配置报错问题

问题描述 spring.net 泛型配置报错问题 我在一个类里定义了两个泛型对角如下: public class UserController : Controller { // // GET: /User/ BaseService<MDL.User_Test_T> user_test_t { set; get; } BaseService<MDL.Role_Info_T> role_info_t { set; get; } } xml 配置如下: <object type=

Struts2配置报错:java.lang.ClassNotFoundException

问题描述 Struts2配置报错:java.lang.ClassNotFoundException 严重: Exception starting filter struts2 java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter .StrutsPrepareAndExecuteFilter at org.apache.catalina.loader.WebappClassLoader.loadClass

环境配置报错-日文系统下Java程序中的中文注释报错

问题描述 日文系统下Java程序中的中文注释报错 我的系统是日文的, 只是一个最简单程序,因为程序中使用中文的注释,所以编译的时候报错,请指教怎样才能不报错? 参看: public class FloatTest { public static void main(String[] args) { float af = 5.2345556f; // 下面将看到af的值已经发生了改变 System.out.println(af); double a = 0.0; double c = Double

MyEclipse hibernate3.3 配置报错

问题描述 log4j:WARNNoappenderscouldbefoundforlogger(org.hibernate.cfg.Environment).log4j:WARNPleaseinitializethelog4jsystemproperly.Exceptioninthread"main"org.hibernate.InvalidMappingException:Couldnotparsemappingdocumentfromresourcecom/my/hibernate

配置-cruisecontrol集成SVN启动报错?

问题描述 cruisecontrol集成SVN启动报错? 用CC每日构建是启动配置报错只要是SVN自动更新代码 下面是错误信息 net.sourceforge.cruisecontrol.CruiseControlException: svn failed with exception at net.sourceforge.cruisecontrol.util.CommandExecutor.executeAndWait(Com mandExecutor.java:115) at net.sou

spring-使用SpringMVC 静态资源访问 报错ConversionFailedException

问题描述 使用SpringMVC 静态资源访问 报错ConversionFailedException 使用的spring 版本是 4.20 在springmvc配置 报错很奇怪.. 解决方案 该错误是因为: 1.内嵌jetty在运行时会锁定静态资源:因此在运行过程中不能删除静态资源: 2.问题的根源是启动了多个jetty实例,但是实际没有报端口冲突,可以检查任务管理器看是否有多个java/javaw进程在运行,如果是杀掉进程然后重试. 解决方案二: 配置这个没? <mvc:resources

spring-配置Spring-Security报错,找不到元素 &amp;amp;#39;b:beans&amp;amp;#39; 的声明

问题描述 配置Spring-Security报错,找不到元素 'b:beans' 的声明 Spring新手,现在想在SpringMVC的基础上使用Spring Security框架.但Spring Security配置报错,困扰了很久.先上代码 <?xml version=""1.0"" encoding=""UTF-8""?><b:beans xmlns=""http://www.spr