第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

在spring和Hibernate整合時(shí)為啥要出現(xiàn)一下異常

applicationContext.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" xmlns:p="http://www.springframework.org/schema/p"

xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"

xmlns:tx="http://www.springframework.org/schema/tx"

xsi:schemaLocation="http://www.springframework.org/schema/beans?

http://www.springframework.org/schema/beans/spring-beans-3.1.xsd?

http://www.springframework.org/schema/aop?

http://www.springframework.org/schema/aop/spring-aop.xsd?

http://www.springframework.org/schema/context?

http://www.springframework.org/schema/context/spring-context.xsd?

http://www.springframework.org/schema/tx?

http://www.springframework.org/schema/tx/spring-tx.xsd">

<!-- 引入外部屬性 -->

<context:property-placeholder location="classpath:jdbc.propertries" />

<!-- 配置連接池 -->

<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">

<property name="driverClass" value="${jdbc.driverClass}" />

<property name="jdbcUrl" value="${jdbc.url}" />

<property name="user" value="${jdbc.username}" />

<property name="password" value="${jdbc.password}" />

</bean>

<!--配置Hibernate相關(guān)屬性 -->

<bean id="sessionFactory"

class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">

<!-- 注入鏈接池 -->

<property name="dataSource" ref="dataSource" />

<!-- 配置Hibernate的屬性 -->

<property name="hibernateProperties">

<props value-type="String" merge="default">

<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>

<prop key="hibernate.show_sql">true</prop>

<prop key="hibernate.formal_sql">true</prop>

<prop key="hibernate.hbm2ddl.auto">update</prop>

</props>

</property>

<!-- 加載映射文件 -->

<property name="mappingResources">

<list>

<value>com/woniu/ssh/domain/product.hbm.xml</value>

</list>

</property>

</bean>

<!-- Struts和Spring整合 -->

<bean id="productAction" class="com.woniu.ssh.action.ProductAction"

scope="prototype">

<property name="ps" ref="productService" />

</bean>

<!-- 配置業(yè)務(wù)層的類 -->

<bean name="productService" class="com.woniu.ssh.service.ProductService">

<property name="dao" ref="productDao"></property>

</bean>

<bean name="productDao" class="com.woniu.ssh.dao.ProductDao"></bean>

</beans>

product.hbm.xml配置如下:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC?

? ? "-//Hibernate/Hibernate Mapping DTD 3.0//EN"

? ? "http://www.hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>

<class name="com.woniu.ssh.domain.Product" table="product">

<id name="id" colum="pid">

<gennerator class="native"/>

</id>

<property name="pname" colum="pname" length="20"/>

<property name="price" colum="price">

</class>

</hibernate-mapping>

異常信息如下:

嚴(yán)重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from input stream

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1403)

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.context.ContextLoader.createWebApplicationContext(ContextLoader.java:272)

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:196)

at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)

at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5118)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5634)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)

at java.util.concurrent.FutureTask.run(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from input stream

at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:527)

at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:677)

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)

... 21 more

Caused by: org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connect

at org.dom4j.io.SAXReader.read(SAXReader.java:484)

at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:518)

... 25 more


十二月 11, 2016 4:50:59 下午 org.apache.catalina.core.StandardContext startInternal

嚴(yán)重: One or more listeners failed to start. Full details will be found in the appropriate container log file

十二月 11, 2016 4:50:59 下午 org.apache.catalina.core.StandardContext startInternal

嚴(yán)重: Context [/SSH] startup failed due to previous errors

十二月 11, 2016 4:51:00 下午 org.apache.catalina.core.ApplicationContext log

信息: Closing Spring root WebApplicationContext


正在回答

1 回答

InputStream讀取不到配置文件

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

在spring和Hibernate整合時(shí)為啥要出現(xiàn)一下異常

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)