Как отсортировать или устранить ошибку XML Hibernate? Исключение в потоке «main» org.hibernate.HibernateExceptionJAVA

Программисты JAVA общаются здесь
Ответить Пред. темаСлед. тема
Anonymous
 Как отсортировать или устранить ошибку XML Hibernate? Исключение в потоке «main» org.hibernate.HibernateException

Сообщение Anonymous »


when I run the main class the compiler gets some errors and the errors are written below. This is very difficult to sort i totally waste four than more hours. This is the hibernate.cfg.xml file

com.mysql.jdbc.Driver jdbc:mysql://localhost:3306/myhiber root Kunal@1234@ org.hibernate.dialect.MySQLDialect update true This is main class

package com.hona.hoja; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; public class App { public static void main( String[] args ) { System.out.println( "Project Started..." ); Configuration cfg = new Configuration(); cfg.configure("hibernate.cfg.xml"); SessionFactory factory = cfg.buildSessionFactory(); System.out.println(factory); System.out.println(factory.isClosed()); } } I got ERROR below so how i can resolve?

INFO: HHH000412: Hibernate ORM core version 5.5.4.Final Exception in thread "main" org.hibernate.HibernateException: Error accessing stax stream at org.hibernate.boot.cfgxml.internal.JaxbCfgProcessor.unmarshal(JaxbCfgProcessor.java:108) at org.hibernate.boot.cfgxml.internal.JaxbCfgProcessor.unmarshal(JaxbCfgProcessor.java:66) at org.hibernate.boot.cfgxml.internal.ConfigLoader.loadConfigXmlResource(ConfigLoader.java:57) at org.hibernate.boot.registry.StandardServiceRegistryBuilder.configure(StandardServiceRegistryBuilder.java:254) at org.hibernate.cfg.Configuration.configure(Configuration.java:260) at com.hona.hoja.App.main(App.java:13) Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[3,64] Message: White spaces are required between publicId and systemId. at java.xml/com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:652) at java.xml/com.sun.xml.internal.stream.XMLEventReaderImpl.peek(XMLEventReaderImpl.java:277) at org.hibernate.boot.cfgxml.internal.JaxbCfgProcessor.unmarshal(JaxbCfgProcessor.java:104) ... 5 more I will consider XML formatted file hibernate.cfg.xml to specify required Hibernate properties in my examples. Most of the properties take their default values and it is not required to specify them in the property file unless it is really required. This file is kept in the root directory of your application's classpath.


Источник: https://stackoverflow.com/questions/781 ... -org-hiber
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «JAVA»