The following log shows that the file is correctly read:
...
INFO org.hibernate.cfg.Configuration.addResource(Configuration.java:
586) Reading mappings from resource : hibernate.cfg.xml
...
DEBUG org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType
(AnnotationConfiguration.java:529) Process hbm files
DEBUG org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType
(AnnotationConfiguration.java:537) Process annotated classes
DEBUG
org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder
(AnnotationConfiguration.java:401) processing fk mappings (*ToOne
and JoinedSubclass)
DEBUG org.hibernate.cfg.Configuration.secondPassCompile
(Configuration.java:1153) processing extends queue
DEBUG org.hibernate.cfg.Configuration.secondPassCompile
(Configuration.java:1157) processing collection mappings
DEBUG org.hibernate.cfg.Configuration.secondPassCompile
(Configuration.java:1168) processing native query and
ResultSetMapping mappings
DEBUG org.hibernate.cfg.Configuration.secondPassCompile
(Configuration.java:1176) processing association property references
DEBUG org.hibernate.cfg.Configuration.secondPassCompile
(Configuration.java:1198) processing foreign key constraints
...
I also debugged the addResource() method call, that showed the the xml
is correcty read, as the following dom snapshot shows:
[org.dom4j.tree.DefaultElement@1e3e7d2 [Element: <property attributes:
[org.dom4j.tree.DefaultAttribute@188a387 [Attribute: name name value
"connection.driver_class"]]/>], org.dom4j.tree.DefaultElement@1a81bd5
[Element: <property attributes:
[org.dom4j.tree.DefaultAttribute@1bb60ad [Attribute: name name value
"connection.url"]]/>], org.dom4j.tree.DefaultElement@c80e21 [Element:
<property attributes: [org.dom4j.tree.DefaultAttribute@17bcd4
[Attribute: name name value "connection.username"]]/>],
org.dom4j.tree.DefaultElement@6e3fe4 [Element: <property attributes:
[org.dom4j.tree.DefaultAttribute@24c22b [Attribute: name name value
"connection.password"]]/>], org.dom4j.tree.DefaultElement@147a16f
[Element: <property attributes:
[org.dom4j.tree.DefaultAttribute@1b78953 [Attribute: name name value
"dialect"]]/>], org.dom4j.tree.DefaultElement@98b13b [Element:
<property attributes: [org.dom4j.tree.DefaultAttribute@9bad4f
[Attribute: name name value "current_session_context_class"]]/>],
org.dom4j.tree.DefaultElement@8f3eac [Element: <property attributes:
[org.dom4j.tree.DefaultAttribute@5ba50e [Attribute: name name value
"transaction.factory_class"]]/>], org.dom4j.tree.DefaultElement@b173c3
[Element: <property attributes:
[org.dom4j.tree.DefaultAttribute@270fc4 [Attribute: name name value
"cache.provider_class"]]/>], org.dom4j.tree.DefaultElement@7c4768
[Element: <property attributes:
[org.dom4j.tree.DefaultAttribute@1342f5b [Attribute: name name value
"show_sql"]]/>], org.dom4j.tree.DefaultElement@11126f6 [Element:
<property attributes: [org.dom4j.tree.DefaultAttribute@114ef62
[Attribute: name name value "hbm2ddl.auto"]]/>],
org.dom4j.tree.DefaultElement@1703484 [Element: <mapping attributes:
[org.dom4j.tree.DefaultAttribute@187e184 [Attribute: name package
value "com.naaka.spikes.domain"]]/>],
org.dom4j.tree.DefaultElement@1e6cf07 [Element: <mapping attributes:
[org.dom4j.tree.DefaultAttribute@2209db [Attribute: name class value
"com.naaka.spikes.domain.Book"]]/>],
org.dom4j.tree.DefaultElement@b53b32 [Element: <mapping attributes:
[org.dom4j.tree.DefaultAttribute@41647f [Attribute: name class value
"com.naaka.spikes.domain.Cart"]]/>]]
The connection properties appear to be read from the xml files !
On May 28, 11:37 pm, Robbie Vanbrabant <
robbie.vanbrab...@gmail.com>
wrote:
> It seems like Hibernate can't find your configuration file, is it located in
> the root of your classpath? (make sure it's copied after compilation)
>
> Robbie
>
> On Thu, May 28, 2009 at 4:04 PM,
nicola.sina...@gmail.com <