org.hibernate.tool.ant.HibernateToolTask在那个包下面?
来源:百度知道 编辑:UC知道 时间:2024/06/07 18:11:05
使用Hibernate3和ant希望使用hbm2java功能,但是运行时总是说org.hibernate.tool.ant.HibernateToolTask cannot be found,请问应该怎么找到?
急,在线等,谢谢
急,在线等,谢谢
这个问题我已经解决!原因就是ant在当前java的classpath中找不到类Loorg.hibernate.tool.ant.HibernateToolTask, 这时候需要重新指定当前的classpath,让它包含org.hibernate.tool.ant.HibernateToolTask所属jar库或者class的路径!
我们通常都是在windows下编辑环境变量classpath,因为这个变量的值就是指定java运行时导入所需要的jar文件以及class文件的,但是,因为这里是在IDE中,所以只需配置build.xml文件就可以,有两种方式配置(通常第一种就会出现问题),
1)
<?xml version="1.0" encoding="UTF-8"?>
<project default="process" name="HibernateAndAntProject" basedir=".">
<property file="build.properties"></property>
<target name="innit">
<path id="path_id">
<pathelement path="${bin}"/>
<fileset dir="${lib}" >
<include name="**/*.jar"/>
</fil
org.hibernate.MappingException:
org.hibernate.exception.JDBCConnectionException: Cannot open connection
org.hibernate.exception.GenericJDBCException: Cannot open connection
org.hibernate.tool.ant.HibernateToolTask在那个包下面?
org.hibernate.mappingException:Could not read mappings from resource:
org.hibernate.HibernateException: Found two representations of same collection
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
异常:ERROR [org.hibernate.proxy.BasicLazyInitializer] - CGLIB Enhancement failed...
hibernate
Hibernate