-->
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: ShardId selectShardIdForNewObject(Object obj) fails, HELP!
PostPosted: Mon Aug 31, 2009 4:35 pm 
Newbie

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>


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.