-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: XML Problem on Migrating to 3
PostPosted: Thu Nov 03, 2005 11:37 am 
Beginner
Beginner

Joined: Tue May 31, 2005 1:16 pm
Posts: 35
Location: Bogota, Colombia
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
3.0.5

Full stack trace of any exception that occurs:
INFO: Mapping class: co.com.unionsoluciones.sofia.cartera.model.bo.AmortizacionCredito -> amortizacioncredito_amc
03-Nov-2005 10:11:37 org.hibernate.util.XMLHelper$ErrorLogger error
SEVERE: Error parsing XML: XML InputStream(57) Element type "property" must be followed by either attribute specifications, ">" or "/>".
03-Nov-2005 10:11:37 org.hibernate.cfg.Configuration addInputStream
SEVERE: Could not configure datastore from input stream
org.dom4j.DocumentException: Error on line 57 of document : Element type "property" must be followed by either attribute specifications, ">" or "/>". Nested exception: Element type "property" must be followed by either attribute specifications, ">" or "/>".
at org.dom4j.io.SAXReader.read(SAXReader.java:355)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:398)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:631)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1058)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:318)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:81)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:66)
at co.com.unionsoluciones.sofia.cartera.utils.SpringTestSofia.setUp(SpringTestSofia.java:38)
at co.com.unionsoluciones.sofia.cartera.model.TestDaos.setUp(TestDaos.java:65)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)


Name and version of the database you are using:
MS SQL


I am trying to migrato to version 3.0.5, from version 2. I have followed each step in "http://www.hibernate.org/250.html". However, this error appears....I have double-checked my xml files, and they were working fine with version 2. I used this ant task to change the xml files:

<replace dir="${build.hibernate.dir}" value="&lt;hibernate-
mapping default-lazy=&quot;false&quot; &gt;">
<include name="**/*.hbm.xml"/>
<replacetoken><![CDATA[<hibernate-mapping>]]></replacetoken>
</replace>
<replace dir="${build.hibernate.dir}" value="Hibernate Mapping
DTD 3.0">
<include name="**/*.hbm.xml"/>
<replacetoken>Hibernate Mapping DTD 2.0</replacetoken>
</replace>
<replace dir="${build.hibernate.dir}" value="hibernate-mapping-
3.0.dtd">
<include name="**/*.hbm.xml"/>
<replacetoken>hibernate-mapping-2.0.dtd</replacetoken>
</replace>

Is this a known issue, or any clues where to find the solution for this.....


Thanks a lot.


Julian

_________________
Julian Garcia


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 03, 2005 11:44 am 
Senior
Senior

Joined: Thu Aug 04, 2005 4:54 am
Posts: 153
Location: Birmingham, UK
Post the file that is actually failing in that stack trace so people can see what it looks like and possibly diagnose an error.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 03, 2005 11:50 am 
Beginner
Beginner

Joined: Tue May 31, 2005 1:16 pm
Posts: 35
Location: Bogota, Colombia
The mapping file corresponding to the last class shown as being mapped in the test looks like:

Code:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
   
<hibernate-mapping>
<!--
    Created by the Middlegen Hibernate plugin 2.1

    http://boss.bekk.no/boss/middlegen/
    http://www.hibernate.org/
-->

<class
    name="co.com.unionsoluciones.sofia.cartera.model.bo.AmortizacionCredito"
    table="amortizacioncredito_amc"
    select-before-update="true"
>
    <meta attribute="extends" inherit="false">co.com.unionsoluciones.sofia.cartera.model.bo.base.BaseBO</meta>
    <meta attribute="implement-equals" inherit="false">true</meta>

    <id
        name="llave"
        type="java.lang.Integer"
        column="namc_llave"
    >
        <generator class="assigned" />
    </id>

    <property
        name="numeroCuota"
        type="java.lang.Integer"
        column="namc_numerocuota"
        length="2"
    />
    <property
        name="vencimiento"
        type="java.sql.Timestamp"
        column="damc_vencimiento"
        length="23"
    />
    <property
        name="saldoInicial"
        type="java.math.BigDecimal"
        column="namc_saldoinicial"
        length="16"
    />
    <property
        name="valorCuota"
        type="java.math.BigDecimal"
        column="namc_valorcuota"
        length="16"
    />
    <property
        name="abonoCapital"
        type="java.math.BigDecimal"
        column="namc_abonocapital"
        length="16"
    />
    <property
        name="interes"
        type="java.math.BigDecimal"
        column="namc_interes"
        length="16"
    />
    <property
        name="seguro"
        type="java.math.BigDecimal"
        column="namc_seguro"
        length="16"
    />

    <!-- Associations -->
 
    <!-- bi-directional many-to-one association to Credito -->
    <many-to-one
        name="credito"
        class="co.com.unionsoluciones.sofia.cartera.model.bo.Credito"
        not-null="true"
    >
        <column name="namc_numerocredito" />
    </many-to-one>

</class>
</hibernate-mapping>



Thanks for any help.

_________________
Julian Garcia


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 03, 2005 12:12 pm 
Senior
Senior

Joined: Thu Aug 04, 2005 4:54 am
Posts: 153
Location: Birmingham, UK
I can't see anything wrong but I have this really strong feeling that somewhere around line 57 is some whitespace or odd character that's killing the parser.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 03, 2005 12:18 pm 
Beginner
Beginner

Joined: Tue May 31, 2005 1:16 pm
Posts: 35
Location: Bogota, Colombia
Hi, just trying to find out where the problem is, I deleted completely the property that appears to throw the error (line 57). The error message is however the same.

This kinda make me doubt that this is the class causing the problem. However, as I mentioned, this is the last class that I can see as being mapped in my Junit console.

Any ideas?

Thanks for your help.

Julian

_________________
Julian Garcia


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 03, 2005 5:41 pm 
Beginner
Beginner

Joined: Tue May 31, 2005 1:16 pm
Posts: 35
Location: Bogota, Colombia
This was a silly problem due to a typo in one of my mapping files. No I have migrated succesfully....thanks for help.

Unfortunately SAX exception does not help much on identifying where the problem is.

Julian

_________________
Julian Garcia


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.