I upgraded my project to use hibernate 5.2 and i am getting a parsing issue for hbmxml files on websphere only, it works fine on other environments.
I am getting the following error
Error accessing stax stream : origin()
org.hibernate.boot.MappingException: Error accessing stax stream : origin(<unknown>) at org.hibernate.boot.jaxb.internal.AbstractBinder.seekRootElementStartEvent(AbstractBinder.java:141) at org.hibernate.boot.jaxb.internal.AbstractBinder.doBind(AbstractBinder.java:101) at org.hibernate.boot.jaxb.internal.AbstractBinder.bind(AbstractBinder.java:84) at org.hibernate.boot.jaxb.internal.JaxpSourceXmlSource.doBind(JaxpSourceXmlSource.java:29) at org.hibernate.boot.MetadataSources.addDocument(MetadataSources.java:409) at org.hibernate.cfg.Configuration.addDocument(Configuration.java:462)
The generated xml file looks like this
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class entity-name="cregion" lazy="true" name="cfc.cfsuite.orm.di.crud.cud.entitynew.basictest.cregion" table="Region"> <id name="RegionID" type="int"> <column length="10" name="RegionID"/> </id> <property name="RegionDescription" type="string"> <column name="RegionDescription" not-null="true"/> </property> </class> </hibernate-mapping>
The only difference between earlier version[Hibernate 4.3] and new version[Hibernate 5.2] is that the first delimiter in class name has been changed from : to . .
So earlier my class name was name=“cfc:cfsuite.orm.di.crud.cud.entitynew.basictest.cregion” and now it has been changed to name=“cfc.cfsuite.orm.di.crud.cud.entitynew.basictest.cregion”.
This change was done because Hibernate 5 uses JAXP due to which we were having parsing issue if the name contains : as delimiter so we changed it to .. This worked well on all other environments but is failing in websphere 9.
I tried lookig for this on StackOverflow and have validated that *.hbmxml file generation is proper and the dtd are also accessible from the environment.
Any help in this regard will be highly appreciated.