java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • For the case where no --config arg is specified in the invocation of CodeGenerator.main (i.e. calling the Hbm2JavaTask with no value for the "config" attribute), BasicRenderer fails at the point where it calls isPropertySet("generate-concrete-empty-classes") since the "properties" member is null. Stack Trace: java.lang.NullPointerException at net.sf.hibernate.tool.hbm2java.BasicRenderer.isPropertySet(BasicRenderer.java:611) at net.sf.hibernate.tool.hbm2java.BasicRenderer.generateConcreteEmptyClasses(BasicRenderer.java:332) at net.sf.hibernate.tool.hbm2java.BasicRenderer.render(BasicRenderer.java:59) at net.sf.hibernate.tool.hbm2java.Generator.write(Generator.java:138) at net.sf.hibernate.tool.hbm2java.Generator.writeRecur(Generator.java:115) at net.sf.hibernate.tool.hbm2java.Generator.generate(Generator.java:104) at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:125) at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145) at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95) at org.apache.tools.ant.Task.perform(Task.java:341) at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:232) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233) at org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:88) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135) at org.apache.commons.jelly.impl.DynamicTag.doTag(DynamicTag.java:125) at org.apache.commons.jelly.impl.StaticTagScript.run(StaticTagScript.java:145) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233) at com.werken.werkz.jelly.GoalTag$1.performAction(GoalTag.java:128) at com.werken.werkz.Goal.fire(Goal.java:639) at com.werken.werkz.Goal.attain(Goal.java:575) at com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193) at com.werken.werkz.jelly.AttainGoalTag.doTag(AttainGoalTag.java:134) at org.apache.maven.jelly.tags.werkz.LazyAttainGoalTag.doTag(LazyAttainGoalTag.java:107) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233) at com.werken.werkz.jelly.PreGoalTag$1.firePreGoal(PreGoalTag.java:87) at com.werken.werkz.Goal.firePreGoalCallbacks(Goal.java:691) at com.werken.werkz.Goal.fire(Goal.java:616) at com.werken.werkz.Goal.attain(Goal.java:575) at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:448) at org.apache.maven.MavenSession.attainGoals(MavenSession.java:348) at org.apache.maven.cli.App.doMain(App.java:543) at org.apache.maven.cli.App.main(App.java:1109) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) I've applied a simple patch to my local copy that seems to work. Index: Generator.java =================================================================== RCS file: /cvsroot/hibernate/HibernateExt/tools/src/java/net/sf/hibernate/tool/hbm2java/Generator.java,v retrieving revision 1.3 diff -u -r1.3 Generator.java --- Generator.java 29 Mar 2004 18:07:16 -0000 1.3 +++ Generator.java 13 Apr 2004 23:41:51 -0000 @@ -36,7 +36,9 @@ /** * Constructs a new Generator using the defaults. */ - public Generator () {} + public Generator () { + params = new Properties(); + } /** * Constructs a new Generator, configured from XML.
    via by Kim Dykeman,
  • For the case where no --config arg is specified in the invocation of CodeGenerator.main (i.e. calling the Hbm2JavaTask with no value for the "config" attribute), BasicRenderer fails at the point where it calls isPropertySet("generate-concrete-empty-classes") since the "properties" member is null. Stack Trace: java.lang.NullPointerException at net.sf.hibernate.tool.hbm2java.BasicRenderer.isPropertySet(BasicRenderer.java:611) at net.sf.hibernate.tool.hbm2java.BasicRenderer.generateConcreteEmptyClasses(BasicRenderer.java:332) at net.sf.hibernate.tool.hbm2java.BasicRenderer.render(BasicRenderer.java:59) at net.sf.hibernate.tool.hbm2java.Generator.write(Generator.java:138) at net.sf.hibernate.tool.hbm2java.Generator.writeRecur(Generator.java:115) at net.sf.hibernate.tool.hbm2java.Generator.generate(Generator.java:104) at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:125) at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145) at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95) at org.apache.tools.ant.Task.perform(Task.java:341) at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:232) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233) at org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:88) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135) at org.apache.commons.jelly.impl.DynamicTag.doTag(DynamicTag.java:125) at org.apache.commons.jelly.impl.StaticTagScript.run(StaticTagScript.java:145) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233) at com.werken.werkz.jelly.GoalTag$1.performAction(GoalTag.java:128) at com.werken.werkz.Goal.fire(Goal.java:639) at com.werken.werkz.Goal.attain(Goal.java:575) at com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193) at com.werken.werkz.jelly.AttainGoalTag.doTag(AttainGoalTag.java:134) at org.apache.maven.jelly.tags.werkz.LazyAttainGoalTag.doTag(LazyAttainGoalTag.java:107) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233) at com.werken.werkz.jelly.PreGoalTag$1.firePreGoal(PreGoalTag.java:87) at com.werken.werkz.Goal.firePreGoalCallbacks(Goal.java:691) at com.werken.werkz.Goal.fire(Goal.java:616) at com.werken.werkz.Goal.attain(Goal.java:575) at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:448) at org.apache.maven.MavenSession.attainGoals(MavenSession.java:348) at org.apache.maven.cli.App.doMain(App.java:543) at org.apache.maven.cli.App.main(App.java:1109) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) I've applied a simple patch to my local copy that seems to work. Index: Generator.java =================================================================== RCS file: /cvsroot/hibernate/HibernateExt/tools/src/java/net/sf/hibernate/tool/hbm2java/Generator.java,v retrieving revision 1.3 diff -u -r1.3 Generator.java --- Generator.java 29 Mar 2004 18:07:16 -0000 1.3 +++ Generator.java 13 Apr 2004 23:41:51 -0000 @@ -36,7 +36,9 @@ /** * Constructs a new Generator using the defaults. */ - public Generator () {} + public Generator () { + params = new Properties(); + } /** * Constructs a new Generator, configured from XML.
    via by Kim Dykeman,
    • java.lang.NullPointerException at net.sf.hibernate.tool.hbm2java.BasicRenderer.isPropertySet(BasicRenderer.java:611) at net.sf.hibernate.tool.hbm2java.BasicRenderer.generateConcreteEmptyClasses(BasicRenderer.java:332) at net.sf.hibernate.tool.hbm2java.BasicRenderer.render(BasicRenderer.java:59) at net.sf.hibernate.tool.hbm2java.Generator.write(Generator.java:138) at net.sf.hibernate.tool.hbm2java.Generator.writeRecur(Generator.java:115) at net.sf.hibernate.tool.hbm2java.Generator.generate(Generator.java:104) at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:125) at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145) at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95) at org.apache.tools.ant.Task.perform(Task.java:341) at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:232) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233) at org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:88) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135) at org.apache.commons.jelly.impl.DynamicTag.doTag(DynamicTag.java:125) at org.apache.commons.jelly.impl.StaticTagScript.run(StaticTagScript.java:145) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233) at com.werken.werkz.jelly.GoalTag$1.performAction(GoalTag.java:128) at com.werken.werkz.Goal.fire(Goal.java:639) at com.werken.werkz.Goal.attain(Goal.java:575) at com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193) at com.werken.werkz.jelly.AttainGoalTag.doTag(AttainGoalTag.java:134) at org.apache.maven.jelly.tags.werkz.LazyAttainGoalTag.doTag(LazyAttainGoalTag.java:107) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233) at com.werken.werkz.jelly.PreGoalTag$1.firePreGoal(PreGoalTag.java:87) at com.werken.werkz.Goal.firePreGoalCallbacks(Goal.java:691) at com.werken.werkz.Goal.fire(Goal.java:616) at com.werken.werkz.Goal.attain(Goal.java:575) at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:448) at org.apache.maven.MavenSession.attainGoals(MavenSession.java:348) at org.apache.maven.cli.App.doMain(App.java:543) at org.apache.maven.cli.App.main(App.java:1109) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324)
    No Bugmate found.