-->
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.  [ 1 post ] 
Author Message
 Post subject: Mapping Exception using InputStream
PostPosted: Thu Feb 10, 2005 7:20 am 
Newbie

Joined: Thu Feb 10, 2005 6:51 am
Posts: 2
Hi,

I'm just evaluating Hibernate at the moment, and am trying to see if I can get it to work with one of our legacy Oracle database schemas.
The problem I have is that when I try to get a SessionFactory, the following error occurs:

Code:
net.sf.hibernate.MappingException: Error reading resource: org/hibernate/auction/model/Message.hbm.xml
   at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:340)
   at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:1027)
   at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:983)
   at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:911)
   at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:897)
   at hibernate.HibernateTest1.<init>(HibernateTest1.java:24)
   at hibernate.HibernateTest1.main(HibernateTest1.java:39)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:324)
   at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
Caused by: net.sf.hibernate.MappingException: Could not interpret type: java.io.InputStream
   at net.sf.hibernate.cfg.Binder.getTypeFromXML(Binder.java:934)
   at net.sf.hibernate.cfg.Binder.bindSimpleValue(Binder.java:435)
   at net.sf.hibernate.cfg.Binder.bindComponent(Binder.java:850)
   at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:281)
   at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1256)
   at net.sf.hibernate.cfg.Configuration.add(Configuration.java:253)
   at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:289)
   at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:337)
   ... 11 more



As you can see, there is an InputStream in my mapping file. This was originally created by MiddleGen, but I modified it as it got the keys wrong. Even before I modified it, the same error was ocurring. Here's a snippet of the mapping file:
Code:
<class name="org.hibernate.auction.model.Message" table="MESSAGES">
    <id name="mpRef" column="MP_REF" type="java.lang.String" length="9">
        <generator class="assigned"/>
    </id>
    <property
            name="mpBdate"
            column="MP_BDATE"
            type="java.sql.Timestamp"
            length="7"/>

...(other properties)...

    <property
            name="mbData"
            column="MB_DATA"
            type="java.io.InputStream"/>
</class>


I have found this question asked a couple of times on this forum, but in neither case was an answer posted.
Could anybody please shed any light on this?

Thanks in advance,

Matt


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

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.