-->
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: org.hibernate.MappingException: Resource: ... not found
PostPosted: Thu May 18, 2006 8:09 am 
Newbie

Joined: Thu May 18, 2006 7:38 am
Posts: 10
Hi!

Muss/Möchte mich gerade in Java / Eclipse / Hibernate einarbeiten und komme einfach nicht weiter.

hibernate.cfg.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
        <property name="hibernate.connection.url">jdbc:postgresql://localhost/dev_jazz</property>
        <property name="hibernate.connection.username">postgres</property>
        <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
      <mapping resource="at/jazz/db/ContactFirm.hbm.xml"/>
    </session-factory>
</hibernate-configuration>


ContactFirm.hbm.xml
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
   <class name="at.jazz.db.ContactFirm" table="ContactFirm">
      <id name="id">
         <generator class="native"/>
      </id>
      <property name="fullname" type="string" length="250" not-null="true"/>
      <property name="shortname" type="string" length="250" not-null="false"/>
      <component name="foundingdate">
         <property name="day" type="string" length="2" not-null="false"/>
         <property name="month" type="string" length="2" not-null="false"/>
         <property name="year" type="string" length="4" not-null="false"/>
      </component>
      <property name="ident1" type="string" length="30" not-null="false"/>
      <property name="ident2" type="string" length="30" not-null="false"/>
      <property name="ident3" type="string" length="30" not-null="false"/>
      <property name="ident4" type="string" length="30" not-null="false"/>
      <property name="ident5" type="string" length="30" not-null="false"/>
   </class>
</hibernate-mapping>


Ich bekomme in der Hibernate-Console die Fehlermeldung:
Quote:
Error 2006-05-18 13:41:35.217 org.hibernate.MappingException: Resource: at/jazz/db/ContactFirm.hbm.xml not found
org.hibernate.MappingException: Resource: at/jazz/db/ContactFirm.hbm.xml not found
at org.hibernate.cfg.Configuration.addResource(Configuration.java:483)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1469)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1437)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1418)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1394)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1348)
at org.hibernate.console.ConsoleConfiguration.loadConfigurationXML(ConsoleConfiguration.java:208)
at org.hibernate.console.ConsoleConfiguration.access$0(ConsoleConfiguration.java:155)
at org.hibernate.console.ConsoleConfiguration$1.execute(ConsoleConfiguration.java:131)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:112)
at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:98)
at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:19)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:69)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:192)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)


Was übersehe ich? Hat jemand einen Tipp für mich!

Marco

Konfiguration:
Eclipse 3.1.2 (unter MacOsX 10.4.6)
Hibernate-Tools 3.0.5beta


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 19, 2006 5:50 am 
Pro
Pro

Joined: Mon Jan 24, 2005 5:39 am
Posts: 216
Location: Germany
Hallo,

das Problem dürfte an deinem Laufzeit-Classpath liegen.
Die Datei at/jazz/db/ContactFirm.hbm.xml solltest
du am besten wie eine normale Java-Klasse behandeln
und sie in das Packaga at/jazz/db stellen.
Dann sollte Hibernate sie finden.
Wie sieht denn dein classpath aus ?

Gruss,
Barthel

_________________
dont forget to rate !


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.