java.lang.NullPointerException

Hibernate JIRA | Joseph Marques | 10 years ago
  1. 0

    After I create the Hibernate Console Configuration, right-click it, and select "Create Session Factory" I get: java.lang.NullPointerException at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:192) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65) at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:185) at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:106) at org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:54) at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:63) After reading the source, it seems that line 192 expects the "Property file" element on the "Main" tab of the configuration to be present. However, this does not seem to be a required field in the UI, and ideally shouldn't be required. A dummy properties object could be used if none is specified, so the rest of the block executes normally. Nevertheless, to appease the code I created a dummy properties file with nothing in it, and reconfigured the HCC. Then, I tried to reopen / recreate the session factory, but this time I got another exception: java.lang.NullPointerException at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:193) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65) at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:185) at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:106) at org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:54) at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:63) Lines 192-195 seems to imply that a dummy hibernate.transaction.manager_lookup_class will be provided if not specified in the file, but the code checks for existence with trim().length(). The javadoc for Properties reads that it will return null if the item is not found, not a zero-length string. The length() check is fine and quite reasonable, but it needs to be done after a null check.

    Hibernate JIRA | 10 years ago | Joseph Marques
    java.lang.NullPointerException
  2. 0

    After I create the Hibernate Console Configuration, right-click it, and select "Create Session Factory" I get: java.lang.NullPointerException at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:192) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65) at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:185) at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:106) at org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:54) at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:63) After reading the source, it seems that line 192 expects the "Property file" element on the "Main" tab of the configuration to be present. However, this does not seem to be a required field in the UI, and ideally shouldn't be required. A dummy properties object could be used if none is specified, so the rest of the block executes normally. Nevertheless, to appease the code I created a dummy properties file with nothing in it, and reconfigured the HCC. Then, I tried to reopen / recreate the session factory, but this time I got another exception: java.lang.NullPointerException at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:193) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65) at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:185) at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:106) at org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:54) at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:63) Lines 192-195 seems to imply that a dummy hibernate.transaction.manager_lookup_class will be provided if not specified in the file, but the code checks for existence with trim().length(). The javadoc for Properties reads that it will return null if the item is not found, not a zero-length string. The length() check is fine and quite reasonable, but it needs to be done after a null check.

    Hibernate JIRA | 10 years ago | Joseph Marques
    java.lang.NullPointerException
  3. 0

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.hibernate.console.ConsoleConfiguration$2.execute()
    2. org.hibernate.console
      ConsoleConfiguration.build
      1. org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:193)
      2. org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
      3. org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:185)
      4. org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:106)
      4 frames
    3. org.hibernate.eclipse
      ConsoleConfigurationBasedAction.run
      1. org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:54)
      2. org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:63)
      2 frames