org.dom4j.DocumentException: www.hibernate.org Nested exception: www.hiberna
来源:互联网 发布:手机怎么淘宝秒杀 编辑:程序博客网 时间:2024/05/20 21:58
在使用Ant建表和初始化数据库时出现一个问题org.dom4j.DocumentException: www.hibernate.org Nested exception: www.hiberna
build.xml文件
<?xml version="1.0" encoding="UTF-8"?><!--Copyright 2009 AsiaSoft. All rights reserved.Creation date: 2009-06-12Author: Alex Zhang--><project name="ecrmYM" default="all" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant"><!-- ===================== Global Property Definitions =========================== --><property file="ivy.properties" /><property file="build.properties" /><property environment="env"/><property name="jdk.home" value="${env.JAVA_HOME}" /><property name="tomcat.home" value="${env.TOMCAT_HOME}" /><property name="src.home" value="${basedir}/${src.home}" /><property name="lib.home" value="${basedir}/${lib.home}" /><property name="res.home" value="${basedir}/${res.home}" /><property name="web.home" value="${basedir}/${web.home}" /><property name="docs.home" value="${basedir}/${docs.home}" /><property name="build.home" value="${basedir}/${build.home}" /><property name="dist.home" value="${basedir}/${dist.home}" /><property name="test.home" value="${basedir}/${test.home}" /><property name="src.java.dir" value="${src.home}/java" /> <property name="res.conf.dir" value="${res.home}/conf" /> <property name="res.i18n.dir" value="${res.home}/i18n" /><property name="res.sql.dir" value="${res.home}/sql" /> <property name="res.make.dir" value="${res.home}/make" /><property name="build.classes.dir" value="${build.home}/classes" /><property name="build.lib.dir" value="${build.home}/lib" /><property name="build.sql.dir" value="${build.home}/sql" /><property name="build.docs.dir" value="${build.home}/docs" /> <property name="docs.style.dir" value="${docs.home}/style" /><property name="test.java.dir" value="${test.home}/java" /><property name="test.classes.dir" value="${test.home}/classes" /> <property name="test.output.dir" value="${test.home}/output" /> <property name="test.reports.dir" value="${test.home}/reports" /><!-- ==================== Compilation Control Options ====================These properties control option settings on the Javac compiler when itis invoked using the <javac> task.compile.debug Should compilation include the debug option?compile.deprecation Should compilation include the deprecation option?compile.optimize Should compilation include the optimize option?compile.encoding Define the encoding which the compilation should use.--><property name="compile.debug" value="true"/><property name="compile.deprecation" value="true"/><property name="compile.optimize" value="true"/><property name="compile.encoding" value="UTF-8"/><!-- ===================== Compilation Classpath =========================== --><path id="classpath"> <pathelement location="${jdk.home}/lib/dt.jar"/> <pathelement location="${jdk.home}/lib/tools.jar"/> <fileset dir="${tomcat.home}"> <include name="lib/**/*.jar"/></fileset><fileset dir="${lib.home}"><include name="**/*.jar"/></fileset><pathelement location="${build.classes.dir}"/><pathelement location="${res.conf.dir}"/><pathelement location="${res.home}"/><pathelement location="${res.conf.dir}/jbpm"/></path><!-- ===================== Build Targets below here =========================== --> <target name="export-dbschema"> <echo message="Generating the appropriate SQL DDL... Store the result in a file or export it directly to the database." /> <echo message="${build.home}" /> <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask"> <classpath refid="classpath" /> </taskdef> <taskdef name="annotationconfiguration" classname="org.hibernate.tool.ant.AnnotationConfigurationTask"> <classpath refid="classpath" /> </taskdef> <delete dir="${build.sql.dir}" /> <delete dir="${build.docs.dir}/dbschema" /> <mkdir dir="${build.sql.dir}" /> <mkdir dir="${build.docs.dir}/dbschema" /> <hibernatetool destdir="${build.sql.dir}"> <classpath refid="classpath" /> <annotationconfiguration configurationfile="${basedir}/res/conf/hibernate/hibernate.cfg.xml" /> <hbm2ddl export="true" update="false" drop="true" create="true" delimiter=";" outputfilename="db_table_schema.sql" format="true" haltonerror="false"> </hbm2ddl> <hbm2doc destdir="${build.docs.dir}/dbschema" /> </hibernatetool> </target> <!-- For MySQL --><target name="initialize-database" depends="export-dbschema"> <echo message="Initializing database... If error occurs,let it be." /> <sql driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/ecrm_ym" userid="root" password="root" src="${res.sql.dir}/database_init.sql" encoding="UTF-8" onerror="continue"> <classpath refid="classpath"/> </sql> </target><target name="initialize-database-datadictionary" depends="export-dbschema"><echo message="Initializing Data Dictionary" /><sqldriver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/ecrm_ym" userid="root" password="root" src="${res.sql.dir}/database_data_dictionary_init.sql" encoding="UTF-8" onerror="continue"><classpath refid="classpath"/></sql></target><target name="all" depends="initialize-database,initialize-database-datadictionary" description="execute the all targets"/></project>
hibernate.cfg.xml文件
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"><hibernate-configuration><session-factory><!-- Database connection settings ** MySQL --><property name="connection.driver_class">com.mysql.jdbc.Driver</property><property name="connection.url">jdbc:mysql://localhost:3306/ecrm_ym</property><property name="connection.username">root</property><property name="connection.password">root</property><property name="hbm2ddl.auto">create</property><!-- Database connection settings ** Oracle <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property> <property name="connection.url">jdbc:oracle:thin:@localhost:1521:xe</property> <property name="connection.username">ecrm</property> <property name="connection.password">ecrm</property> --><!-- SQL dialect --><property name="dialect">org.hibernate.dialect.MySQL5Dialect</property><!--<property name="dialect">org.hibernate.dialect.OracleDialect</property> --><!-- <mapping package="ym.ecrm.core.domain"/> --><mapping class="ym.ecrm.core.domain.systemManagement.User" /><mapping class="ym.ecrm.core.domain.systemManagement.Role" /><mapping class="ym.ecrm.core.domain.systemManagement.Resource" /><mapping class="ym.ecrm.core.domain.systemManagement.Organization" /><mapping class="ym.ecrm.core.domain.systemManagement.EMailTemplate" /><mapping class="ym.ecrm.core.domain.systemManagement.DataDictionary" /><mapping class="ym.ecrm.core.domain.serviceManagement.Feedback" /><mapping class="ym.ecrm.core.domain.serviceManagement.QA" /><mapping class="ym.ecrm.core.domain.salesManagement.Contract" /><mapping class="ym.ecrm.core.domain.salesManagement.Opportunity" /><mapping class="ym.ecrm.core.domain.salesManagement.OpportunityTrack" /><mapping class="ym.ecrm.core.domain.productManagement.Production" /><mapping class="ym.ecrm.core.domain.orderManagement.SaleOrder" /><mapping class="ym.ecrm.core.domain.orderManagement.SaleOrderDetail" /><mapping class="ym.ecrm.core.domain.marketPlanManagement.MarketActivity" /><mapping class="ym.ecrm.core.domain.marketPlanManagement.MarketPlan" /><mapping class="ym.ecrm.core.domain.marketManagement.IndustryPolicy" /><mapping class="ym.ecrm.core.domain.marketManagement.DynamicMsn" /><mapping class="ym.ecrm.core.domain.marketManagement.MarketingIntelligence" /><mapping class="ym.ecrm.core.domain.marketManagement.MarketResearch" /><mapping class="ym.ecrm.core.domain.marketManagement.SaleClues" /><mapping class="ym.ecrm.core.domain.customerManagement.Contacter" /><mapping class="ym.ecrm.core.domain.customerManagement.Customer" /><mapping class="ym.ecrm.core.domain.customerManagement.Pcustomer" /><mapping class="ym.ecrm.core.domain.financialManagement.AccountsPayable" /><mapping class="ym.ecrm.core.domain.financialManagement.AccountsReceivable" /><mapping class="ym.ecrm.core.domain.financialManagement.CollectionBill" /><mapping class="ym.ecrm.core.domain.financialManagement.Collections" /><mapping class="ym.ecrm.core.domain.financialManagement.Expense" /><mapping class="ym.ecrm.core.domain.financialManagement.Payments" /><mapping class="ym.ecrm.core.domain.financialManagement.PaymentVoucher" /></session-factory></hibernate-configuration>
后来我把 <hbm2doc destdir="${build.docs.dir}/dbschema" />注释了<!-- <hbm2doc destdir="${build.docs.dir}/dbschema" />-->就可以运行了。
然后我再把<hbm2doc destdir="${build.docs.dir}/dbschema" />这句还原,看看是不是这个语句的问题,可是这次尽然没有报
org.dom4j.DocumentException: www.hibernate.org Nested exception: www.hiberna
这个错误,不解啊,是Eclipse工具的问题吗?还是其它问题,求高手指点。
- org.dom4j.DocumentException: www.hibernate.org Nested exception: www.hiberna
- org.dom4j.DocumentException: www.apple.com Nested exception: www.apple.com
- org.dom4j.DocumentException: null Nested exception: null
- org.dom4j.DocumentException: null Nested exception: null
- org.dom4j.DocumentException: null Nested exception: null
- appfuse异常 org.hibernate.MappingException: org.dom4j.DocumentException: hibernate.sourceforge.net Nested exception: hibernate.sou
- Dom4j (org.dom4j.DocumentException: c Nested exception: c.)
- Dom4j (org.dom4j.DocumentException: c Nested exception: c.)(转载)
- Hibernate 项目启动加载很慢,不联网时启动不了,还报异常Caused by: org.dom4j.DocumentException: www.hibernate.org Nested exc
- hibernate的org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection
- org.dom4j.DocumentException: Connection timed out: connect Nested exception
- org.dom4j.DocumentException: Connection timed out: connect Nested exception:
- org.dom4j.DocumentException: null Nested exception: null解决方法
- org.dom4j.DocumentException: null Nested exception: null解决
- dom4j 读取文件异常 org.dom4j.DocumentException: Read timed out Nested exception: Read timed out
- org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: c
- org.dom4j.DocumentException: Software caused connection abort: recv failed Nested exception:
- org.dom4j.DocumentException: Software caused connection abort: recv failed Nested exception: .
- HDU1556 color the ball【树状数组】解题报告
- struts + spring + dwr + ibatis 架构 最精简的jar包选择(转)
- 飞鸽传书2011帮助文档
- MySQL--binlog日志恢复数据
- HDU 1599 find the mincost route
- org.dom4j.DocumentException: www.hibernate.org Nested exception: www.hiberna
- 数据库设计三大范式
- 常用的排序算法的时间复杂度和空间复杂度
- iOS应用日志:开始编写日志组件与异常日志
- 表格格式命令轻松实现隔行...
- SQL多行转一转解决方案
- 配置Linux做网关
- 【小蒙淘金】4月8日-金评
- 代码中特殊的注释