Search code examples
liferayliferay-service-builder

Liferay Service Builder SaxException


I get an error when I build my service:

org.apache.axis.ConfigurationException: org.xml.sax.SAXException: Fatal Error: URI=null Line=1258: The content of elements must consist of well-formed character data or markup.
org.xml.sax.SAXException: Fatal Error: URI=null Line=1258: The content of elements must consist of well-formed character data or markup.
at org.apache.axis.utils.XMLUtils$ParserErrorHandler.fatalError(XMLUtils.java:723)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)

I need some help. Thank you in advance


Solution

  • Quoting your error message:

    The content of elements must consist of well-formed character data or markup

    The best assumption is that you have invalid xml. A decent XML editor should be able to point you to the root cause by flagging the erroneous place in your file. If it really is in line 1258 (as the message says), it might be too large to ask to post the file here.

    Liferay's ServiceBuilder comes with a DTD which is typically referenced. This will make sure that the XML editor has enough information to validate the file. Make sure the DTD declaration matches the Liferay version that you compile to (that the SDK belongs to)