-->
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.  [ 3 posts ] 
Author Message
 Post subject: net.sf.hibernate.cfg.Configuration.addResource not work
PostPosted: Thu Jan 20, 2005 7:47 pm 
Newbie

Joined: Mon Oct 25, 2004 12:53 pm
Posts: 9
Hibernate Gurus,

I create HibernateService as a Java (Util type) project and my Web project reference my HibernateService project which works great on my WSAD5.x. But when I deploy my ear to the WAS server.
None of my hbm.xml files could be found any more? The exception is something like:

The following exception was logged net.sf.hibernate.MappingException: Resource:
com\amfam\pgs\model\PurserRole.hbm.xml not found
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:331)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:990)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:946)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:874)

And my hbm.xml defined in cfg.xml as:

.....
<mapping resource="com\amfam\pgs\model\PurserRole.hbm.xml"/>
<mapping resource="com\amfam\pgs\model\ReservedContractNumber.hbm.xml"/>
<mapping resource="com\amfam\pgs\model\RevisionReason.hbm.xml"/>
<mapping resource="com\amfam\pgs\model\Structure.hbm.xml"/>
</session-factory>
</hibernate-configuration>

Why it is working on WSAD but not on WAS, any ideas?
Thanks in advance!
JohnZ


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 20, 2005 8:40 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
No idea about crap tools like WAS/WSAD :)

But the mapping files must be locatable as classpath resources. I would guess the ear structure is just messed up.


Top
 Profile  
 
 Post subject: net.sf.hibernate.cfg.Configuration.addResource not work
PostPosted: Fri Jan 21, 2005 2:46 pm 
Newbie

Joined: Mon Oct 25, 2004 12:53 pm
Posts: 9
Steve,

One of team developer, helped me figuring out the problem. This is non-hibernate but can be a very common hibernate error - in the hbm.xml change all backward slash \ to forward slash / - that will works for all WIN/Unix environment.

Thanks Steve.
John


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.