Salve.
Sono di nuovo alle prese con hibernate e soci.
Sto tentando di mappare un file risorsa utenteuser.hbm.xml:
codice:
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.username">postgres</property>
<property name="hibernate.connection.password">root</property>
<property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/provahib</property>
<property name="connection_pool_size">1</property>
<property name="hbm2ddl.auto">create</property>
<property name="show_sql">true</property>
<mapping class="org.massimo.dettagliUser.UtenteUser" />
<!-- <mapping resource="employee.hbm.xml" /> -->
<mapping resource="config/utenteuser.hbm.xml"/>
</session-factory>
</hibernate-configuration>
La cartella config che contiene il file risorsa è allo stesso livello della cartella src generata in un normale progetto di eclipse:
NomeProgetto
|-- src
|-- config
|-- JRE System Library
|...
|...
Ottengo sempre questo errore:
codice:
ott 16, 2016 11:47:55 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {5.0.9.Final}
ott 16, 2016 11:47:55 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
ott 16, 2016 11:47:55 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
ott 16, 2016 11:47:56 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
Exception in thread "main" org.hibernate.boot.MappingNotFoundException: Mapping (RESOURCE) not found : config/utenteuser.hbm.xml : origin(config/utenteuser.hbm.xml)
at org.hibernate.boot.spi.XmlMappingBinderAccess.bind(XmlMappingBinderAccess.java:56)
at org.hibernate.boot.MetadataSources.addResource(MetadataSources.java:274)
at org.hibernate.boot.cfgxml.spi.MappingReference.apply(MappingReference.java:70)
at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:413)
at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:87)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:692)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:724)
at org.massimo.hibernate.HibernateTest.main(HibernateTest.java:26)
Grazie per qualsiasi aiuto.