Monday, 15 June 2015

java - Oracle hibernate cfg -



java - Oracle hibernate cfg -

i getting error when trying start hibernate. hibernate newbie hoping point out error made cfg. included error, hope easy fix, thanks.

<?xml version='1.0' encoding='utf-8'?>

<!-- database connection settings --> <property name="connection.driver_class">oracle.jdbc.driver.oracledriver</property> <property name="connection.url">jdbc:oracle:thin:@localhost:1521:orcl"</property> <property name="connection.username">scott</property> <property name="connection.password">tiger</property> <property name="hibernate.dialect" value="org.hibernate.dialect.oracledialect"/> <!-- echo executed sql stdout --> <property name="show_sql">true</property> </session-factory>

exception in thread "main" org.hibernate.mappingexception: invalid configuration @ org.hibernate.cfg.configuration.doconfigure(configuration.java:2241) @ org.hibernate.cfg.annotationconfiguration.doconfigure(annotationconfiguration.java:230) @ org.hibernate.cfg.annotationconfiguration.doconfigure(annotationconfiguration.java:71) @ org.hibernate.cfg.configuration.configure(configuration.java:2158) @ org.hibernate.cfg.annotationconfiguration.configure(annotationconfiguration.java:212) @ org.hibernate.cfg.annotationconfiguration.configure(annotationconfiguration.java:71) @ org.hibernate.cfg.configuration.configure(configuration.java:2137) @ org.hibernate.cfg.annotationconfiguration.configure(annotationconfiguration.java:206) @ hibernatecontext.setconfiguration(hibernatecontext.java:20) @ hibernatecontext.addclass(hibernatecontext.java:205) @ hibernatecontext.addclasses(hibernatecontext.java:216) @ main.main(main.java:8)

caused by: org.xml.sax.saxparseexception; linenumber: 14; columnnumber: 89; attribute "value" must declared element type "property". @ com.sun.org.apache.xerces.internal.util.errorhandlerwrapper.createsaxparseexception(unknown source) @ com.sun.org.apache.xerces.internal.util.errorhandlerwrapper.error(unknown source) @ com.sun.org.apache.xerces.internal.impl.xmlerrorreporter.reporterror(unknown source) @ com.sun.org.apache.xerces.internal.impl.xmlerrorreporter.reporterror(unknown source) @ com.sun.org.apache.xerces.internal.impl.xmlerrorreporter.reporterror(unknown source) @ com.sun.org.apache.xerces.internal.impl.dtd.xmldtdvalidator.adddtddefaultattrsandvalidate(unknown source) @ com.sun.org.apache.xerces.internal.impl.dtd.xmldtdvalidator.handlestartelement(unknown source) @ com.sun.org.apache.xerces.internal.impl.dtd.xmldtdvalidator.emptyelement(unknown source) @ com.sun.org.apache.xerces.internal.impl.xmlnsdocumentscannerimpl.scanstartelement(unknown source) @ com.sun.org.apache.xerces.internal.impl.xmldocumentfragmentscannerimpl$fragmentcontentdriver.next(unknown source) @ com.sun.org.apache.xerces.internal.impl.xmldocumentscannerimpl.next(unknown source) @ com.sun.org.apache.xerces.internal.impl.xmlnsdocumentscannerimpl.next(unknown source) @ com.sun.org.apache.xerces.internal.impl.xmldocumentfragmentscannerimpl.scandocument(unknown source) @ com.sun.org.apache.xerces.internal.parsers.xml11configuration.parse(unknown source) @ com.sun.org.apache.xerces.internal.parsers.xml11configuration.parse(unknown source) @ com.sun.org.apache.xerces.internal.parsers.xmlparser.parse(unknown source) @ com.sun.org.apache.xerces.internal.parsers.abstractsaxparser.parse(unknown source) @ com.sun.org.apache.xerces.internal.jaxp.saxparserimpl$jaxpsaxparser.parse(unknown source) @ org.dom4j.io.saxreader.read(saxreader.java:465) @ org.hibernate.cfg.configuration.doconfigure(configuration.java:2238) ... 11 more

try using <property name="hibernate.dialect">org.hibernate.dialect.oracledialect</property>

as newbie, can read entire hibernate documentation @ http://www.hibernate.org/docs

java oracle hibernate

No comments:

Post a Comment