我希望使用MiddleGen生成 hbm
中间尝试使用了MiddleGen2.1、MiddleGen-Hibernate-r4、r5 最终都因遇到了java.lang.ClassNotFoundException: middlegen.DontCloseLog4JLogSystem 的报错而终止。
但是我检查了MiddleGen.jar中的内容,发现并没有缺少DontCloseLog4jLogSystem.class,包括其父类的所在包velocity-1.4-dev.jar也已经加入lib中。我怀疑是设置文件或者是环境的问题,但是却始终找不出症结所在,还望各位大大指教。
具体报错如下:
======================================================================
[middlegen] java.lang.ClassNotFoundException: middlegen.DontCloseLog4JLogSystem
[middlegen] at java.net.URLClassLoader$1.run(Unknown Source)
[middlegen] at java.security.AccessController.doPrivileged(Native Method)
[middlegen] at java.net.URLClassLoader.findClass(Unknown Source)
[middlegen] at java.lang.ClassLoader.loadClass(Unknown Source)
[middlegen] at java.lang.ClassLoader.loadClass(Unknown Source)
[middlegen] at java.lang.ClassLoader.loadClassInternal(Unknown Source)
[middlegen] at java.lang.Class.forName0(Native Method)
[middlegen] at java.lang.Class.forName(Unknown Source)
[middlegen] at org.apache.velocity.runtime.log.LogManager.createLogSystem(Lo
gManager.java:161)
[middlegen] at org.apache.velocity.runtime.RuntimeInstance.initializeLogger(
RuntimeInstance.java:601)
[middlegen] at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInsta
nce.java:272)
[middlegen] at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInsta
nce.java:509)
[middlegen] at org.apache.velocity.app.VelocityEngine.init(VelocityEngine.ja
va:148)
[middlegen] at middlegen.Plugin.getEngine(Plugin.java:570)
[middlegen] at middlegen.Plugin.generate(Plugin.java:512)
[middlegen] at middlegen.Middlegen.writeSource(Middlegen.java:415)
[middlegen] at middlegen.swing.JMiddlegenFrame$1.actionPerformed(JMiddlegenF
rame.java:67)
[middlegen] at javax.swing.AbstractButton.fireActionPerformed(Unknown Source
)
[middlegen] at javax.swing.AbstractButton$Handler.actionPerformed(Unknown So
urce)
[middlegen] at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown So
urce)
[middlegen] at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
[middlegen] at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unkn
own Source)
[middlegen] at java.awt.Component.processMouseEvent(Unknown Source)
[middlegen] at javax.swing.JComponent.processMouseEvent(Unknown Source)
[middlegen] at java.awt.Component.processEvent(Unknown Source)
[middlegen] at java.awt.Container.processEvent(Unknown Source)
[middlegen] at java.awt.Component.dispatchEventImpl(Unknown Source)
[middlegen] at java.awt.Container.dispatchEventImpl(Unknown Source)
[middlegen] at java.awt.Component.dispatchEvent(Unknown Source)