-->
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: duplicate import
PostPosted: Thu Feb 02, 2006 7:23 am 
Newbie

Joined: Wed Feb 01, 2006 5:03 am
Posts: 1
Hi Leuts,

ich hoffe einer von euch kann mir helfen bei folgendem Problem. Benutze Struts zusammen mit Hibernate. Habe eine SessionFactory, ein Konfigurationsfile (*.cfg.xml) und diverse mapping-files (*.hbm.xml). Eigentlich läuft soweit alles super.

Es gibt jedoch ein Problem, wenn ich die Methode Configuration.config() 2mal zur gleichen Zeit ausführe. Dann kommen folgende Exceptions:

org.hibernate.MappingException: Error reading resource: mappingfile.hmb.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:452)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1263)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1235)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1217)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1184)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
at hibernate.HibernateSessionFactory.currentSession
usw.

auto-import auf 'false' zu stellen hat auch nix gebracht. Habt ihr irgendwelche Ideen?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 02, 2006 10:20 am 
Expert
Expert

Joined: Tue Nov 23, 2004 7:00 pm
Posts: 570
Location: mostly Frankfurt Germany
Die sollte nicht zweimal gleichzeitg ausgeführt werden.

Syncronisiere die Methode, die die Konfiguration starten oder erstelle einen ServletListener, der beim deployen das ganze einmal startet.

Gruß Sebastian

_________________
Best Regards
Sebastian
---
Training for Hibernate and Java Persistence
Tutorials for Hibernate, Spring, EJB, JSF...
eBook: Hibernate 3 - DeveloperGuide
Paper book: Hibernate 3 - Das Praxisbuch
http://www.laliluna.de


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.