-->
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.  [ 2 posts ] 
Author Message
 Post subject: Exception with Mapping file
PostPosted: Fri Feb 16, 2007 1:12 pm 
Newbie

Joined: Fri Feb 16, 2007 1:02 pm
Posts: 2
Table in Oracle. Iam using Hibernate with Spring. Unable to interpret the error looking at the mapping file.

Thanks

09:49:59 SQL> desc SCHEDULE;
Name Null? Type
----------------------------------------- -------- ----------------------------
PROV_ID NOT NULL VARCHAR2(128)
PROV_CLASS NOT NULL VARCHAR2(64)
TRACKNUM NOT NULL NUMBER(38)
ORIG_SCHEDULED_TIME NOT NULL DATE
SCHEDULED_TIME NOT NULL DATE
SUBMITTED_TIME NOT NULL DATE
LAST_ATTEMPT_TIME DATE
COMPLETED_TIME DATE
BATCH_MAX NOT NULL NUMBER(38)
PROCESS_METHOD NOT NULL VARCHAR2(64)
STATUS VARCHAR2(64)
MAX_ATTEMPTS NOT NULL NUMBER(38)
ATTEMPT NOT NULL NUMBER(38)
RETRY_PARAM NUMBER(24,16)
EXPEDITE_TIME DATE
DESTINATION_ID VARCHAR2(64)
CONF_NAME VARCHAR2(32)
LOCATION_ID VARCHAR2(64)


Mapping file:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
" http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd">

<hibernate-mapping>
<class name="com.fxfn.misp.domain.Schedule" table="SCHEDULE">
<id name="trackNum" type="long" column="TRACKNUM">
<generator class="sequence">
<param name="sequence">tracknum_seq</param>
</generator>
</id>/>
<property name="attempt" type="long" not-null="true" column="ATTEMPT"/>
<property name="batchMax" column="BATCH_MAX" type="long" not-null="true"/>
<property name="completedTime" column="COMPLETED_TIME" type="date"/>
<property name="confName" column="CONF_NAME" type="string"/>
<property name="destinationId" column="DESTINATION_ID" type="string"/>
<property name="expediteTime" column="EXPEDITE_TIME" type="date"/>
<property name="lastAttemptTime" column="LAST_ATTEMPT_TIME" type="date"/>
<property name="locationId" column="LOCATION_ID" type="string"/>
<property name="maxAttempts" column="MAX_ATTEMPTS" type="long" not-null="true"/>
<property name="origScheduledTime" column="ORIG_SCHEDULED_TIME" type="date" not-null="true"/>
<property name="processMethod" column="PROCESS_METHOD" type="string" not-null="true" length="64"/>
<property name="provClass" column="PROV_CLASS" type="string" not-null="true" length="64"/>
<property name="provId" column="PROV_ID" type="string" not-null="true" length="128"/>
<property name="retryParam" column="RETRY_PARAM" type="long" />
<property name="scheduledTime" column="SCHEDULED_TIME" type="date" not-null="true"/>
<property name="status" column="STATUS" type="string" length="64"/>
<property name="submittedTime" column="SUBMITTED_TIME" type="date" not-null="true"/>
</class>
</hibernate-mapping>


Error:
=====
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from invalid mapping
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from invalid mapping
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:502)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:655)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:131)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1118)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1085)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:429)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:270)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:68)
at com.fxfn.newgen.test.HibernateDbApp.main(HibernateDbApp.java:11)
Caused by: org.xml.sax.SAXParseException: The content of element type "class" must match "(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|composite-id),discriminator?,natural-id?,(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array)*,((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-insert?,sql-update?,sql-delete?,filter*,resultset*,(query|sql-query)*)".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2048)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:932)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:499)
... 15 more


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 16, 2007 4:03 pm 
Regular
Regular

Joined: Sun Sep 17, 2006 2:48 am
Posts: 81
Location: California
In your mapping file look for this line
</id>/>

I think the last "/>" is not needed.


Hope that helps.
Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.