SAX parser error in my persistence.xml file -
i trying figure out error in persistence file , need expert guidance in helping me resolve this. persistence file looks like:
<?xml version="1.0" encoding="utf-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_1.xsd" version="2.1"> <persistence-unit name="archiveticket"> <provider>org.hibernate.ejb.hibernatepersistence</provider> <non-jta-data-source>jdbc/archivedbdatasource</non-jta-data-source> <class>blah blah</class> <class>blah blah</class> <class>blah blah</class> <class>blah blah</class> <class>blah blah</class> <class>blah blah</class> <class>blah blah</class> <properties> <property name="hibernate.query.factory_class" value="org.hibernate.hql.classic.classicquerytranslatorfactory"/> </properties> </persistence-unit> </persistence>
and error is:
org.springframework.beans.factory.xml.xmlbeandefinitionstoreexception: line 7 in xml document class path resource [archive-ticket-persistence.xml] invalid; nested exception org.xml.sax.saxparseexception; systemid: http://www.oracle.com/technetwork/java/index.html; linenumber: 7; columnnumber: 41; s4s-elt-character: non-whitespace characters not allowed in schema elements other 'xs:appinfo' , 'xs:documentation'. saw 'var _u = "undefined"; var g_httprelativewebroot = "/ocom/";'. @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.doloadbeandefinitions(xmlbeandefinitionreader.java:399) @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.loadbeandefinitions(xmlbeandefinitionreader.java:336) @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.loadbeandefinitions(xmlbeandefinitionreader.java:304) @ org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:181) @ org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:217) @ org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:188) @ org.springframework.context.annotation.configurationclassbeandefinitionreader.loadbeandefinitionsfromimportedresources(configurationclassbeandefinitionreader.java:347) @ org.springframework.context.annotation.configurationclassbeandefinitionreader.loadbeandefinitionsforconfigurationclass(configurationclassbeandefinitionreader.java:150) @ org.springframework.context.annotation.configurationclassbeandefinitionreader.loadbeandefinitions(configurationclassbeandefinitionreader.java:124) @ org.springframework.context.annotation.configurationclasspostprocessor.processconfigbeandefinitions(configurationclasspostprocessor.java:318) @ org.springframework.context.annotation.configurationclasspostprocessor.postprocessbeandefinitionregistry(configurationclasspostprocessor.java:239) @ org.springframework.context.support.postprocessorregistrationdelegate.invokebeandefinitionregistrypostprocessors(postprocessorregistrationdelegate.java:254) @ org.springframework.context.support.postprocessorregistrationdelegate.invokebeanfactorypostprocessors(postprocessorregistrationdelegate.java:94) @ org.springframework.context.support.abstractapplicationcontext.invokebeanfactorypostprocessors(abstractapplicationcontext.java:606) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:462) @ org.springframework.boot.context.embedded.embeddedwebapplicationcontext.refresh(embeddedwebapplicationcontext.java:118) @ org.springframework.boot.springapplication.refresh(springapplication.java:686) @ org.springframework.boot.springapplication.run(springapplication.java:320) @ org.springframework.boot.springapplication.run(springapplication.java:957) @ org.springframework.boot.springapplication.run(springapplication.java:946) @ application.main(application.java:12) caused by: org.xml.sax.saxparseexception: s4s-elt-character: non-whitespace characters not allowed in schema elements other 'xs:appinfo' , 'xs:documentation'. saw 'var _u = "undefined"; var g_httprelativewebroot = "/ocom/";'. @ com.sun.org.apache.xerces.internal.util.errorhandlerwrapper.createsaxparseexception(errorhandlerwrapper.java:198) @ com.sun.org.apache.xerces.internal.util.errorhandlerwrapper.error(errorhandlerwrapper.java:134) @ com.sun.org.apache.xerces.internal.impl.xmlerrorreporter.reporterror(xmlerrorreporter.java:437) @ com.sun.org.apache.xerces.internal.impl.xmlerrorreporter.reporterror(xmlerrorreporter.java:368) @ com.sun.org.apache.xerces.internal.impl.xs.opti.schemadomparser.characters(schemadomparser.java:198) @ com.sun.org.apache.xerces.internal.impl.xmldocumentfragmentscannerimpl.scandocument(xmldocumentfragmentscannerimpl.java:463) @ com.sun.org.apache.xerces.internal.impl.xs.opti.schemaparsingconfig.parse(schemaparsingconfig.java:629) @ com.sun.org.apache.xerces.internal.impl.xs.opti.schemaparsingconfig.parse(schemaparsingconfig.java:685) @ com.sun.org.apache.xerces.internal.impl.xs.opti.schemadomparser.parse(schemadomparser.java:530) @ com.sun.org.apache.xerces.internal.impl.xs.traversers.xsdhandler.getschemadocument(xsdhandler.java:2175) @ com.sun.org.apache.xerces.internal.impl.xs.traversers.xsdhandler.parseschema(xsdhandler.java:573) @ com.sun.org.apache.xerces.internal.impl.xs.xmlschemaloader.loadschema(xmlschemaloader.java:616) @ com.sun.org.apache.xerces.internal.impl.xs.xmlschemavalidator.findschemagrammar(xmlschemavalidator.java:2453) @ com.sun.org.apache.xerces.internal.impl.xs.xmlschemavalidator.handlestartelement(xmlschemavalidator.java:1772) @ com.sun.org.apache.xerces.internal.impl.xs.xmlschemavalidator.startelement(xmlschemavalidator.java:746) @ com.sun.org.apache.xerces.internal.impl.xmlnsdocumentscannerimpl.scanstartelement(xmlnsdocumentscannerimpl.java:378) @ com.sun.org.apache.xerces.internal.impl.xmlnsdocumentscannerimpl$nscontentdriver.scanrootelementhook(xmlnsdocumentscannerimpl.java:604) @ com.sun.org.apache.xerces.internal.impl.xmldocumentfragmentscannerimpl$fragmentcontentdriver.next(xmldocumentfragmentscannerimpl.java:3122) @ com.sun.org.apache.xerces.internal.impl.xmldocumentscannerimpl$prologdriver.next(xmldocumentscannerimpl.java:880) @ com.sun.org.apache.xerces.internal.impl.xmldocumentscannerimpl.next(xmldocumentscannerimpl.java:606) @ com.sun.org.apache.xerces.internal.impl.xmlnsdocumentscannerimpl.next(xmlnsdocumentscannerimpl.java:117) @ com.sun.org.apache.xerces.internal.impl.xmldocumentfragmentscannerimpl.scandocument(xmldocumentfragmentscannerimpl.java:510) @ com.sun.org.apache.xerces.internal.parsers.xml11configuration.parse(xml11configuration.java:848) @ com.sun.org.apache.xerces.internal.parsers.xml11configuration.parse(xml11configuration.java:777) @ com.sun.org.apache.xerces.internal.parsers.xmlparser.parse(xmlparser.java:141) @ com.sun.org.apache.xerces.internal.parsers.domparser.parse(domparser.java:243) @ com.sun.org.apache.xerces.internal.jaxp.documentbuilderimpl.parse(documentbuilderimpl.java:347) @ org.springframework.beans.factory.xml.defaultdocumentloader.loaddocument(defaultdocumentloader.java:76) @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.doloaddocument(xmlbeandefinitionreader.java:429) @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.doloadbeandefinitions(xmlbeandefinitionreader.java:391) ... 20 common frames omitted
i tried changing version , in vain. not sure whats wrong here. advice on solving helpful. thanks
i think what's happening here there no schema @ location http://java.sun.com/xml/ns/persistence/persistence_2_1.xsd, , when xml parser goes location looking schema, gets redirected html page on oracle web site cannot parsed schema; schema processor detects error when reads random javascript on html page, , therefore reports entirely unhelpful error message.
the correct schema location appears given here: how specify jpa 2.1 in persistence.xml?
Comments
Post a Comment