Generating Artifacts错误的解决办法

今天尝试反向从myeclipse database explorer 生成pojo和.hbm.xml的时候出现这么一个错误:“Generating Artifacts

 

org.hibernate.HibernateException: Proxool Provider unable to load JAXP configurator file: proxool_mysql.xml
 at org.hibernate.connection.ProxoolConnectionProvider.configure(ProxoolConnectionProvider.java:125)
 at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
 at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
 at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:414)
 at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
 at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2005)
 at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration.readFromJDBC(MEJDBCMetaDataConfiguration.java:72)
 at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$7.execute(GenerateArtifactsJob.java:891)
 at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:64)
 at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:95)
 at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.buildConfiguration(GenerateArtifactsJob.java:872)
 at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:412)
 at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.logicalcobwebs.proxool.ProxoolException: Parsing failed.
 at org.logicalcobwebs.proxool.configuration.JAXPConfigurator.configure(JAXPConfigurator.java:91)
 at org.logicalcobwebs.proxool.configuration.JAXPConfigurator.configure(JAXPConfigurator.java:107)
 at org.hibernate.connection.ProxoolConnectionProvider.configure(ProxoolConnectionProvider.java:120)
 ... 12 more
Caused by: org.logicalcobwebs.proxool.ProxoolException: Couldn't load class com.mysql.jdbc.Driver
 at org.logicalcobwebs.proxool.configuration.XMLConfigurator.endElement(XMLConfigurator.java:198)
 at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
 at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
 at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
 at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
 at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
 at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
 at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
 at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
 at org.logicalcobwebs.proxool.configuration.JAXPConfigurator.configure(JAXPConfigurator.java:87)
 ... 14 more

 

凭借我多年的经验,这个问题是出在找不到驱动上面。于是在环境变量上找寻,但是检查了很久没有发现问题。

最后解决办法:

找到workspace下面的 .myhibernatedata 这个文件,打开它,然后找到configFile,将路径改为hibernate连接数据库的配置文件路径,问题解决!

reSettingsFile=/siliao/hibernate.reveng.xml
configFile=/siliao/cfg/proxool_mysql.xml
createConfigFile=false
addLibs2Classpath=true
baseDaoClass=BaseHibernateDAO
s

你可能感兴趣的:(Generating Artifacts错误的解决办法)