!MESSAGE An internal error occurred during: "Generating Artifacts".
Caused by: java.sql.SQLException: org.logicalcobwebs.proxool.ProxoolException: Attempt to refer to a unregistered pool by its alias 'DBPool'
org.hibernate.HibernateException: Proxool Provider unable to load load Property configurator file: proxool.properties
myeclipse做hibernate反解析出错
今天在做ssh框架整合时出了这些问题.认真研究分析以后,发现myeclipse做反向生成的时候,会引用hibernate.cfg.xml配置文件来连接数据库做连接生成.但是我的配置文件是用的proxool.xml连接池来配置的.
很明显proxool.xml没有初始加载生成链接池,自然myeclipse怎么调用都会出现上面的错误了.
这个是我的配置文件:
<?xml version='1.0' encoding='UTF-8'?> <!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.show_sql">true</property> <property name="hibernate.proxool.pool_alias">DBPool</property> <property name="hibernate.proxool.properties"> proxool.properties </property> <property name="hibernate.connection.provider_class"> org.hibernate.connection.ProxoolConnectionProvider </property> <property name="hibernate.proxool.existing_pool">true</property> <property name="hibernate.cache.use_query_cache">true</property> </session-factory> </hibernate-configuration>
于是马上把配置文件改成:
<?xml version='1.0' encoding='UTF-8'?> <!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="dialect"> org.hibernate.dialect.MySQLDialect </property> <property name="myeclipse.connection.profile">mysql</property> <property name="connection.url"> jdbc:mysql://127.0.0.1:3306/webgame?characterEncoding=utf-8 </property> <property name="connection.username">root</property> <property name="connection.password">root</property> <property name="connection.driver_class"> com.mysql.jdbc.Driver </property> <property name="show_sql">true</property> <mapping resource="com/webgame/account/form/WebgameAccountIndex.hbm.xml" /> </session-factory> </hibernate-configuration>
就成功了.