我一直在尝试通过SQL Server 2008启动Tapestry和Hibernate。我在开始时遵循了tapestry和hibernate指南,但是当我到达映射部分时,我发现这个类没有找到异常,进一步抛出无法从资源异常中解析映射文档,到目前为止我找不到解决方案。 这是映射文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.example.tutorial.entities.Address.java" table="address">
<id name="id">
<column name="id"/>
<generator class="increment"/>
</id>
<property name="honorific" type="java.lang.String"/>
<property name="firstName" type="java.lang.String"/>
<property name="lastName" type="java.lang.String"/>
<property name="street1" type="java.lang.String"/>
<property name="street2" type="java.lang.String"/>
<property name="city" type="java.lang.String"/>
<property name="state" type="java.lang.String"/>
<property name="zip" type="java.lang.String"/>
<property name="email" type="java.lang.String"/>
<property name="phone" type="java.lang.Integer"/>
</class>
这是hibernate.cfg.xml:
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
<property name="hibernate.connection.url">jdbc:sqlserver://localhost/testdb;integratedSecurity=true</property>
<property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="hibernate.connection.username">not required</property>
<property name="hibernate.connection.password"></property>
<property name="hbm2ddl.auto">update</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>
<mapping resource="mappings/hibernate.hbm.xml" />
</session-factory>
这是完整的错误跟踪: https://docs.google.com/file/d/0B0_KI_Lyv76_b05WTkZxVG1XLTA/edit?usp=sharing
欢迎任何建议。