| Author |
Message |
|
|
Post subject: A configuration object could not be built
Posted: Aug 26, 2006 - 03:38 AM
|
|

Joined: Aug 26, 2006
Posts: 1
|
|
Open HQL Editor, error as follow:
A configuration object could not be built, autocomplete and dynamic query translation will be unavailable. Query cannot be excuted.
reason:
Could not parse Configuration:
C:\workspace\HibernateDemo\src\hibernate.cfg.xml
eclipse 3.2M2
MyEclipse Enterprise Workbench
Version: 5.0.0
thanks |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Aug 26, 2006 - 06:26 PM
|
|
Moderator


Joined: Aug 21, 2004
Posts: 1297
|
|
Zhang,
1) Does the file HibernateDemo\src\hibernate.cfg.xml exist and is it valid? (Is this the HibernateDemo project from the MyEclipse documentation?)
2) There will be a stack trace in your error log when you get this exception. Can you please paste that here?
3) How do you open the HQL editor? Do you open an existing hql file or use the "Open HQL Editor" menu item? After opening the HQL editor, if you press the refresh button, what happens?
4) Are you connected to the internet when you're using the HQL editor?
Brian. |
_________________ Brian
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 06, 2006 - 09:06 AM
|
|
Registered Member


Joined: Sep 06, 2006
Posts: 1
|
|
:-)
I have the same problem
While I try to do that I'm not connected to the Internet....
Eclipse enlights some warning about the parsing of hibernate.cfg
.....help !
thank you!!! |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 28, 2006 - 09:21 PM
|
|
Registered Member


Joined: Sep 28, 2006
Posts: 8
|
|
Brian,
I too am getting this error. My hibernate.cfg.xml file does exist at that location. I am connected to the internet. To open the editor I right-click the project and select MyEclipse->Open HQL editor... See below for the stack trace. Thanks in advance for your help.
!ENTRY com.genuitec.org.hibernate.eclipse.console 4 4 2006-09-28 15:02:56.218
!MESSAGE Could not parse configuration: C:\workspace\hib\hibernate.cfg.xml
!STACK 0
org.hibernate.HibernateException: Could not parse configuration: C:\workspace\hib\hibernate.cfg.xml
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1376)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1344)
at org.hibernate.console.ConsoleConfiguration.loadConfigurationXML(ConsoleConfiguration.java:211)
at org.hibernate.console.ConsoleConfiguration.access$0(ConsoleConfiguration.java:158)
at org.hibernate.console.ConsoleConfiguration$1.execute(ConsoleConfiguration.java:134)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:115)
at com.genuitec.eclipse.hibernate.wizards.MEConsoleConfiguration.buildWith(MEConsoleConfiguration.java:120)
at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:100)
at com.genuitec.eclipse.hibernate.action.MERefreshCCAction$1.run(MERefreshCCAction.java:90)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Caused by: org.dom4j.DocumentException: Error on line 1 of document http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd : The markup declarations contained or pointed to by the document type declaration must be well-formed. Nested exception: The markup declarations contained or pointed to by the document type declaration must be well-formed.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1366)
... 10 more
!SUBENTRY 1 com.genuitec.org.hibernate.eclipse.console 4 150 2006-09-28 15:02:56.218
!MESSAGE org.dom4j.DocumentException: Error on line 1 of document http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd : The markup declarations contained or pointed to by the document type declaration must be well-formed. Nested exception: The markup declarations contained or pointed to by the document type declaration must be well-formed.
!STACK 0
org.dom4j.DocumentException: Error on line 1 of document http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd : The markup declarations contained or pointed to by the document type declaration must be well-formed. Nested exception: The markup declarations contained or pointed to by the document type declaration must be well-formed.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1366)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1344)
at org.hibernate.console.ConsoleConfiguration.loadConfigurationXML(ConsoleConfiguration.java:211)
at org.hibernate.console.ConsoleConfiguration.access$0(ConsoleConfiguration.java:158)
at org.hibernate.console.ConsoleConfiguration$1.execute(ConsoleConfiguration.java:134)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:115)
at com.genuitec.eclipse.hibernate.wizards.MEConsoleConfiguration.buildWith(MEConsoleConfiguration.java:120)
at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:100)
at com.genuitec.eclipse.hibernate.action.MERefreshCCAction$1.run(MERefreshCCAction.java:90)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Nested exception:
org.xml.sax.SAXParseException: The markup declarations contained or pointed to by the document type declaration must be well-formed.
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1366)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1344)
at org.hibernate.console.ConsoleConfiguration.loadConfigurationXML(ConsoleConfiguration.java:211)
at org.hibernate.console.ConsoleConfiguration.access$0(ConsoleConfiguration.java:158)
at org.hibernate.console.ConsoleConfiguration$1.execute(ConsoleConfiguration.java:134)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:115)
at com.genuitec.eclipse.hibernate.wizards.MEConsoleConfiguration.buildWith(MEConsoleConfiguration.java:120)
at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:100)
at com.genuitec.eclipse.hibernate.action.MERefreshCCAction$1.run(MERefreshCCAction.java:90)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
!SUBENTRY 2 com.genuitec.org.hibernate.eclipse.console 4 150 2006-09-28 15:02:56.218
!MESSAGE org.dom4j.DocumentException: Error on line 1 of document http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd : The markup declarations contained or pointed to by the document type declaration must be well-formed. Nested exception: The markup declarations contained or pointed to by the document type declaration must be well-formed.
!STACK 0
org.dom4j.DocumentException: Error on line 1 of document http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd : The markup declarations contained or pointed to by the document type declaration must be well-formed. Nested exception: The markup declarations contained or pointed to by the document type declaration must be well-formed.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1366)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1344)
at org.hibernate.console.ConsoleConfiguration.loadConfigurationXML(ConsoleConfiguration.java:211)
at org.hibernate.console.ConsoleConfiguration.access$0(ConsoleConfiguration.java:158)
at org.hibernate.console.ConsoleConfiguration$1.execute(ConsoleConfiguration.java:134)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:115)
at com.genuitec.eclipse.hibernate.wizards.MEConsoleConfiguration.buildWith(MEConsoleConfiguration.java:120)
at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:100)
at com.genuitec.eclipse.hibernate.action.MERefreshCCAction$1.run(MERefreshCCAction.java:90)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Nested exception:
org.xml.sax.SAXParseException: The markup declarations contained or pointed to by the document type declaration must be well-formed.
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1366)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1344)
at org.hibernate.console.ConsoleConfiguration.loadConfigurationXML(ConsoleConfiguration.java:211)
at org.hibernate.console.ConsoleConfiguration.access$0(ConsoleConfiguration.java:158)
at org.hibernate.console.ConsoleConfiguration$1.execute(ConsoleConfiguration.java:134)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:115)
at com.genuitec.eclipse.hibernate.wizards.MEConsoleConfiguration.buildWith(MEConsoleConfiguration.java:120)
at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:100)
at com.genuitec.eclipse.hibernate.action.MERefreshCCAction$1.run(MERefreshCCAction.java:90)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
!ENTRY com.genuitec.org.hibernate.eclipse.console 1 0 2006-09-28 15:02:56.218
!MESSAGE Could not refresh Hibernate project context com.genuitec.eclipse.hibernate.action.MERefreshCCAction$InProgressException |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 29, 2006 - 03:20 AM
|
|
Moderator


Joined: Feb 03, 2006
Posts: 1117
|
|
Please, can you send your hibernate.cfg.xml file
Thanks
Peco |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 29, 2006 - 02:30 PM
|
|
Registered Member


Joined: Sep 28, 2006
Posts: 8
|
|
Here it is. Thanks for your help.
<?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">
<!-- Generated by MyEclipse Hibernate Tools.-->
<hibernate-configuration>
<session-factory>
<property name="connection.username">hibernate</property>
<property name="connection.url">jdbc:mysql://localhost:3306/</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="myeclipse.connection.profile">hibernate</property>
<property name="connection.password">hibernate</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<mapping resource="stuff/Book.hbm.xml" />
<mapping resource="stuff/Address.hbm.xml" />
<mapping resource="stuff/PersonBook.hbm.xml" />
<mapping resource="stuff/Person.hbm.xml" />
</session-factory>
</hibernate-configuration> |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 29, 2006 - 03:48 PM
|
|
Moderator


Joined: Feb 03, 2006
Posts: 1117
|
|
Your file is correct (I suppose that driver and hbm.xml are correctly).What vesrion hibernate you use ?
Best |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 29, 2006 - 07:27 PM
|
|
Registered Member


Joined: Sep 28, 2006
Posts: 8
|
|
| Yes the JDBC driver name and the resource mappings are coreect. I'm using Hibernate 3.1 |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 30, 2006 - 12:59 AM
|
|
Moderator


Joined: Feb 03, 2006
Posts: 1117
|
|
| Do you use MyEclipse hibernate libraries ? |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 30, 2006 - 01:37 AM
|
|
Registered Member


Joined: Sep 28, 2006
Posts: 8
|
|
| Yes I am. This whole project was created in MyEclipse using the Hibernate stuff. I created the database files and generated everything else using MyEclipse. Thanks. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 30, 2006 - 01:47 AM
|
|
Moderator


Joined: Feb 03, 2006
Posts: 1117
|
|
| We can't reproduce your case.I have supposed that you have some library in project which not play fine with dom4j (hibernate use dom4j i for parsing xml).Is it possible ? |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 30, 2006 - 11:07 PM
|
|
Registered Member


Joined: Sep 28, 2006
Posts: 8
|
|
| Actually the only libray I have in this project is your Hibernate library. This is basically a test project to see if MyEclipse will work for me. I'm not using anything else at this point. Everything was generated in MyEclipse using a test database I constructed. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Oct 01, 2006 - 12:47 AM
|
|
Moderator


Joined: Feb 03, 2006
Posts: 1117
|
|
Please can you check next next :
Windows-Preferences-MyEclipse-Editors-XML-XML Catalog
Looka at nodes : -//Hibernate/Hibernate Configuration DTD 3.0//EN and remember URI
It will be like this
file:/<YOUR_MYECLIPSE_DIR>/eclipse/plugins/com.genuitec.eclipse.j2eedt.core_<YOUR_MYECLIPSE_VERSION>/catalog-dtd/hibernate-configuration-3.0.dtd
check file hibernate-configuration-3.0.dtd (size have to be 2547 bytes)
It looks that you have wrong this file or your xml catalog show to wrong location
Best
Peco |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Oct 03, 2006 - 01:17 AM
|
|
Moderator


Joined: Jan 06, 2004
Posts: 23347
|
|
qefwhy,
Was this issue resolved? |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Oct 03, 2006 - 03:24 PM
|
|

Joined: Oct 03, 2006
Posts: 51
|
|
I'm getting all of the same issues. I find another post that indicates the same problem (towards bottom of post):
<1>http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-14362.html
I am accessing the editor by right-clicking the project >> MyEclipse >> HQL Editor. It thinks about it for a long time and I get an identical error.
I'll post my config below but all of the files and references to them seem to be accurate...I've dbl-checked. Everything was generated by myEclipse including the database itself as we are testing out the tools (which have been awesome up to this point, I should say).
| Code: |
<?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">
<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>
<session-factory>
<property name="connection.username">travisp</property>
<property name="connection.url">
url blacked out for security reasons
</property>
<property name="dialect">
org.hibernate.dialect.SybaseDialect
</property>
<property name="myeclipse.connection.profile">spamis</property>
<property name="connection.password">travisp1234</property>
<property name="connection.driver_class">
com.sybase.jdbc2.jdbc.SybDriver
</property>
<mapping resource="com/label/dao/hibernate/Artist.hbm.xml" />
<mapping resource="com/label/dao/hibernate/Album.hbm.xml" />
<mapping resource="com/label/dao/hibernate/Song.hbm.xml" />
<mapping
resource="com/label/dao/hibernate/ReleaseDetail.hbm.xml" />
<mapping
resource="com/label/dao/hibernate/ArtistDetail.hbm.xml" />
<mapping
resource="com/label/dao/hibernate/FeatureDetail.hbm.xml" />
<mapping
resource="com/label/dao/hibernate/PerformanceCredit.hbm.xml" />
</session-factory>
</hibernate-configuration>
|
|
|
|
| |
|
|
|
 |
|
|