Hibernate version:3.2 GA
Mapping documents:
hibernate.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.driver_class">org.apache.derby.jdbc.ClientDriver</property>
<property name="connection.username">app</property>
<property name="connection.password">app</property>
<property name="connection.url">jdbc:derby://localhost:1527/app</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.DerbyDialect</property>
<!-- Debug logging of SQL statements -->
<property name="show_sql">true</property>
<mapping resource="/ormapping/Name.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Name.hbm.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="pojo.Name" table="NAME">
<id name="nameid" column="NAMEID">
<generator class="assigned"/>
</id>
<property name="firstname" column="FIRSTNAME"/>
<property name="lastname" column="LASTNAME"/>
</class>
</hibernate-mapping>
code
Configuration cfg = new Configuration().configure();
factory = cfg.buildSessionFactory();
Full stack trace of any exception that occurs:
Oct 24, 2007 4:02:45 PM org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.2.4.sp1
Oct 24, 2007 4:02:45 PM org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
Oct 24, 2007 4:02:45 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : cglib
Oct 24, 2007 4:02:45 PM org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
Oct 24, 2007 4:02:46 PM org.hibernate.cfg.Configuration configure
INFO: configuring from resource: /hibernate.cfg.xml
Oct 24, 2007 4:02:46 PM org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: Configuration resource: /hibernate.cfg.xml
Oct 24, 2007 4:02:46 PM org.hibernate.cfg.Configuration addResource
INFO: Reading mappings from resource : /ormapping/Name.hbm.xml
Exception in thread "AWT-EventQueue-0" org.hibernate.MappingNotFoundException: resource: /ormapping/Name.hbm.xml not found
at org.hibernate.cfg.Configuration.addResource(Configuration.java:563)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1587)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1555)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1534)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1508)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1428)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1414)
at hibernatecorejavaapplication.NameEntryForm.<init>(NameEntryForm.java:23)
at hibernatecorejavaapplication.NameEntryForm$1.run(NameEntryForm.java:106)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
|