2014-05-19 45 views
0

我克隆了一個spring-mvc項目並試圖使用intelliJ 12來運行。我有下面的堆棧跟蹤,無法弄清楚爲什麼應用程序窒息。由於Connection timed out: connect錯誤消息,我發現它沒有連接到數據庫。我通過database選項卡設置了data source,位於intelliJ。另外,我在xml文件中設置了數據源連接信息。在Spring-mvc項目中需要幫助閱讀stacktrace中列出的問題

編輯我已經添加使用所述數據源數據源中的IntelliJ

data source image http://snag.gy/1loae.jpg

加入連接xml文件

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation=" 
    http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> 

<!-- Data Source Setup --> 
<bean id="hsqldataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> 
    <property name="driverClassName" value="org.hsqldb.jdbcDriver" /> 
    <property name="url" value="jdbc:hsqldb:hsql" /> 
    <property name="username" value="example" /> 
    <property name="password" value="example" /> 
</bean> 
<bean id="mysqldataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> 
    <property name="driverClassName" value="com.mysql.jdbc.Driver" /> 
<property name="url" value="jdbc:mysql://192.168.71.1:3306/test_dev" /> 
<property name="username" value="example" /> 
    <property name="password" value="example" /> 
</bean> 

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> 
    <property name="mappingResources"> 
     <list> 
      <value>example/peer-review/domain/hibernatemapping/Division.hbm.xml</value> 
      <value>example/peer-review/domain/hibernatemapping/Modality.hbm.xml</value> 
      <value>example/peer-review/domain/hibernatemapping/Score.hbm.xml</value> 
      <value>example/peer-review/domain/hibernatemapping/User.hbm.xml</value> 
      <value>example/peer-review/domain/hibernatemapping/QaCase.hbm.xml</value> 
      <value>example/peer-review/domain/hibernatemapping/Review.hbm.xml</value> 
      <value>example/peer-review/domain/hibernatemapping/Exam.hbm.xml</value> 
      <value>example/peer-review/domain/hibernatemapping/Patient.hbm.xml</value> 
      <value>example/peer-review/domain/hibernatemapping/Role.hbm.xml</value> 
     </list> 
    </property> 
    <property name="hibernateProperties"> 
     <props> 
      <prop key="hibernate.show_sql">false</prop> 
      <prop key="hibernate.hbm2ddl.auto">create</prop> 
     </props> 
    </property> 
    <property name="dataSource" ref="hsqldataSource" /> 
</bean> 

<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> 
    <property name="sessionFactory" ref="sessionFactory" /> 
</bean> 

<!-- Dao Layer generic config-->  
<bean id="abstractDaoTarget" class="example.peer-review.persistence.hibernate.GenericDAOHibernateImpl" abstract="true"> 
    <property name="sessionFactory" ref="sessionFactory"/> 
</bean> 

<!-- Dao Layer instances --> 
<bean id="DivisionDAO" parent="abstractDaoTarget" class="example.peer-review.persistence.hibernate.DivisionDAOHibernateImpl" /> 
<bean id="ModalityDAO" parent="abstractDaoTarget" class="example.peer-review.persistence.hibernate.ModalityDAOHibernateImpl" /> 
<bean id="ScoreDAO" parent="abstractDaoTarget" class="example.peer-review.persistence.hibernate.ScoreDAOHibernateImpl" /> 
<bean id="UserDAO" parent="abstractDaoTarget" class="example.peer-review.persistence.hibernate.UserDAOHibernateImpl" /> 
<bean id="ReviewDAO" parent="abstractDaoTarget" class="example.peer-review.persistence.hibernate.ReviewDAOHibernateImpl" /> 
<bean id="QaCaseDAO" parent="abstractDaoTarget" class="example.peer-review.persistence.hibernate.QaCaseDAOHibernateImpl" /> 
<bean id="ExamDAO" parent="abstractDaoTarget" class="example.peer-review.persistence.hibernate.ExamDAOHibernateImpl" /> 
<bean id="PatientDAO" parent="abstractDaoTarget" class="example.peer-review.persistence.hibernate.PatientDAOHibernateImpl" /> 
<bean id="RoleDAO" parent="abstractDaoTarget" class="example.peer-review.persistence.hibernate.RoleDAOHibernateImpl" /> 

<bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource"> 
<property name="url" value="ldap://example.edu:1234" /> 
<property name="base" value="" /> 
<property name="userDn" value="cn=Test1" /> 
<property name="password" value="Test1" /> 
<property name="authenticationStrategy" ref="ldapAuthStrat" /> 
</bean> 

<bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate"> 
    <constructor-arg ref="contextSource" /> 
</bean> 

<bean id="ldapAuthStrat" class="org.springframework.ldap.core.support.ExternalTlsDirContextAuthenticationStrategy" /> 
</beans> 

局部堆棧跟蹤:下面(字符限制)。否則full stack trace

C:\Tomcat\apache-tomcat-7.0.53\bin\catalina.bat run 
[2014-05-19 03:07:18,047] Artifact peerreview:war: Server is not connected. Deploy is not available. 
Using CATALINA_BASE: "C:\Users\.IntelliJIdea12\system\tomcat\Unnamed_peerreview_3" 
Using CATALINA_HOME: "C:\Tomcat\apache-tomcat-7.0.53" 
Using CATALINA_TMPDIR: "C:\Tomcat\apache-tomcat-7.0.53\temp" 
Using JRE_HOME:  "C:\Program Files\Java\jdk1.7.0_11" 
Using CLASSPATH:  "C:\Tomcat\apache-tomcat-7.0.53\bin\bootstrap.jar;C:\Tomcat\apache-tomcat-7.0.53\bin\tomcat-juli.jar" 
Connected to the target VM, address: '127.0.0.1:58998', transport: 'socket' 
May 19, 2014 3:07:18 PM org.apache.catalina.core.AprLifecycleListener init 
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0_11\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.1.2\bin\..\.\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Services\IPT\;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\12.0\DLLShared\;C:\Program Files (x86)\Roxio\OEM\AudioCore\;C:\Program Files (x86)\PuTTY;C:\grails\grails-2.2.0\bin;%GROOVY_HOME%\bin;C:\Program Files\MySQL\MySQL Server 5.5\bin;C:\Program Files\Java\jdk1.7.0_11\bin;C:\Program Files\TortoiseHg\;c:\program files\java\jdk1.7.0_11\jre\bin;. 
May 19, 2014 3:07:18 PM org.apache.coyote.AbstractProtocol init 
INFO: Initializing ProtocolHandler ["http-bio-8080"] 
May 19, 2014 3:07:18 PM org.apache.coyote.AbstractProtocol init 
INFO: Initializing ProtocolHandler ["ajp-bio-8009"] 
May 19, 2014 3:07:18 PM org.apache.catalina.startup.Catalina load 
INFO: Initialization processed in 399 ms 
May 19, 2014 3:07:18 PM org.apache.catalina.core.StandardService startInternal 
INFO: Starting service Catalina 
May 19, 2014 3:07:18 PM org.apache.catalina.core.StandardEngine startInternal 
INFO: Starting Servlet Engine: Apache Tomcat/7.0.53 
May 19, 2014 3:07:18 PM org.apache.coyote.AbstractProtocol start 
INFO: Starting ProtocolHandler ["http-bio-8080"] 
May 19, 2014 3:07:18 PM org.apache.coyote.AbstractProtocol start 
INFO: Starting ProtocolHandler ["ajp-bio-8009"] 
May 19, 2014 3:07:18 PM org.apache.catalina.startup.Catalina start 
INFO: Server startup in 38 ms 
Connected to server 
[2014-05-19 03:07:19,087] Artifact peerreview:war: Artifact is being deployed, please wait... 
May 19, 2014 3:07:28 PM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory C:\Tomcat\apache-tomcat-7.0.53\webapps\manager 
15:07:46.254 [RMI TCP Connection(6)-127.0.0.1] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 08S01 
15:07:46.260 [RMI TCP Connection(6)-127.0.0.1] ERROR org.hibernate.util.JDBCExceptionReporter - Communications link failure 

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. 
15:07:46.272 [RMI TCP Connection(6)-127.0.0.1] WARN org.hibernate.cfg.SettingsFactory - Could not obtain connection to query metadata 
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. 
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_11] 
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_11] 
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_11] 
     at java.lang.reflect.Constructor.newInstance(Constructor.java:525) ~[na:1.7.0_11] 
     at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) ~[mysql-connector-java-5.1.9.jar:na] 
     at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074) ~[mysql-connector-java-5.1.9.jar:na] 
     at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2209) ~[mysql-connector-java-5.1.9.jar:na] 
     at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:776) ~[mysql-connector-java-5.1.9.jar:na] 
     at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46) ~[mysql-connector-java-5.1.9.jar:na] 
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_11] 
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_11] 
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_11] 
     at java.lang.reflect.Constructor.newInstance(Constructor.java:525) ~[na:1.7.0_11] 
     at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) ~[mysql-connector-java-5.1.9.jar:na] 
     at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:352) ~[mysql-connector-java-5.1.9.jar:na] 
     at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:284) ~[mysql-connector-java-5.1.9.jar:na] 
     at java.sql.DriverManager.getConnection(DriverManager.java:579) ~[na:1.7.0_11] 
     at java.sql.DriverManager.getConnection(DriverManager.java:190) ~[na:1.7.0_11] 
     at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:173) ~[spring-jdbc-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:164) ~[spring-jdbc-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:149) ~[spring-jdbc-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:119) ~[spring-jdbc-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81) ~[spring-hibernate-1.2.9.jar:1.2.9] 
     at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:113) ~[hibernate-core-3.6.5.Final.jar:3.6.5.Final] 
     at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2863) [hibernate-core-3.6.5.Final.jar:3.6.5.Final] 
     at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2859) [hibernate-core-3.6.5.Final.jar:3.6.5.Final] 
     at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870) [hibernate-core-3.6.5.Final.jar:3.6.5.Final] 
     at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:822) [spring-hibernate-1.2.9.jar:1.2.9] 
     at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:748) [spring-hibernate-1.2.9.jar:1.2.9] 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1504) [spring-beans-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1442) [spring-beans-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522) [spring-beans-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:459) [spring-beans-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) [spring-beans-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) [spring-beans-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) [spring-beans-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) [spring-beans-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322) [spring-beans-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106) [spring-beans-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1350) [spring-beans-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1111) [spring-beans-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:520) [spring-beans-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:459) [spring-beans-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) [spring-beans-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) [spring-beans-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) [spring-beans-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) [spring-beans-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585) [spring-beans-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) [spring-context-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) [spring-context-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:381) [spring-web-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283) [spring-web-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) [spring-web-3.1.0.RC1.jar:3.1.0.RC1] 
     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973) [catalina.jar:7.0.53] 
     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467) [catalina.jar:7.0.53] 
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.53] 
     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) [catalina.jar:7.0.53] 
     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) [catalina.jar:7.0.53] 
     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632) [catalina.jar:7.0.53] 
     at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1740) [catalina.jar:7.0.53] 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_11] 
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_11] 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_11] 
     at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_11] 
     at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301) [tomcat-coyote.jar:7.0.53] 
     at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) [na:1.7.0_11] 
     at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:791) [na:1.7.0_11] 
     at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:618) [catalina.jar:7.0.53] 
     at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:565) [catalina.jar:7.0.53] 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_11] 
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_11] 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_11] 
     at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_11] 
     at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301) [tomcat-coyote.jar:7.0.53] 
     at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) [na:1.7.0_11] 
     at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:791) [na:1.7.0_11] 
     at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1486) [na:1.7.0_11] 
     at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:96) [na:1.7.0_11] 
     at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1327) [na:1.7.0_11] 
     at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1419) [na:1.7.0_11] 
     at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:847) [na:1.7.0_11] 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_11] 
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_11] 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_11] 
     at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_11] 
     at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322) [na:1.7.0_11] 
     at sun.rmi.transport.Transport$1.run(Transport.java:177) [na:1.7.0_11] 
     at sun.rmi.transport.Transport$1.run(Transport.java:174) [na:1.7.0_11] 
     at java.security.AccessController.doPrivileged(Native Method) [na:1.7.0_11] 
     at sun.rmi.transport.Transport.serviceCall(Transport.java:173) [na:1.7.0_11] 
     at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553) [na:1.7.0_11] 
     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808) [na:1.7.0_11] 
     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667) [na:1.7.0_11] 
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0_11] 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [na:1.7.0_11] 
     at java.lang.Thread.run(Thread.java:722) [na:1.7.0_11] 
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. 
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_11] 
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_11] 
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_11] 
     at java.lang.reflect.Constructor.newInstance(Constructor.java:525) ~[na:1.7.0_11] 
     at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) ~[mysql-connector-java-5.1.9.jar:na] 
     at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074) ~[mysql-connector-java-5.1.9.jar:na] 
     at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:343) ~[mysql-connector-java-5.1.9.jar:na] 
     at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2132) ~[mysql-connector-java-5.1.9.jar:na] 
     ... 89 common frames omitted 
Caused by: java.net.ConnectException: Connection timed out: connect 
     at java.net.DualStackPlainSocketImpl.connect0(Native Method) ~[na:1.7.0_11] 
     at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69) ~[na:1.7.0_11] 
     at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) ~[na:1.7.0_11] 
     at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) ~[na:1.7.0_11] 
     at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) ~[na:1.7.0_11] 
     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157) ~[na:1.7.0_11] 
     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391) ~[na:1.7.0_11] 
     at java.net.Socket.connect(Socket.java:579) ~[na:1.7.0_11] 
     at java.net.Socket.connect(Socket.java:528) ~[na:1.7.0_11] 
     at java.net.Socket.<init>(Socket.java:425) ~[na:1.7.0_11] 
     at java.net.Socket.<init>(Socket.java:241) ~[na:1.7.0_11] 
     at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:253) ~[mysql-connector-java-5.1.9.jar:na] 
     at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:292) ~[mysql-connector-java-5.1.9.jar:na] 
     ... 90 common frames omitted 
15:07:46.289 [RMI TCP Connection(6)-127.0.0.1] ERROR org.springframework.web.context.ContextLoader - Context initialization failed 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DivisionDAO' defined in ServletContext resource [/WEB-INF/spring/applicationContext-business.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring/applicationContext-data.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: 'hibernate.dialect' must be set when no Connection available 
+0

您好,請您提供以下幫助:代碼顯示您在春季的數據庫連接設置,支持數據庫文件,您正在使用的數據庫類型及其配置。當此數據存在時,我會進一步提供幫助:) – Aeseir

+0

感謝Aeseir,我正在使用mysql連接。我已經從我的數據源選項卡添加了一個連接xml文件和一個圖像。 – paul

+0

如果將'sessionFactory'的'dataSource'更改爲'mysqldataSource',會發生什麼? –

回答

1

線棧跟蹤的147表示的根本原因在於,連接超時:

引起:java.net.ConnectException:連接超時:接

因此,與您的連接的東西並不快樂,但以一種不會立即終止連接的方式。

我會在您的開發機器上設置一個新的數據庫服務器(如果可能的話),儘可能消除網絡以隔離問題。

除此之外,如果不知道更多關於網絡環境和服務器配置的知識,就不會有太多的工作要弄清楚什麼是錯的。