I can run the console against the example in the eg/ directory on Windows just fine, but under Gentoo Linux it doesn't work. I installed on Windows by simply unzipping into a directory and editing etc/hibernate.properties. I installed on Gentoo by typing "sudo emerge hibernate", which installed into /usr/share/hibernate. This only installed the jars, so I then copied in the missing directories from the Windows installation and set all the file permissions to 666 and directory permissions to 777.
Here is the script that kicks everything off:
Code:
$ cat hconsole
#!/bin/bash
cd /usr/share/hibernate
export JDBC_DRIVER=lib/mysql-connector-java-3.0.14-production-bin.jar
CP="lib/ant-1.5.3.jar:lib/ant-optional-1.5.3.jar:lib/junit-3.8.1.jar:lib/xerces-2.4.0.jar:$JAVA_HOME/lib/tools.jar"
java -cp "$CP" org.apache.tools.ant.Main -Ddriver.jar="$JDBC_DRIVER" $*
Here are the console properties
Code:
$ cat console/hibernateconsole.properties
#Hibernate Console properties
#Wed Dec 29 10:44:05 PST 2004
console.custom.classpath=/usr/share/hibernate/eg;
console.hbm.xml=/usr/share/hibernate/eg/org/hibernate/auction/AuctionItem.hbm.xml;/usr/share/hibernate/eg/org/hibernate/auction/Bid.hbm.xml;/usr/share/hibernate/eg/org/hibernate/auction/User.hbm.xml;
console.hibernate.cfg.xml=
console.hibernate.properties=/usr/share/hibernate/etc/hibernate.properties
Hibernate version: 2.1.7
Mapping documents: Exactly as supplied in the download (eg/ directory)
Code between sessionFactory.openSession() and session.close(): N/A
Full stack trace of any exception that occurs:The stack trace appears when I press the Apply button in the console's configuration dialog. Doesn't make any difference if I run as root or not, so I don't think permissions are the issue:
Code:
$ sudo hconsole
Buildfile: console/build.xml
run:
[java] JGoodies Looks: The ClearLook(tm) mode has been set to 'On'.
[java] log4j:WARN No appenders could be found for logger (net.sf.hibernate.cfg.Environment).
[java] log4j:WARN Please initialize the log4j system properly.
[java] net.sf.hibernate.MappingException: net.sf.hibernate.MappingException: persistent class [org.hibernate.auction.AuctionItem] not found
[java] at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java:179)
[java] at net.sf.hibernate.console.Start.reconfig(Start.java:155)
[java] at net.sf.hibernate.console.Start$4.configurationChanged(Start.java:539)
[java] at net.sf.hibernate.console.ConfigurationUI$ApplyConfig.actionPerformed(ConfigurationUI.java:321)
[java] at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
[java] at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
[java] at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
[java] at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
[java] at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
[java] at java.awt.Component.processMouseEvent(Component.java:5100)
[java] at java.awt.Component.processEvent(Component.java:4897)
[java] at java.awt.Container.processEvent(Container.java:1569)
[java] at java.awt.Component.dispatchEventImpl(Component.java:3615)
[java] at java.awt.Container.dispatchEventImpl(Container.java:1627)
[java] at java.awt.Component.dispatchEvent(Component.java:3477)
[java] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
[java] at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
[java] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
[java] at java.awt.Container.dispatchEventImpl(Container.java:1613)
[java] at java.awt.Window.dispatchEventImpl(Window.java:1606)
[java] at java.awt.Component.dispatchEvent(Component.java:3477)
[java] at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
[java] at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
[java] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
[java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
[java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
[java] at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
[java] Caused by: net.sf.hibernate.MappingException: persistent class [org.hibernate.auction.AuctionItem] not found
[java] at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:85)
[java] at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:222)
[java] at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1257)
[java] at net.sf.hibernate.cfg.Configuration.add(Configuration.java:252)
[java] at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java:174)
[java] ... 26 more
[java] Caused by: java.lang.ClassNotFoundException: org.hibernate.auction.AuctionItem
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
[java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
[java] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
[java] at java.lang.Class.forName0(Native Method)
[java] at java.lang.Class.forName(Class.java:141)
[java] at net.sf.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:102)
[java] at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:82)
[java] ... 30 more
Name and version of the database you are using: N/A
The generated SQL (show_sql=true): N/A
Debug level Hibernate log excerpt: No idea why log4j complains or how to fix it.
Code:
Code: