Please specify how to work with Hibernate Pojo Generator .
I have a hibernate dependancies jar file and i have created a config.xml file.
My database is Oracle
My config.xml has the following code
<?xml version="1.0" encoding="ISO-8859-1" ?>
<appconfig>
<dbType>Oracle</dbType>
<driver>sun.jdbc.odbc.JdbcOdbcDriver</driver>
<url>
jdbc
racle:thin:@ 192.168.64.137:1521:XE</url>
<username>scms</username>
<password>scms</password>
<sourceTarget>C:\workspace\TEST_POJ</sourceTarget>
<projectName>TESTPOJ</projectName>
<topLevel>JMBAXI</topLevel>
<libPath>libs</libPath>
<schemaStrategy>FULL</schemaStrategy>
</appconfig>
When I am running the code through command prompt I am getting a null pointer exception
C:\>
java -jar hbnpojogen-core-1.4.4-jar-with-dependencies.jar config.xml
Hibernate POJO Generator
Reading from config: C:\\config.xml
java.lang.NullPointerException
at java.util.Hashtable.put(Unknown Source)
at com.felees.hbnpojogen.HbnPojoGen.main(HbnPojoGen.java:419)
generated a file called velocity.log which has the following contents
2012-03-03 09:38:55,177 - Log4JLogChute initialized using file 'velocity.log'
2012-03-03 09:38:55,177 - Starting Apache Velocity v1.5 (compiled: 2007-02-22 08:52:29)
2012-03-03 09:38:55,177 - Default Properties File: org\apache\velocity\runtime\defaults\velocity.properties
2012-03-03 09:38:55,177 - Trying to use logger class org.apache.velocity.runtime.log.AvalonLogChute
2012-03-03 09:38:55,177 - Couldn't find class org.apache.velocity.runtime.log.AvalonLogChute or necessary supporting classes in classpath.
java.lang.NoClassDefFoundError: org/apache/log/format/Formatter
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.velocity.util.ClassUtils.getClass(ClassUtils.java:63)
at org.apache.velocity.util.ClassUtils.getNewInstance(ClassUtils.java:95)
at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:147)
at org.apache.velocity.runtime.log.LogManager.updateLog(LogManager.java:208)
at org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:728)
at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:240)
at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:534)
at org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:227)
at org.apache.velocity.app.Velocity.init(Velocity.java:111)
at com.felees.hbnpojogen.Config.parseConfig(Config.java:71)
at com.felees.hbnpojogen.HbnPojoGen.main(HbnPojoGen.java:409)
Caused by: java.lang.ClassNotFoundException: org.apache.log.format.Formatter
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 13 more
2012-03-03 09:38:55,177 - Trying to use logger class org.apache.velocity.runtime.log.Log4JLogChute
2012-03-03 09:38:55,177 - Using logger class org.apache.velocity.runtime.log.Log4JLogChute
2012-03-03 09:38:55,193 - Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
2012-03-03 09:38:55,193 - ResourceLoader instantiated: org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
2012-03-03 09:38:55,224 - ResourceCache: initialized (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
2012-03-03 09:38:55,224 - Loaded System Directive: org.apache.velocity.runtime.directive.Literal
2012-03-03 09:38:55,224 - Loaded System Directive: org.apache.velocity.runtime.directive.Macro
2012-03-03 09:38:55,239 - Loaded System Directive: org.apache.velocity.runtime.directive.Parse
2012-03-03 09:38:55,239 - Loaded System Directive: org.apache.velocity.runtime.directive.Include
2012-03-03 09:38:55,239 - Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
2012-03-03 09:38:55,301 - Created '20' parsers.
2012-03-03 09:38:55,301 - Velocimacro : "velocimacro.library" is not set. Trying default library: VM_global_library.vm
2012-03-03 09:38:55,301 - Velocimacro : Default library not found.
2012-03-03 09:38:55,301 - Velocimacro : allowInline = true : VMs can be defined inline in templates
2012-03-03 09:38:55,301 - Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
2012-03-03 09:38:55,301 - Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed.
2012-03-03 09:38:55,301 - Velocimacro : autoload off : VM system will not automatically reload global library macros
2012-03-03 09:38:55,333 - Velocimacro : added #doCalcFullType( ) : source = templates/class.vm
2012-03-03 09:38:55,333 - Velocimacro : added #lazyManyToMany( ) : source = templates/class.vm
2012-03-03 09:38:55,333 - Velocimacro : added #lazyOneToMany( ) : source = templates/class.vm
2012-03-03 09:38:55,333 - Velocimacro : added #lazyOneToOne( ) : source = templates/class.vm
2012-03-03 09:38:55,333 - Velocimacro : added #lazyManyToOne( ) : source = templates/class.vm
2012-03-03 09:38:55,348 - Velocimacro : added #doAnnotations( ) : source = templates/class.vm
2012-03-03 09:38:55,348 - Velocimacro : added #prefix( ) : source = templates/class.vm
2012-03-03 09:38:55,348 - Velocimacro : added #doClassType( ) : source = templates/class.vm
2012-03-03 09:38:55,364 - Velocimacro : added #doManyToMany( property ) : source = templates/class.vm
2012-03-03 09:38:55,364 - Velocimacro : added #oneToManyAnnotation( property ) : source = templates/class.vm
2012-03-03 09:38:55,364 - Velocimacro : added #manyToOneAnnotation( property ) : source = templates/class.vm
2012-03-03 09:38:55,379 - Velocimacro : added #OneToOneAnnotation( property ) : source = templates/class.vm
2012-03-03 09:38:55,379 - Velocimacro : added #doConstructorSignature( ) : source = templates/class.vm
2012-03-03 09:38:55,395 - Velocimacro : added #doClassMacros( ) : source = templates/class.vm
2012-03-03 09:38:55,519 - ResourceManager : found templates/class.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
2012-03-03 09:38:55,519 - Velocimacro : VM addition rejected : prefix : inline not allowed to replace existing VM
2012-03-03 09:38:55,519 - Failed to add macro: #prefix( ) : source = templates/classIface.vm
2012-03-03 09:38:55,535 - ResourceManager : found templates/classIface.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
2012-03-03 09:39:05,997 - Log4JLogChute initialized using file 'velocity.log'
2012-03-03 09:39:05,997 - Starting Apache Velocity v1.5 (compiled: 2007-02-22 08:52:29)
2012-03-03 09:39:05,997 - Default Properties File: org\apache\velocity\runtime\defaults\velocity.properties
2012-03-03 09:39:05,997 - Trying to use logger class org.apache.velocity.runtime.log.AvalonLogChute
2012-03-03 09:39:05,997 - Couldn't find class org.apache.velocity.runtime.log.AvalonLogChute or necessary supporting classes in classpath.
java.lang.NoClassDefFoundError: org/apache/log/format/Formatter
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.velocity.util.ClassUtils.getClass(ClassUtils.java:63)
at org.apache.velocity.util.ClassUtils.getNewInstance(ClassUtils.java:95)
at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:147)
at org.apache.velocity.runtime.log.LogManager.updateLog(LogManager.java:208)
at org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:728)
at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:240)
at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:534)
at org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:227)
at org.apache.velocity.app.Velocity.init(Velocity.java:111)
at com.felees.hbnpojogen.Config.parseConfig(Config.java:71)
at com.felees.hbnpojogen.HbnPojoGen.main(HbnPojoGen.java:409)
Caused by: java.lang.ClassNotFoundException: org.apache.log.format.Formatter
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 13 more
2012-03-03 09:39:06,013 - Trying to use logger class org.apache.velocity.runtime.log.Log4JLogChute
2012-03-03 09:39:06,013 - Using logger class org.apache.velocity.runtime.log.Log4JLogChute
2012-03-03 09:39:06,013 - Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
2012-03-03 09:39:06,013 - ResourceLoader instantiated: org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
2012-03-03 09:39:06,013 - ResourceCache: initialized (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
2012-03-03 09:39:06,028 - Loaded System Directive: org.apache.velocity.runtime.directive.Literal
2012-03-03 09:39:06,028 - Loaded System Directive: org.apache.velocity.runtime.directive.Macro
2012-03-03 09:39:06,028 - Loaded System Directive: org.apache.velocity.runtime.directive.Parse
2012-03-03 09:39:06,028 - Loaded System Directive: org.apache.velocity.runtime.directive.Include
2012-03-03 09:39:06,028 - Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
2012-03-03 09:39:06,091 - Created '20' parsers.
2012-03-03 09:39:06,091 - Velocimacro : "velocimacro.library" is not set. Trying default library: VM_global_library.vm
2012-03-03 09:39:06,091 - Velocimacro : Default library not found.
2012-03-03 09:39:06,091 - Velocimacro : allowInline = true : VMs can be defined inline in templates
2012-03-03 09:39:06,091 - Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
2012-03-03 09:39:06,091 - Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed.
2012-03-03 09:39:06,091 - Velocimacro : autoload off : VM system will not automatically reload global library macros
2012-03-03 09:39:06,122 - Velocimacro : added #doCalcFullType( ) : source = templates/class.vm
2012-03-03 09:39:06,122 - Velocimacro : added #lazyManyToMany( ) : source = templates/class.vm
2012-03-03 09:39:06,122 - Velocimacro : added #lazyOneToMany( ) : source = templates/class.vm
2012-03-03 09:39:06,122 - Velocimacro : added #lazyOneToOne( ) : source = templates/class.vm
2012-03-03 09:39:06,122 - Velocimacro : added #lazyManyToOne( ) : source = templates/class.vm
2012-03-03 09:39:06,137 - Velocimacro : added #doAnnotations( ) : source = templates/class.vm
2012-03-03 09:39:06,137 - Velocimacro : added #prefix( ) : source = templates/class.vm
2012-03-03 09:39:06,137 - Velocimacro : added #doClassType( ) : source = templates/class.vm
2012-03-03 09:39:06,137 - Velocimacro : added #doManyToMany( property ) : source = templates/class.vm
2012-03-03 09:39:06,153 - Velocimacro : added #oneToManyAnnotation( property ) : source = templates/class.vm
2012-03-03 09:39:06,153 - Velocimacro : added #manyToOneAnnotation( property ) : source = templates/class.vm
2012-03-03 09:39:06,168 - Velocimacro : added #OneToOneAnnotation( property ) : source = templates/class.vm
2012-03-03 09:39:06,168 - Velocimacro : added #doConstructorSignature( ) : source = templates/class.vm
2012-03-03 09:39:06,184 - Velocimacro : added #doClassMacros( ) : source = templates/class.vm
2012-03-03 09:39:06,293 - ResourceManager : found templates/class.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
2012-03-03 09:39:06,308 - Velocimacro : VM addition rejected : prefix : inline not allowed to replace existing VM
2012-03-03 09:39:06,308 - Failed to add macro: #prefix( ) : source = templates/classIface.vm
2012-03-03 09:39:06,308 - ResourceManager : found templates/classIface.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader