# Problem with Xml

**URL:** <https://discourse.hibernate.org/t/problem-with-xml/2877>\
**Category:** Hibernate ORM\
**Created:** [June 21, 2019, 11:05am UTC](https://discourse.hibernate.org/t/problem-with-xml/2877 "2019-06-21T11:05:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dongtuuyenblackpeony](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/dongtuuyenblackpeony/32/650_2.png) [@dongtuuyenblackpeony](https://discourse.hibernate.org/u/dongtuuyenblackpeony)\
**Post date:** [June 21, 2019, 11:05am UTC](https://discourse.hibernate.org/t/problem-with-xml/2877/1 "2019-06-21T11:05:51Z")

</div>

hi every body, please i received this message error whane running my java application , i know that it is about hibernate.cfg.xml file but i don’t know how resolving it.  
the message is as follow:

```auto
INFO: HHH000412: Hibernate Core {5.2.17.Final}
mai 08, 2018 10:39:24 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
Exception in thread "main" java.lang.ClassCastException: com.sun.xml.internal.stream.events.EntityReferenceEvent cannot be cast to javax.xml.stream.events.Characters
	at com.sun.xml.internal.stream.events.DummyEvent.asCharacters(Unknown Source)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXEventConnector.handleCharacters(Unknown Source)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXEventConnector.bridge(Unknown Source)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(Unknown Source)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Unknown Source)
	at org.hibernate.boot.cfgxml.internal.JaxbCfgProcessor.unmarshal(JaxbCfgProcessor.java:126)
	at org.hibernate.boot.cfgxml.internal.JaxbCfgProcessor.unmarshal(JaxbCfgProcessor.java:65)
	at org.hibernate.boot.cfgxml.internal.ConfigLoader.loadConfigXmlResource(ConfigLoader.java:57)
	at org.hibernate.boot.registry.StandardServiceRegistryBuilder.configure(StandardServiceRegistryBuilder.java:163)
	at org.hibernate.cfg.Configuration.configure(Configuration.java:258)
	at one.hibernate.demo.CreateStudentDemo.main(CreateStudentDemo.java:16)

```

can you help me please.thank’s

---

<div class="post-metadata">

**Author:** ![Naros](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/naros/32/19_2.png) [@Naros](https://discourse.hibernate.org/u/Naros)\
**Post date:** [June 21, 2019, 2:13pm UTC](https://discourse.hibernate.org/t/problem-with-xml/2877/2 "2019-06-21T14:13:12Z")

</div>

> [@dongtuuyenblackpeony](#):
>
> com.sun.xml.internal.stream.events.EntityReferenceEvent cannot be cast to javax.xml.stream.events.Characters

This was also brought here:

> [@Xml parsing error](https://discourse.hibernate.org/t/xml-parsing-error/718):
>
> hi every body, please i received this message error whane running my java application , i know that it is about hibernate.cfg.xml file but i don’t know how resolving it. the message is as follow: INFO: HHH000412: Hibernate Core {5.2.17.Final} mai 08, 2018 10:39:24 PM org.hibernate.cfg.Environment \<clinit\> INFO: HHH000206: hibernate.properties not found Exception in thread "main" java.lang.ClassCastException: com.sun.xml.internal.stream.events.EntityReferenceEvent cannot be cast to javax.xml.st…

I suspect you have a database URL where you provide multiple parameters or something similar where you have specified illegal characters in the value of an XML node, things such as `&` should be escaped with their `&amp;` counterpart.
