Joined: Wed Jul 07, 2004 5:35 am Posts: 7 Location: L
|
hey there,
my problem is the following. I had a project hierachy that has looked like this:
projects (the root for my packages)
|
daisy
|
examples
|
todo
|
|- <...>.java
|- <...>.class
|-Task.java
|-Task.hbm.xml
|- and so on
no i changed my hierachy to this:
projects (the root for my packages)
|
daisy
|
examples
|
todo
| - dom
| |-some java files
| |-Task.java
| |-Task.hbm.xml
|
| - ui
| | - some UI java files
|
| - other subpackages
Before i had changed the hierachy hibernate works well, but now with the new one i get an exception when starting my program. Some problems by reading the Task.hbm.xml file. Does anybody know what i have made wrong by changing my hierachy? I have not changed the Task.hbm.xml mapping file.
Thanks in advance
Angry Angel
===============================================
Hibernate version: 2.1
Here is the stack strace:
log4j:WARN No appenders could be found for logger (net.sf.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
net.sf.hibernate.MappingException: Error reading resource: daisy/examples/todo/dom/Task.hbm.xml
at net.sf.hibernate.cfg.Configuration.addClass(Configuration.java:354)
at daisy.examples.todo.dom.HibernateTaskRepository.connect(HibernateTaskRepository.java:281)
at daisy.examples.todo.dom.HibernateTaskRepository.<init>(HibernateTaskRepository.java:26)
at daisy.examples.todo.dom.Assembler.<init>(Assembler.java:22)
at daisy.examples.todo.svc.TaskServicesImpl.<init>(TaskServicesImpl.java:26)
at daisy.examples.todo.ui.swing.TaskLauncher.getServiceInstance(TaskLauncher.java:287)
at daisy.examples.todo.ui.swing.TaskLauncher.launchAction(TaskLauncher.java:294)
at daisy.examples.todo.ui.swing.TaskLauncher.saveButtonActionPerformed(TaskLauncher.java:269)
at daisy.examples.todo.ui.swing.TaskLauncher.access$1(TaskLauncher.java:18)
at daisy.examples.todo.ui.swing.TaskLauncher$2.actionPerformed(TaskLauncher.java:228)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Caused by: net.sf.hibernate.MappingException: persistent class [daisy.examples.todo.Task] not found
at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:84)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:221)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:285)
at net.sf.hibernate.cfg.Configuration.addClass(Configuration.java:351)
... 32 more
Caused by: java.lang.ClassNotFoundException: daisy.examples.todo.Task
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at net.sf.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:102)
at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:81)
... 37 more
java.lang.NullPointerException
at daisy.examples.todo.dom.HibernateTaskRepository.getTaskList(HibernateTaskRepository.java:35)
at daisy.examples.todo.dom.Assembler.getTaskDTOList(Assembler.java:42)
at daisy.examples.todo.svc.TaskServicesImpl.getTaskDTOList(TaskServicesImpl.java:55)
at daisy.examples.todo.svc.TaskServicesImpl.findDTOList(TaskServicesImpl.java:73)
at daisy.examples.todo.ui.Mediator.getTaskDTOList(Mediator.java:194)
at daisy.examples.todo.ui.Mediator.<init>(Mediator.java:31)
at daisy.examples.todo.ui.swing.TaskLauncher.launchAction(TaskLauncher.java:294)
at daisy.examples.todo.ui.swing.TaskLauncher.saveButtonActionPerformed(TaskLauncher.java:269)
at daisy.examples.todo.ui.swing.TaskLauncher.access$1(TaskLauncher.java:18)
at daisy.examples.todo.ui.swing.TaskLauncher$2.actionPerformed(TaskLauncher.java:228)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
java code:
Configuration config = new Configuration();
config.addClass(Task.class);
_sessionFactory = config.buildSessionFactory();
database: mysql
|
|