-->
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.  [ 4 posts ] 
Author Message
 Post subject: Could not interpret type: java.io.InputStream
PostPosted: Wed Aug 04, 2004 5:34 pm 
Newbie

Joined: Tue Jul 27, 2004 1:33 pm
Posts: 18
Location: South Africa
Hi all,

I get the following error when Hinbernate tries to parse my hdb.xml files.

Code:
Caused by: net.sf.hibernate.MappingException: Could not interpret type: java.io.InputStream


The mapping doc was generated via middlegen. I am accessing an MS SQL 2000 database.

Mapping file follows: (Basically I am mapping all tables in msdb to provide a monitoring tool.)


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

    http://boss.bekk.no/boss/middlegen/
    http://hibernate.sourceforge.net/
-->

<class
    name="za.co.clarkeconsulting.mssql.msdb.dataobjects.Mswebtask"
    table="mswebtasks"
>

    <composite-id>
        <key-property
            name="procname"
            column="procname"
            type="java.lang.String"
            length="128"
        />
        <key-property
            name="outputfile"
            column="outputfile"
            type="java.lang.String"
            length="255"
        />
        <key-property
            name="taskstat"
            column="taskstat"
            type="boolean"
            length="1"
        />
        <key-property
            name="wparams"
            column="wparams"
            type="java.io.InputStream"
            length="2147483647"
        />
        <key-property
            name="trigflags"
            column="trigflags"
            type="java.lang.Short"
            length="5"
        />
        <key-property
            name="taskid"
            column="taskid"
            type="java.lang.Integer"
            length="10"
        />
    </composite-id>   


    <!-- associations -->

</class>
</hibernate-mapping>


I was having the same problem with the byte[] type which middlegen autogenerated but which hibernate chocked on. I found posts saying to
convert this to binary. Version of hibernate = hibernate2.jar


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 04, 2004 6:27 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
What is the database/JDBC type it is trying to map as InputStream?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 04, 2004 8:39 pm 
Newbie

Joined: Tue Jul 27, 2004 1:33 pm
Posts: 18
Location: South Africa
Hi Steve,

Its an data-type of image.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 16, 2004 3:09 pm 
Newbie

Joined: Tue Aug 10, 2004 3:20 pm
Posts: 11
steve wrote:
What is the database/JDBC type it is trying to map as InputStream?


Steve, I am having this exact problem using middlegen and hibernate r5 plugin. This occurs when the source database is MySQL 5.0.1-alpha using mysql-connector-java-3.1.3-beta-bin.jar. The datatype of the field is longblob.

The generated hbm for this field is:

Code:
    <property
        name="thedata"
        type="java.io.InputStream"
        column="thedata"
        not-null="true"
        length="2147483647"
    />


The generated class attribute and accessors are:

Code:
    /** persistent field */
    private InputStream thedata;

    public InputStream getThedata() {
        return this.thedata;
    }

    public void setThedata(InputStream thedata) {
        this.thedata = thedata;
    }



The exception occurs when trying to use the object. I have used both hibernate versions 2.1.4 and 2.1.6.

_________________
Sincerely,
James.


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