My mistake was not to give the path to jdbc.jar in the classpath window. Adding it caused the NPE to disappear. Now I get
Code:
org.hibernate.MappingException: Resource: opus11/mat/Matemaatikko.hbm.xml not found
at org.hibernate.cfg.Configuration.addResource(Configuration.java:465)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1404)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1372)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1353)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1329)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1283)
at org.hibernate.console.ConsoleConfiguration$1.execute(ConsoleConfiguration.java:133)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:123)
at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:107)
at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:19)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:68)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:192)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
and when I add the path to Matemaatikko.hbm.xml I get:
Code:
org.hibernate.MappingException: Could not read mapping document from file: C:\Porasto\opusEJB\build\opus11\mat\Matemaatikko.hbm.xml
at org.hibernate.cfg.Configuration.addFile(Configuration.java:262)
at org.hibernate.console.ConsoleConfiguration$1.execute(ConsoleConfiguration.java:144)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:123)
at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:107)
at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:19)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:68)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:192)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
Caused by: org.hibernate.MappingException: duplicate class mapping: opus11.mat.Matemaatikko
at org.hibernate.cfg.Mappings.addClass(Mappings.java:96)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:157)
at org.hibernate.cfg.Configuration.add(Configuration.java:378)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:417)
at org.hibernate.cfg.Configuration.addFile(Configuration.java:259)
... 8 more