Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NullPointerException when creating a many-to-may relationship

 
Carlos A. Perez
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi im making a many to many relationship and when i try to get a SessionFactory the following stack trace appears:

[java] Exception in thread "main" java.lang.NullPointerException
[java] at net.sf.hibernate.cfg.Configuration$1.getIdentifierType(Configuration.java:109)
[java] at net.sf.hibernate.type.ManyToOneType.getReferencedType(ManyToOneType.java:23)
[java] at net.sf.hibernate.type.ManyToOneType.getColumnSpan(ManyToOneType.java:31)
[java] at net.sf.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:192)
[java] at net.sf.hibernate.mapping.Collection.validate(Collection.java:255)
[java] at net.sf.hibernate.cfg.Configuration.validate(Configuration.java:607)
[java] at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:762)
[java] at com.oreilly.hh.QueryTest.main(QueryTest.java:49)
[java] Java Result: 1

the line 49 in com.oreilly.hh.QueryTest is:



the xmls are:





i can export the schema withouth problems
 
Adriaan Wisse
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems to me that somehow the config is null. So look if the configuration file can be found in the correct directory. Eventually start debugging and look where the config variable is initialized and where it looks for its configuration file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic