• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[Hibernate] Can't see class mapping inside the HSQL Database Manager

 
Luk Cora
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, i'm reading the book Java Persistence With Hibernate and following his tutorial, i'm facing with some issues.
Actually i've a tree like this:



build.xml is


hibernate.hbm.xml is:



but when i go on build.xml-->Run as Ant Application, once the HSQL Database Manager is opened, i can't see the database schema. This is what i've:


When i close this window (those of HSQL DB Manager), into the console is generated this log:

[java] Stopping
clean:
[delete] Deleting directory D:\Luca\Programmi\Eclipse\progetti\hibernate helloworld\bin
[mkdir] Created dir: D:\Luca\Programmi\Eclipse\progetti\hibernate helloworld\bin
compile:
[javac] D:\Luca\Programmi\Eclipse\progetti\hibernate helloworld\build.xml:38: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 3 source files to D:\Luca\Programmi\Eclipse\progetti\hibernate helloworld\bin
[javac] Note: D:\Luca\Programmi\Eclipse\progetti\hibernate helloworld\src\persistence\HibernateUtil.java uses or overrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
copymetafiles:
[copy] Copying 1 file to D:\Luca\Programmi\Eclipse\progetti\hibernate helloworld\bin
schemaexport:
[hibernatetool] Executing Hibernate Tool with a Standard Configuration
[hibernatetool] 1. task: hbm2ddl (Generates database schema)
[hibernatetool] log4j:WARN No appenders could be found for logger (org.jboss.logging).
[hibernatetool] log4j:WARN Please initialize the log4j system properly.
[hibernatetool] log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[hibernatetool] An exception occurred while running exporter #2:hbm2ddl (Generates database schema)
[hibernatetool] To get the full stack trace run ant with -verbose
[hibernatetool] org.hibernate.MappingNotFoundException: resource: src/hello/Message.hbm.xml not found

BUILD FAILED
D:\Luca\Programmi\Eclipse\progetti\hibernate helloworld\build.xml:72: java.lang.NoClassDefFoundError: org/hibernate/util/StringHelper

Total time: 2 minutes 30 seconds



It seems that hibernate can't find the Message.hbm.xml class, but why?
tree1.png
[Thumbnail for tree1.png]
schema.png
[Thumbnail for schema.png]
 
K. Tsang
Bartender
Posts: 3583
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I'm not mistaken, you don't need src at the front:

<mapping resource="hello/Message.hbm.xml"/>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic