I have read the document carefully.
And I tried two ways as follows to use hbm2java, but it doesn't work well.
1> My .bat file is as follows:
Code:
@echo off
rem hibernatePathset
set JDBC_DRIVER=D:\oracle\ora92\jdbc\lib\classes12.zip
set HIBERNATE_HOME=F:\hibernate-2-0-3
set LIB=%HIBERNATE_HOME%\lib
set PROPS=%HIBERNATE_HOME%\src
set CP=%JDBC_DRIVER%;%PROPS%;%HIBERNATE_HOME%\hibernate2.jar;%LIB%\commons-pool.jar;%LIB%\commons-dbcp.jar;%LIB%\commons-beanutils.jar;%LIB%\commons-logging.jar;%LIB%\commons-collections.jar;%LIB%\commons-lang.jar;%LIB%\cglib.jar;%LIB%\dom4j.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar;C:\j2sdk1.4.1\lib;%PROPS%;%HIBERNATE_EX_HOME%\hibernate-tools.jar;%HIBERNATE_HOME%\hibernate2.jar;%HIBERNATE_HOME%\hibernate-tools.jar;%LIB%\commons-logging.jar;%LIB%\commons-collections.jar;%LIB%\commons-lang.jar;%LIB%\cglib.jar;%LIB%\dom4j.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar;C:\j2sdk1.4.2_03\bin
The command and faults was showed as follows:
Code:
F:\hibernate-extensions-2-0-2\tools\bin>java -cp %CP% net.sf.hibernate.tool.hbm2java.CodeGenerator --output=c:\out c:\th\src\psrtype.hbm.xml
Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/hibernate/tool/hbm2java/CodeGenerator
2> My another .bat file is as follows:
Code:
@echo off
rem -------------------------------------------------------------------
rem Setup environment for hibernate tools
rem -------------------------------------------------------------------
set JDBC_DRIVER=D:\oracle\ora92\jdbc\lib\classes12.zip
rem set JDBC_DRIVER=C:\Progra~1\SQLLIB\java\db2java.zip;C:\mm.mysql-2.0.14\mm.mysql-2.0.14-bin.jar
rem set HIBERNATE_HOME=..\..\hibernate-2.0
set HIBERNATE_HOME=F:\hibernate-2-0-3
set CORELIB=%HIBERNATE_HOME%\lib
set LIB=..\lib
set PROPS=%HIBERNATE_HOME%\src
set CP=%JDBC_DRIVER%;%PROPS%;%HIBERNATE_HOME%\hibernate2.jar;%CORELIB%\commons-logging.jar;%CORELIB%\commons-collections.jar;%CORELIB%\commons-lang.jar;%CORELIB%\cglib.jar;%CORELIB%\dom4j.jar;%CORELIB%\odmg.jar;%CORELIB%\xml-apis.jar;%CORELIB%\xerces.jar;%CORELIB%\xalan.jar;%LIB%\jdom.jar
The command and faults was showed as follows:
Code:
F:\hibernate-extensions-2-0-2\tools\bin>hbm2java.bat c:\th\src\psrtype.hbm.xml
Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/hibernate/MappingException
I am mad at the "hbm2java" thing!