Showing posts with label xml. Show all posts
Showing posts with label xml. Show all posts

Java Encoding XML

 Java Encoding XML


InputSource isc = new InputSource(new StringReader(content));
isc.setEncoding("ISO-8859-1");

put this line on xml file.

<?xml version="1.0" encoding="ISO-8859-1"?> 
 

JPA Error Provider

 JPA Error Provider


java.io.IOException: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 15; Deployment descriptor file META-INF/persistence.xml in archive [classes].  cvc-complex-type.2.4.a: Invalid content was found starting with element 'provider'. One of '{"http://xmlns.jcp.org/xml/ns/persistence":non-jta-data-


Order of elements inside <persistence-unit> is important, <jta-data-source> should go after <provider>:

Example:
 
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>JNDI_data_mysql</jta-data-source>