当前位置: 代码迷 >> Java Web开发 >> sturts1+Spring+Hibernate+Oracle运行出错解决思路
  详细解决方案

sturts1+Spring+Hibernate+Oracle运行出错解决思路

热度:72   发布时间:2016-04-17 10:27:22.0
sturts1+Spring+Hibernate+Oracle运行出错
Java code
2012-03-26 17:11:23,468 WARN [org.hibernate.util.JDBCExceptionReporter] - SQL Error: 0, SQLState: null2012-03-26 17:11:23,468 ERROR [org.hibernate.util.JDBCExceptionReporter] - Cannot create PoolableConnectionFactory (The TCP/IP connection to the host localhost, port 1433 has failed. Error: Connection refused: connect. Please verify the connection properties and check that a SQL Server instance is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.)2012-03-26 17:11:23,468 WARN [org.hibernate.cfg.SettingsFactory] - Could not obtain connection to query metadataorg.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (The TCP/IP connection to the host localhost, port 1433 has failed. Error: Connection refused: connect. Please verify the connection properties and check that a SQL Server instance is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.)    at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)    at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)    at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)    at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:111)    at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119)    at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2115)    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1339)    at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:855)    at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:774)    at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1400)    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545)    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)    at org.springframework.web.struts.ContextLoaderPlugIn.createWebApplicationContext(ContextLoaderPlugIn.java:356)    at org.springframework.web.struts.ContextLoaderPlugIn.initWebApplicationContext(ContextLoaderPlugIn.java:297)    at org.springframework.web.struts.ContextLoaderPlugIn.init(ContextLoaderPlugIn.java:227)    at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)    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:4420)    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4733)    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1315)    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)    at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)    at org.apache.catalina.core.StandardService.start(StandardService.java:525)    at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)    at org.apache.catalina.startup.Catalina.start(Catalina.java:595)    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: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed. Error: Connection refused: connect. Please verify the connection properties and check that a SQL Server instance is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:130)    at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1195)    at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(SQLServerConnection.java:1054)    at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:758)    at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)    at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)    at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)    at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)    at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)    ... 52 more
  相关解决方案