Domanda

this is my hibernate.cfg.xml file

 <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
                    destroy-method="close"
                    p:driverClass="${app.jdbc.driverClassName}"
                    p:jdbcUrl="${app.jdbc.url}"
                    p:user="${app.jdbc.username}"
                    p:password="${app.jdbc.password}"
                    p:acquireIncrement="5"
                    p:idleConnectionTestPeriod="60"
                    p:maxPoolSize="100"
                    p:maxStatements="50"
                    p:minPoolSize="10" />

        <!-- Declare a JPA entityManagerFactory-->
        <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" >
            <property name="persistenceXmlLocation" value="classpath*:persistence.xml"></property>
            <property name="persistenceUnitName" value="hibernatePersistenceUnit" />
            <property name="dataSource" ref="dataSource"/>
            <property name="jpaVendorAdapter">
                <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" >
                    <property name="showSql" value="true"/>
                </bean>
            </property>

I am getting the error:

Params:purchaseOption=webfront&purchaseOptionId=-1 Exception:org.springframework.dao.DataAccessResourceFailureException: Communications link failure> The last packet successfully received from the server was 989,906 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.; nested exception is org.hibernate.exception.JDBCConnectionException: Communications link failure

Checked many blogs , but not getting proper solution , my db is in same server . Any idea?

È stato utile?

Soluzione

I think this is due to NoRouteToHostException. That case for the network configuration state. Look this and those

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top