java.lang.NullPointerException

Hibernate JIRA | Daniel Rosenbaum | 1 decade ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    When having a table with more than one PK, middlegen generates an xml file with elements similar to this (as well as generating a QwDataGrpVwPK class): <composite-id name="comp_id" class="testQwb.hibernate.persistent.QwDataGrpVwPK"> <meta attribute="field-description"> @hibernate.id generator-class="assigned" </meta> <!-- bi-directional many-to-one association to QwDataGrp --> <key-many-to-one name="qwDataGrp" class="testQwb.hibernate.persistent.QwDataGrp" > <column name="DATA_GRP_NUM" /> </key-many-to-one> <!-- uni-directional many-to-one association to QwVw --> <key-many-to-one name="qwVw" class="testQwb.hibernate.persistent.QwVw" > <column name="VW_NUM" /> </key-many-to-one> </composite-id> The problem is that Hibernate is choking when it sees the <meta> attribute here. If I comment out the <meta> portion then it works ok. In previous versions this also worked fine. Something about the presence of the meta tag over here messes up the parsing. The exception I get is: 16:58:13,505 ERROR Configuration:276 - Could not configure datastore from input stream java.lang.NullPointerException at net.sf.hibernate.util.StringHelper.qualify(StringHelper.java:239) at net.sf.hibernate.cfg.Binder.bindComponent(Binder.java:734) at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:263) at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1173) at net.sf.hibernate.cfg.Configuration.add(Configuration.java:245) at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:268) at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:291) at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:935) at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:890) at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:826) at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:812) at org.ifmc.qw.hibernate.HibernateSession.init(HibernateSession.java:44) Best Regards, Daniel Rosenbaum

    Hibernate JIRA | 1 decade ago | Daniel Rosenbaum
    java.lang.NullPointerException
  2. 0

    When having a table with more than one PK, middlegen generates an xml file with elements similar to this (as well as generating a QwDataGrpVwPK class): <composite-id name="comp_id" class="testQwb.hibernate.persistent.QwDataGrpVwPK"> <meta attribute="field-description"> @hibernate.id generator-class="assigned" </meta> <!-- bi-directional many-to-one association to QwDataGrp --> <key-many-to-one name="qwDataGrp" class="testQwb.hibernate.persistent.QwDataGrp" > <column name="DATA_GRP_NUM" /> </key-many-to-one> <!-- uni-directional many-to-one association to QwVw --> <key-many-to-one name="qwVw" class="testQwb.hibernate.persistent.QwVw" > <column name="VW_NUM" /> </key-many-to-one> </composite-id> The problem is that Hibernate is choking when it sees the <meta> attribute here. If I comment out the <meta> portion then it works ok. In previous versions this also worked fine. Something about the presence of the meta tag over here messes up the parsing. The exception I get is: 16:58:13,505 ERROR Configuration:276 - Could not configure datastore from input stream java.lang.NullPointerException at net.sf.hibernate.util.StringHelper.qualify(StringHelper.java:239) at net.sf.hibernate.cfg.Binder.bindComponent(Binder.java:734) at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:263) at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1173) at net.sf.hibernate.cfg.Configuration.add(Configuration.java:245) at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:268) at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:291) at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:935) at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:890) at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:826) at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:812) at org.ifmc.qw.hibernate.HibernateSession.init(HibernateSession.java:44) Best Regards, Daniel Rosenbaum

    Hibernate JIRA | 1 decade ago | Daniel Rosenbaum
    java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at net.sf.hibernate.util.StringHelper.qualify()
    2. net.sf.hibernate
      Configuration.configure
      1. net.sf.hibernate.util.StringHelper.qualify(StringHelper.java:239)
      2. net.sf.hibernate.cfg.Binder.bindComponent(Binder.java:734)
      3. net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:263)
      4. net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1173)
      5. net.sf.hibernate.cfg.Configuration.add(Configuration.java:245)
      6. net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:268)
      7. net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:291)
      8. net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:935)
      9. net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:890)
      10. net.sf.hibernate.cfg.Configuration.configure(Configuration.java:826)
      11. net.sf.hibernate.cfg.Configuration.configure(Configuration.java:812)
      11 frames
    3. org.ifmc.qw
      HibernateSession.init
      1. org.ifmc.qw.hibernate.HibernateSession.init(HibernateSession.java:44)
      1 frame