christian wrote:
Also die beiden dateien sind gleich bis auf
<mapping resource="Event.hbm.xml"/> in der hibernate.cfg.xml.
wenn ich den eintrag reinmache findet er die Events.hbm.xml nicht mehr
<mapping resource="Event.hbm.xml"/>
dann kommt der fehler:
Alle klassen und xml files liegen im sourcefolder, habe noch nicht mal ein packsage erstellt. Hilfe
run:
[java] log4j:WARN No appenders could be found for logger (org.hibernate.cfg
.Environment).
[java] log4j:WARN Please initialize the log4j system properly.
[java] Initial SessionFactory creation failed.org.hibernate.MappingExceptio
n: Error reading resource: Event.hbm.xml
[java] Exception in thread "main" java.lang.ExceptionInInitializerError
[java] at HibernateUtil.<clinit>(Unknown Source)
[java] at EventManager.createAndStoreEvent(Unknown Source)
[java] at EventManager.main(Unknown Source)
[java] Caused by: org.hibernate.MappingException: Error reading resource: E
vent.hbm.xml
[java] at org.hibernate.cfg.Configuration.addResource(Configuration.jav
a:452)
[java] at org.hibernate.cfg.Configuration.parseMappingElement(Configura
tion.java:1263)
[java] at org.hibernate.cfg.Configuration.parseSessionFactory(Configura
tion.java:1235)
[java] at org.hibernate.cfg.Configuration.doConfigure(Configuration.jav
a:1217)
[java] at org.hibernate.cfg.Configuration.doConfigure(Configuration.jav
a:1184)
[java] at org.hibernate.cfg.Configuration.configure(Configuration.java:
1112)
[java] at org.hibernate.cfg.Configuration.configure(Configuration.java:
1098)
[java] ... 3 more
[java] Caused by: org.hibernate.MappingException: invalid mapping
[java] at org.hibernate.cfg.Configuration.addInputStream(Configuration.
java:399)
[java] at org.hibernate.cfg.Configuration.addResource(Configuration.jav
a:449)
[java] ... 9 more
[java] Caused by: org.xml.sax.SAXParseException: Document is invalid: no gr
ammar found.
[java] at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.c
reateSAXParseException(ErrorHandlerWrapper.java:236)
[java] at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.e
rror(ErrorHandlerWrapper.java:172)
[java] at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.repo
rtError(XMLErrorReporter.java:382)
[java] at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.repo
rtError(XMLErrorReporter.java:316)
[java] at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerI
mpl.scanStartElement(XMLNSDocumentScannerImpl.java:177)
[java] at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerI
mpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:779)
[java] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentSc
annerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java
:1794)
[java] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentSc
annerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
[java] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration
.parse(XML11Configuration.java:834)
[java] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration
.parse(XML11Configuration.java:764)
[java] at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XM
LParser.java:148)
[java] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.
parse(AbstractSAXParser.java:1242)
[java] at org.dom4j.io.SAXReader.read(SAXReader.java:465)
[java] at org.hibernate.cfg.Configuration.addInputStream(Configuration.
java:398)
[java] ... 10 more
[java] Java Result: 1