-->
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.  [ 3 posts ] 
Author Message
 Post subject: NullPointerException
PostPosted: Thu Oct 02, 2003 6:10 pm 
Newbie

Joined: Thu Oct 02, 2003 5:50 pm
Posts: 1
I am trying to load the folowing XML

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

<hibernate-mapping>
<class name="Department" table="DEPARTMENT">
<id name="did" column="DID">
<generator class="assigned"/>
</id>
<property name="city" column="CITY"/>
<property name="name" column="NAME"/>
<property name="state" column="STATE"/>
<set name="employees" table="EMPLOYEE">
<key column="did"/>
<one-to-many class="Employee"/>
</set>
</class>
</hibernate-mapping>
<!-- parsed in 0ms -->

using the code

Datastore ds = Hibernate.createDatastore();
ds.storeClass(Department.class);

and getting the exception

[ERROR] DatastoreImpl - -Could not configure datastore from input stream <java.lang.NullPointerException>
java.lang.NullPointerException
at cirrus.hibernate.map.Collection.<init>(Collection.java:71)
at cirrus.hibernate.map.Set.<init>(Set.java:26)
at cirrus.hibernate.map.Root$2.create(Root.java:62)
at cirrus.hibernate.map.PersistentClass.propertiesFromXML(PersistentClass.java:71)
at cirrus.hibernate.map.RootClass.<init>(RootClass.java:227)
at cirrus.hibernate.map.Root.<init>(Root.java:135)
at cirrus.hibernate.impl.DatastoreImpl.store(DatastoreImpl.java:106)
at cirrus.hibernate.impl.DatastoreImpl.storeInputStream(DatastoreImpl.java:116)
at cirrus.hibernate.impl.DatastoreImpl.storeClass(DatastoreImpl.java:140)
at JDOTester.<clinit>(JDOTester.java:27)
rethrown as cirrus.hibernate.MappingException
at cirrus.hibernate.impl.DatastoreImpl.storeInputStream(DatastoreImpl.java:124)
at cirrus.hibernate.impl.DatastoreImpl.storeClass(DatastoreImpl.java:140)
at JDOTester.<clinit>(JDOTester.java:27)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 28, 2006 8:04 am 
Newbie

Joined: Thu Apr 27, 2006 9:56 am
Posts: 14
Location: Hyderabad
define property for dataStore in ur xml file. This helps your program to trace down which dataStore to be used


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 28, 2006 9:14 am 
Beginner
Beginner

Joined: Mon Mar 27, 2006 5:25 am
Posts: 39
Location: India Hyderabad
Datastore ds = Hibernate.createDatastore();
ds.storeClass(Department.class);
I never seen the method createDataStore()??


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