For some reason, I'm not able to use type "text" in my XML mapping. I get a "net.sf.hibernate.MappingException: Could not interpret type: text"
Seems like I'm missing something basic.
I'm using the Eclipse plug-in Hibernatesynch, and see this error when I first connect to the DB and it parses the XML files.
Please let me know your thoughts. Thanks in advance.
Best,
Andrew
Seattle, WA
Hibernate version:
2.1
Mapping documents:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping package="org.phatcast.db">
<class name="org.phatcast.db.Response" table="RESPONSE">
<id name="id" type="long" column="id">
<generator class="native"/>
</id>
<many-to-one
name="member"
column="MEMBER_ID"
class="org.phatcast.db.Member"
not-null="true"
/>
<many-to-one
name="challenge"
column="CHALLENGE_ID"
class="org.phatcast.db.Challenge"
not-null="true"
/>
<property name="datePosted" column="DATE_POSTED" not-null="true" type="timestamp" />
<property name="title" column="TITLE" not-null="true" type="string" />
<property name="teaserText" column="TEASER_DESC" not-null="true" type="string" />
<property name="fullText" column="FULL_DESC" not-null="true" type="text" />
<property name="license" column="LICENSE" not-null="true" type="string" />
<property name="isPublic" column="IS_PUBLIC" not-null="true" type="yes_no" />
<set name="payments" >
<key column="RESPONSE_ID" />
<one-to-many class="org.phatcast.db.Payment" />
</set>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/commons-dbcp-1.2.1.jar
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/commons-logging-1.0.4.jar
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/commons-pool-1.2.jar
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/hibernate2.jar
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/log4j-1.2.8.jar
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/xalan-2.4.0.jar
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/xerces-2.4.0.jar
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/xml-apis.jar
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/commons-logging.jar
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/jstl.jar
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/junit.jar
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/log4j-1.2.9.jar
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/spring.jar
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/standard.jar
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/servlet.jar
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/j2ee.jar
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/cglib-full-2.0.2.jar
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/db-ojb-1.0.1.jar
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/dom4j.jar
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/jta.jar
Adding Project Depedents C:/Workspace/Phatcast/war/WEB-INF/lib/mysql-connector-java-3.1.6-bin.jar
Adding Project Classpath file:/C:/Workspace/Phatcast/bin/
Adding Mapping - C:/Workspace/Phatcast/war/WEB-INF/mappings/Withdrawl.hbm.xml
Adding Mapping - C:/Workspace/Phatcast/war/WEB-INF/mappings/Response.hbm.xml
net.sf.hibernate.MappingException: Could not interpret type: text
at net.sf.hibernate.cfg.Binder.getTypeFromXML(Binder.java:788)
at net.sf.hibernate.cfg.Binder.bindValue(Binder.java:354)
at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:891)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:294)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1095)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:230)
at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java:155)
at net.sf.hibernator.HibernateConnection.createConnection(HibernateConnection.java:168)
at net.sf.hibernator.views.ConnectionView$8.run(ConnectionView.java:199)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:101)
rethrown as net.sf.hibernate.MappingException: Could not interpret type: text
at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java:159)
at net.sf.hibernator.HibernateConnection.createConnection(HibernateConnection.java:168)
at net.sf.hibernator.views.ConnectionView$8.run(ConnectionView.java:199)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:101)
Caused by: net.sf.hibernate.MappingException: Could not interpret type: text
at net.sf.hibernate.cfg.Binder.getTypeFromXML(Binder.java:788)
at net.sf.hibernate.cfg.Binder.bindValue(Binder.java:354)
at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:891)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:294)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1095)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:230)
at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java:155)
... 3 more
Name and version of the database you are using:
MySQL 4.0.21
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
|