嗨我有一个d簧应用程序的上述例外,我试图连接到集群的Oracle数据库,但即使我尝试连接到单个实例仍然有相同的异常.
bean定义如下:
完整的堆栈跟踪是:
2012-02-13 13:18:45,084 1375 [main] INFO org.hibernate.connection.ConnectionProvIDerFactory - Initializing connection provIDer: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvIDer2012-02-13 13:18:45,207 1498 [main] WARN org.hibernate.util.JDBCExceptionReporter - sql Error: 0,sqlState: null2012-02-13 13:18:45,207 1498 [main] ERROR org.hibernate.util.JDBCExceptionReporter - Cannot create PoolableConnectionFactory (Io exception: The Network Adapter Could not establish the connection)2012-02-13 13:18:45,209 1500 [main] WARN org.hibernate.cfg.SettingsFactory - Could not obtain connection Metadataorg.apache.commons.dbcp.sqlnestedException: Cannot create PoolableConnectionFactory (Io exception: The Network Adapter Could not establish the connection) at org.apache.commons.dbcp.BasicdataSource.createPoolableConnectionFactory(BasicdataSource.java:1549) at org.apache.commons.dbcp.BasicdataSource.createDataSource(BasicdataSource.java:1388) at org.apache.commons.dbcp.BasicdataSource.getConnection(BasicdataSource.java:1044) at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvIDer.getConnection(LocalDataSourceConnectionProvIDer.java:81) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:76) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1933) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1216) at org.springframework.orm.hibernate3.LocalSessionfactorybean.newSessionFactory(LocalSessionfactorybean.java:860) at org.springframework.orm.hibernate3.LocalSessionfactorybean.buildSessionFactory(LocalSessionfactorybean.java:779) at org.springframework.orm.hibernate3.AbstractSessionfactorybean.afterPropertIEsSet(AbstractSessionfactorybean.java:211) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.invokeInitMethods(AbstractautowireCapablebeanfactory.java:1479) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.initializeBean(AbstractautowireCapablebeanfactory.java:1417) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.doCreateBean(AbstractautowireCapablebeanfactory.java:519) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.createBean(AbstractautowireCapablebeanfactory.java:456) at org.springframework.beans.factory.support.Abstractbeanfactory$1.getobject(Abstractbeanfactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.Abstractbeanfactory.doGetBean(Abstractbeanfactory.java:292) at org.springframework.beans.factory.support.Abstractbeanfactory.getBean(Abstractbeanfactory.java:194) at org.springframework.beans.factory.support.BeanDeFinitionValueResolver.resolveReference(BeanDeFinitionValueResolver.java:322) at org.springframework.beans.factory.support.BeanDeFinitionValueResolver.resolveValueIfNecessary(BeanDeFinitionValueResolver.java:106) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.applyPropertyValues(AbstractautowireCapablebeanfactory.java:1325) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.populateBean(AbstractautowireCapablebeanfactory.java:1086) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.doCreateBean(AbstractautowireCapablebeanfactory.java:517) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.createBean(AbstractautowireCapablebeanfactory.java:456) at org.springframework.beans.factory.support.Abstractbeanfactory$1.getobject(Abstractbeanfactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.Abstractbeanfactory.doGetBean(Abstractbeanfactory.java:292) at org.springframework.beans.factory.support.Abstractbeanfactory.getBean(Abstractbeanfactory.java:194) at org.springframework.beans.factory.support.Defaultlistablebeanfactory.findautowireCandIDates(Defaultlistablebeanfactory.java:844) at org.springframework.beans.factory.support.Defaultlistablebeanfactory.doResolveDependency(Defaultlistablebeanfactory.java:786) at org.springframework.beans.factory.support.Defaultlistablebeanfactory.resolveDependency(Defaultlistablebeanfactory.java:703) at org.springframework.beans.factory.annotation.autowiredAnnotationBeanPostProcessor$autowiredMethodElement.inject(autowiredAnnotationBeanPostProcessor.java:547) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84) at org.springframework.beans.factory.annotation.autowiredAnnotationBeanPostProcessor.postProcesspropertyValues(autowiredAnnotationBeanPostProcessor.java:282) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.populateBean(AbstractautowireCapablebeanfactory.java:1074) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.doCreateBean(AbstractautowireCapablebeanfactory.java:517) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.createBean(AbstractautowireCapablebeanfactory.java:456) at org.springframework.beans.factory.support.Abstractbeanfactory$1.getobject(Abstractbeanfactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.Abstractbeanfactory.doGetBean(Abstractbeanfactory.java:292) at org.springframework.beans.factory.support.Abstractbeanfactory.getBean(Abstractbeanfactory.java:194) at org.springframework.beans.factory.support.Defaultlistablebeanfactory.preInstantiateSingletons(Defaultlistablebeanfactory.java:580) at org.springframework.context.support.AbstractApplicationContext.finishbeanfactoryInitialization(AbstractApplicationContext.java:900) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:455) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306) 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:1173) at org.apache.catalina.core.StandarDWrapper.load(StandarDWrapper.java:993) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659) 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:546) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041) at org.apache.catalina.startup.HostConfig.deployDirectorIEs(HostConfig.java:964) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321) at org.apache.catalina.util.lifecycleSupport.firelifecycleEvent(lifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:785) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) 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:289) at org.apache.catalina.startup.bootstrap.main(bootstrap.java:414)Caused by: java.sql.sqlException: Io exception: The Network Adapter Could not establish the connection at oracle.jdbc.driver.DatabaseError.throwsqlException(DatabaseError.java:112) at oracle.jdbc.driver.DatabaseError.throwsqlException(DatabaseError.java:146) at oracle.jdbc.driver.DatabaseError.throwsqlException(DatabaseError.java:255) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387) at oracle.jdbc.driver.PhysicalConnection.将ip地址更改为DNS名称,我有一个不同的例外,堆栈跟踪如下:
2012-02-13 13:46:36,709 1685 [main] WARN org.hibernate.util.JDBCExceptionReporter - sql Error: 0,sqlState: null2012-02-13 13:46:36,709 1685 [main] ERROR org.hibernate.util.JDBCExceptionReporter - Error preloading the connection pool2012-02-13 13:46:36,710 1686 [main] WARN org.hibernate.cfg.SettingsFactory - Could not obtain connection Metadataorg.apache.commons.dbcp.sqlnestedException: Error preloading the connection pool at org.apache.commons.dbcp.BasicdataSource.createDataSource(BasicdataSource.java:1398) at org.apache.commons.dbcp.BasicdataSource.getConnection(BasicdataSource.java:1044) at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvIDer.getConnection(LocalDataSourceConnectionProvIDer.java:81) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:76) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1933) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1216) at org.springframework.orm.hibernate3.LocalSessionfactorybean.newSessionFactory(LocalSessionfactorybean.java:860) at org.springframework.orm.hibernate3.LocalSessionfactorybean.buildSessionFactory(LocalSessionfactorybean.java:779) at org.springframework.orm.hibernate3.AbstractSessionfactorybean.afterPropertIEsSet(AbstractSessionfactorybean.java:211) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.invokeInitMethods(AbstractautowireCapablebeanfactory.java:1479) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.initializeBean(AbstractautowireCapablebeanfactory.java:1417) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.doCreateBean(AbstractautowireCapablebeanfactory.java:519) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.createBean(AbstractautowireCapablebeanfactory.java:456) at org.springframework.beans.factory.support.Abstractbeanfactory$1.getobject(Abstractbeanfactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.Abstractbeanfactory.doGetBean(Abstractbeanfactory.java:292) at org.springframework.beans.factory.support.Abstractbeanfactory.getBean(Abstractbeanfactory.java:194) at org.springframework.beans.factory.support.BeanDeFinitionValueResolver.resolveReference(BeanDeFinitionValueResolver.java:322) at org.springframework.beans.factory.support.BeanDeFinitionValueResolver.resolveValueIfNecessary(BeanDeFinitionValueResolver.java:106) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.applyPropertyValues(AbstractautowireCapablebeanfactory.java:1325) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.populateBean(AbstractautowireCapablebeanfactory.java:1086) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.doCreateBean(AbstractautowireCapablebeanfactory.java:517) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.createBean(AbstractautowireCapablebeanfactory.java:456) at org.springframework.beans.factory.support.Abstractbeanfactory$1.getobject(Abstractbeanfactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.Abstractbeanfactory.doGetBean(Abstractbeanfactory.java:292) at org.springframework.beans.factory.support.Abstractbeanfactory.getBean(Abstractbeanfactory.java:194) at org.springframework.beans.factory.support.Defaultlistablebeanfactory.findautowireCandIDates(Defaultlistablebeanfactory.java:844) at org.springframework.beans.factory.support.Defaultlistablebeanfactory.doResolveDependency(Defaultlistablebeanfactory.java:786) at org.springframework.beans.factory.support.Defaultlistablebeanfactory.resolveDependency(Defaultlistablebeanfactory.java:703) at org.springframework.beans.factory.annotation.autowiredAnnotationBeanPostProcessor$autowiredMethodElement.inject(autowiredAnnotationBeanPostProcessor.java:547) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84) at org.springframework.beans.factory.annotation.autowiredAnnotationBeanPostProcessor.postProcesspropertyValues(autowiredAnnotationBeanPostProcessor.java:282) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.populateBean(AbstractautowireCapablebeanfactory.java:1074) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.doCreateBean(AbstractautowireCapablebeanfactory.java:517) at org.springframework.beans.factory.support.AbstractautowireCapablebeanfactory.createBean(AbstractautowireCapablebeanfactory.java:456) at org.springframework.beans.factory.support.Abstractbeanfactory$1.getobject(Abstractbeanfactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.Abstractbeanfactory.doGetBean(Abstractbeanfactory.java:292) at org.springframework.beans.factory.support.Abstractbeanfactory.getBean(Abstractbeanfactory.java:194) at org.springframework.beans.factory.support.Defaultlistablebeanfactory.preInstantiateSingletons(Defaultlistablebeanfactory.java:580) at org.springframework.context.support.AbstractApplicationContext.finishbeanfactoryInitialization(AbstractApplicationContext.java:900) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:455) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306) 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:1173) at org.apache.catalina.core.StandarDWrapper.load(StandarDWrapper.java:993) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659) 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:546) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041) at org.apache.catalina.startup.HostConfig.deployDirectorIEs(HostConfig.java:964) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321) at org.apache.catalina.util.lifecycleSupport.firelifecycleEvent(lifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:785) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) 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:289) at org.apache.catalina.startup.bootstrap.main(bootstrap.java:414)Caused by: java.sql.sqlException: Io exception: The Network Adapter Could not establish the connection at oracle.jdbc.driver.DatabaseError.throwsqlException(DatabaseError.java:112) at oracle.jdbc.driver.DatabaseError.throwsqlException(DatabaseError.java:146) at oracle.jdbc.driver.DatabaseError.throwsqlException(DatabaseError.java:255) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387) at oracle.jdbc.driver.PhysicalConnection.最佳答案我不得不去寻找与oracle上的版本兼容的ojdbc,安装了这个解决了我的问题,我的不好意思是一个ojdbc适用于所有人 总结 以上是内存溢出为你收集整理的java – 无法创建PoolableConnectionFactory(Io异常:网络适配器无法建立连接)全部内容,希望文章能够帮你解决java – 无法创建PoolableConnectionFactory(Io异常:网络适配器无法建立连接)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)