Joined: Thu Jan 15, 2009 7:27 pm Posts: 4 Location: Boulder, CO
|
I'm in ShardedSessionImpl, and trying to save my first instance of an object.
ShardId getShardIdOfRelatedObject(Object obj) { ClassMetadata cmd = getClassMetadata(obj.getClass()); // returns null Type[] types = cmd.getPropertyTypes(); // java.lang.NullPointerException
I'm using Hibernate 3.0 w/ annotations, and getClassMetadata returns null, and hence the subsequent command fails.
Does this have something to do w/ the fact that I'm using annotations to configure my hibernate mapping instead of a .hbm.xml file?
++++++++++
I've commented out the annotations and added the following hbm.xml file, and still get the null pointer exception:
<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping> <class name="com.companyname.Doc" table="DOC"> <cache usage="read-write"/> <id name="id" column="GUID" type="binary"/> <property name="currentVersion" column="CURRENT_VERSION" type="INT" /> <property name="publishDate" column="PUBLISH_DATE" /> <property name="extractionDate" column="EXTRACTION_DATE" /> <property name="schemaId" column="SCHEMA_ID" /> <property name="docSourceId" column="DOC_SOURCE_ID" /> <property name="authorId" column="AUTHOR_ID" /> <property name="process" column="PROCESS" /> </class> </hibernate-mapping>
|
|