解決情報:HHH000206:hibernate.propertiesが見つかりません問題



Solve Info Hhh000206



Hibernateを使い始めるとき:

Caused by: org.xml.sax.SAXParseException cvc-complex-type.2.4.a: Found invalid content starting with element'property'. Should be'{'http://www.hibernate.org/xsd/orm/cfg':mapping, 'http://www.hibernate.org/xsd/orm/cfg':class-cache, 'http:/ /www.hibernate.org/xsd/orm/cfg':collection-cache, 'http://www.hibernate.org/xsd/orm/cfg':event, 'http://www.hibernate.org/xsd /orm/cfg':listener}' at the beginning. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(Unknown Source) at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHandlerImpl.startElement(Unknown Source) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller.startElement(Unknown Source) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElement(Unknown Source) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXEventConnector.handleStartElement(Unknown Source) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXEventConnector.bridge(Unknown Source) ... 32 more

これは、hibernate.cfg.xmlのタグの下にタグを配置したため、マッピング中のプロパティタグが失敗したためです。
画像
解決策:マッピングタグを下に移動するだけです。