-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Help with directories, hibernate, struts, eclipse!
PostPosted: Mon Dec 04, 2006 9:26 pm 
Newbie

Joined: Tue Nov 14, 2006 5:50 pm
Posts: 3
I'm completely stumped trying to figure out the proper place to put a hibernate mapping configuration file for my struts app.

I'm using the eclipse webtools. It gives me a directory layout like this:
./build:

./src:
./src/com/schumeyer/library
contains all java source files, as well as all *.hbm.cfg files

./Web:
./Web/WEB-INF
classes
hibernate.cfg.xml
MessageResources.properties
lib
many jar files
src
nothing here
struts-config.xml
tiles-defs.xml
validation.xml
web.xml

I keep getting the following exception:
org.hibernate.MappingNotFoundException: resource: classes/com/schumeyer/library/Customer.hbm.xml not found

PLEASE help with these questions:

1) Do I need to change my directory layout, or is the above layout ok?
2) Where do I put the *.hbm.cfg files ?
3) What do I put in the mapping resource element?

Hibernate version: 3.2

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

<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.url">jdbc:postgresql:lib2</property>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.username">rick</property>
<property name="hibernate.connection.password">rick</property>
<property name="hibernate.connection.pool_size">0</property>
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>

<!-- You will usually want to set this to true while debugging Hibernate queries -->
<property name="hibernate.show_sql">true</property>

<!-- "Import" the mapping resources here -->
<mapping resource="classes/com/schumeyer/library/Customer.hbm.xml"/>
</session-factory>
</hibernate-configuration>
[


    Top
     Profile  
     
     Post subject:
    PostPosted: Tue Dec 05, 2006 5:52 am 
    Beginner
    Beginner

    Joined: Tue Nov 21, 2006 5:18 am
    Posts: 31
    Location: Bangalore, India
    Hi,

    put your hibernate.cfg.xml file under src directory and put the mapping elements like customer.hbm.xml in to corresponding directory.

    This may helps you

    _________________
    persist_coder
    --credit please if it helps you


    Top
     Profile  
     
    Display posts from previous:  Sort by  
    Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

    All times are UTC - 5 hours [ DST ]


    You cannot post new topics in this forum
    You cannot reply to topics in this forum
    You cannot edit your posts in this forum
    You cannot delete your posts in this forum

    Search for:
    © Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.