• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Hibernate w/Tomcat error reading resource

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,
I am not new to Hibernate. I developed a full fat client/server application with it and Swing. Now I need to present some of the database with Tomcat.
I use the same mapping file, same classes etc.

Here is my hibernate.cfg.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>
<session-factory>
<property name="connection.datasource">java:comp/env/jdbc/tima</property>
<property name="hibernate.show_sql">true</property>
<property name="dialect"> net.sf.hibernate.dialect.SybaseAnywhereDialect</property>
<mapping resource="tima.hbm.xml" />
</session-factory>
</hibernate-configuration>

net.sf.hibernate.MappingException: Error reading resource: tima.hbm.xml

both hibernate.cfg.xml and my mapping file tima.hbm.xml are under WEB-INF/classes

The problem is not that it cannot find the tima.hbm.xml file in place. Because I tried to rename it to some other thing and it is not the same error. When it cannot find the mapping file, the error becomes:

javax.servlet.ServletException: Resource: tima.hbm.xml not found

So it can find it but something ugly happens while reading it. I am sure nothing is wrong with the mapping as it is already in use by the fat client app. and it passes XML validation.

What could I be missing?
Levent
 
Levent Aksu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Got it by myself.
It was because it could not find my mapped classes on the classpath. I had to go into Tomcat logs to find this.
Good luck with everyone.
 
reply
    Bookmark Topic Watch Topic
  • New Topic