facebook

A configuration object could not be built

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 15 posts - 1 through 15 (of 62 total)
  • Author
    Posts
  • #257650 Reply

    zhangxin69
    Member

    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

    #257674 Reply

    Brian Fernandes
    Moderator

    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.

    #258164 Reply

    korovev
    Member

    🙂

    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!!!

    #259508 Reply

    gefwhy@gmail.com
    Participant

    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

    #259528 Reply

    Haris Peco
    Member

    Please, can you send your hibernate.cfg.xml file

    Thanks
    Peco

    #259543 Reply

    gefwhy@gmail.com
    Participant

    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”&gt;
    <!– 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>

    #259549 Reply

    Haris Peco
    Member

    Your file is correct (I suppose that driver and hbm.xml are correctly).What vesrion hibernate you use ?

    Best

    #259582 Reply

    gefwhy@gmail.com
    Participant

    Yes the JDBC driver name and the resource mappings are coreect. I’m using Hibernate 3.1

    #259611 Reply

    Haris Peco
    Member

    Do you use MyEclipse hibernate libraries ?

    #259614 Reply

    gefwhy@gmail.com
    Participant

    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.

    #259616 Reply

    Haris Peco
    Member

    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 ?

    #259630 Reply

    gefwhy@gmail.com
    Participant

    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.

    #259631 Reply

    Haris Peco
    Member

    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

    #259735 Reply

    Riyad Kalla
    Member

    qefwhy,
    Was this issue resolved?

    #259778 Reply

    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&gt;

    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).

    
    <?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>
    
Viewing 15 posts - 1 through 15 (of 62 total)
Reply To: A configuration object could not be built

You must be logged in to post in the forum log in