Hi,
I've been searching the forum for any info regarding the problem I'm experiencing, without success.
It as something to do with java.io.InputStream (blob). Please, take a look at the included info and tell me what you know about this issue. Let me know if you need more info.
Thx in advance.
Hibernate version:
2.1
Mapping documents:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.datasource">java:comp/env/jdbc/sshrc</property>
<property name="show_sql">true</property>
<property name="dialect">net.sf.hibernate.dialect.SybaseDialect</property>
<property name="jdbc.batch_size">5</property>
<property name="jdbc.use_scrollable_resultset">true</property>
<property name="cache.provider_class">org.apache.jcs.JCS</property>
<!-- Mapping files -->
<mapping resource="hibernate/Form.hbm.xml"/>
<mapping resource="hibernate/Application.hbm.xml"/>
<mapping resource="hibernate/AmisApplicationXref.hbm.xml"/>
<mapping resource="hibernate/AmisCod.hbm.xml"/>
<mapping resource="hibernate/ApplAssessment.hbm.xml"/>
<mapping resource="hibernate/ApplCommittee.hbm.xml"/>
<mapping resource="hibernate/ApplExpertise.hbm.xml"/>
<mapping resource="hibernate/ApplFineartsSupport.hbm.xml"/>
<mapping resource="hibernate/ApplFundingSummary.hbm.xml"/>
<mapping resource="hibernate/ApplIneThem.hbm.xml"/>
<mapping resource="hibernate/ApplParticipation.hbm.xml"/>
<mapping resource="hibernate/ApplPartSecurity.hbm.xml"/>
<mapping resource="hibernate/ApplPreScreening.hbm.xml"/>
<mapping resource="hibernate/ApplProposedExpenditure.hbm.xml"/>
<mapping resource="hibernate/ApplProposedTimeStipend.hbm.xml"/>
<mapping resource="hibernate/ApplReferee.hbm.xml"/>
<mapping resource="hibernate/ApplRelevance.hbm.xml"/>
<mapping resource="hibernate/ApplStatu.hbm.xml"/>
<mapping resource="hibernate/ApplStatusHistory.hbm.xml"/>
<mapping resource="hibernate/ApplSupport.hbm.xml"/>
<mapping resource="hibernate/ApplSurvey.hbm.xml"/>
<mapping resource="hibernate/Attachment.hbm.xml"/>
<mapping resource="hibernate/AwardStatement.hbm.xml"/>
<mapping resource="hibernate/BudgetItem.hbm.xml"/>
<mapping resource="hibernate/CidConcordance.hbm.xml"/>
<mapping resource="hibernate/Cod.hbm.xml"/>
<mapping resource="hibernate/CodesCategory.hbm.xml"/>
<mapping resource="hibernate/CodesCategoryGroup.hbm.xml"/>
<mapping resource="hibernate/CodesTabl.hbm.xml"/>
<mapping resource="hibernate/Committee.hbm.xml"/>
<mapping resource="hibernate/CommitteeNomine.hbm.xml"/>
<mapping resource="hibernate/Country.hbm.xml"/>
<mapping resource="hibernate/DataEntryExpXref.hbm.xml"/>
<mapping resource="hibernate/Discipline.hbm.xml"/>
<mapping resource="hibernate/EnvironmentalImpact.hbm.xml"/>
<mapping resource="hibernate/FinalApplication.hbm.xml"/>
<mapping resource="hibernate/FrrComment.hbm.xml"/>
<mapping resource="hibernate/FrrContribution.hbm.xml"/>
<mapping resource="hibernate/FrrFinding.hbm.xml"/>
<mapping resource="hibernate/FrrImpact.hbm.xml"/>
<mapping resource="hibernate/FrrPartnerContrib.hbm.xml"/>
<mapping resource="hibernate/FrrStat.hbm.xml"/>
<mapping resource="hibernate/FundingOrg.hbm.xml"/>
<mapping resource="hibernate/IndirectCostOutcome.hbm.xml"/>
<mapping resource="hibernate/MainDiscipline.hbm.xml"/>
<mapping resource="hibernate/Message.hbm.xml"/>
<mapping resource="hibernate/OrganizationBase.hbm.xml"/>
<mapping resource="hibernate/OrgDeptLocation.hbm.xml"/>
<mapping resource="hibernate/Person.hbm.xml"/>
<mapping resource="hibernate/PersonAcademicBackground.hbm.xml"/>
<mapping resource="hibernate/PersonAcademicBackPrint.hbm.xml"/>
<mapping resource="hibernate/PersonContribution.hbm.xml"/>
<mapping resource="hibernate/PersonDistinction.hbm.xml"/>
<mapping resource="hibernate/PersonExpertise.hbm.xml"/>
<mapping resource="hibernate/PersonExtContributor.hbm.xml"/>
<mapping resource="hibernate/PersonExtParticipant.hbm.xml"/>
<mapping resource="hibernate/PersonExtSupportUser.hbm.xml"/>
<mapping resource="hibernate/PersonInterruption.hbm.xml"/>
<mapping resource="hibernate/PersonNot.hbm.xml"/>
<mapping resource="hibernate/PersonPosition.hbm.xml"/>
<mapping resource="hibernate/PersonPositionPrint.hbm.xml"/>
<mapping resource="hibernate/PersonResearchSupport.hbm.xml"/>
<mapping resource="hibernate/PersonStudentsTrained.hbm.xml"/>
<mapping resource="hibernate/Program.hbm.xml"/>
<mapping resource="hibernate/ProgCommittee.hbm.xml"/>
<mapping resource="hibernate/ProgGpScheduleFellowship.hbm.xml"/>
<mapping resource="hibernate/ProgGrantType.hbm.xml"/>
<mapping resource="hibernate/ProvinceState.hbm.xml"/>
<mapping resource="hibernate/PersonAddress.hbm.xml"/>
<mapping resource="hibernate/RdcCommitteeMember.hbm.xml"/>
<mapping resource="hibernate/ScholarshipApplication.hbm.xml"/>
<mapping resource="hibernate/SecurityRole.hbm.xml"/>
<mapping resource="hibernate/SoaExpXref.hbm.xml"/>
<mapping resource="hibernate/SystemParameter.hbm.xml"/>
<mapping resource="hibernate/SystemProperty.hbm.xml"/>
<mapping resource="hibernate/SecurityProfile.hbm.xml"/>
<mapping resource="hibernate/UserSession.hbm.xml"/>
<mapping resource="hibernate/UserSessionHistory.hbm.xml"/>
<mapping resource="hibernate/UserSessionTemp.hbm.xml"/>
<mapping resource="hibernate/WebModul.hbm.xml"/>
<mapping resource="hibernate/WebOrganization.hbm.xml"/>
<mapping resource="hibernate/WebSubsystem.hbm.xml"/>
<mapping resource="hibernate/WebSubsystemCrossref.hbm.xml"/>
<mapping resource="hibernate/WebUser.hbm.xml"/>
<mapping resource="hibernate/AvoidDbTrig.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
net.sf.hibernate.MappingException: Could not interpret type: java.io.InputStream
at net.sf.hibernate.cfg.Binder.getTypeFromXML(Binder.java:923)
at net.sf.hibernate.cfg.Binder.bindSimpleValue(Binder.java:424)
at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:1036)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:361)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:285)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:333)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:990)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:946)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:874)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:860)
at system.HibernateUtil.<clinit>(HibernateUtil.java:16)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:903)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3421)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3609)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
at org.apache.catalina.core.StandardService.start(StandardService.java:497)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
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 org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
ERROR [main] (HibernateUtil.java:18) - Initial HibernateUtil SessionFactory creation failed.
net.sf.hibernate.MappingException: Error reading resource: hibernate/Attachment.hbm.xml
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:336)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:990)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:946)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:874)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:860)
at system.HibernateUtil.<clinit>(HibernateUtil.java:16)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:903)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3421)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3609)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
at org.apache.catalina.core.StandardService.start(StandardService.java:497)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
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 org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Caused by: net.sf.hibernate.MappingException: Could not interpret type: java.io.InputStream
at net.sf.hibernate.cfg.Binder.getTypeFromXML(Binder.java:923)
at net.sf.hibernate.cfg.Binder.bindSimpleValue(Binder.java:424)
at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:1036)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:361)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:285)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:333)
... 29 more
Name and version of the database you are using:
Sybase Adaptive Server Enterprise 12.5
JDBC2 - JConn2.Jar
Debug level Hibernate log excerpt:
INFO [main] (Binder.java:229) - Mapping class: hibernate.Attachment -> ATTACHMENTS
ERROR [main] (Configuration.java:252) - Could not compile the mapping document
Mapping documents for ATTACHMENT:
<?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="hibernate.Attachment"
table="ATTACHMENTS"
>
<id
name="applId"
type="java.lang.Integer"
column="Appl_ID"
>
<generator class="assigned" />
</id>
<property
name="fileType"
type="java.lang.String"
column="File_type"
length="3"
/>
<property
name="attachmentFile"
type="java.io.InputStream"
column="Attachment_file"
length="2147483647"
/>
<property
name="createUserId"
type="java.lang.String"
column="Create_User_ID"
length="3"
/>
<property
name="createDate"
type="java.sql.Timestamp"
column="Create_Date"
length="23"
/>
<property
name="changeUserId"
type="java.lang.String"
column="Change_User_ID"
length="3"
/>
<property
name="changeDate"
type="java.sql.Timestamp"
column="Change_Date"
length="23"
/>
<!-- associations -->
</class>
</hibernate-mapping>