cancel
Showing results for 
Search instead for 
Did you mean: 

Got SAXParseException as called repository getStores API

winson
Champ in-the-making
Champ in-the-making
Hi,

I'm playing with web service sample Java program (GetStores.java)  that uses web service APIs to retrieve store information from server.  But I always receive  SAXParseException of "The markup in the document following the root element must be well-formed".  The full calling stack is as follow.

org.apache.axis.AxisFault: org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
Exception in thread "main" AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
faultActor:
faultNode:
faultDetail:
   {http://xml.apache.org/axis/}stackTraceSmiley Surprisedrg.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
   at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
   at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
   at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
   at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
   at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
   at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
   at org.apache.axis.server.AxisServer.initSOAPConstants(AxisServer.java:345)
   at org.apache.axis.server.AxisServer.invoke(AxisServer.java:279)
   at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   at java.lang.Thread.run(Unknown Source)

   {http://xml.apache.org/axis/}hostname:Megaserver

org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
   at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
   at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
   at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
   at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1326)
   at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:340)
   at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:307)
   at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:212)
   at oracle.xml.jaxp.JXSAXParser.parse(JXSAXParser.java:292)
   at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
   at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
   at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
   at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
   at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
   at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
   at org.apache.axis.client.Call.invoke(Call.java:2767)
   at org.apache.axis.client.Call.invoke(Call.java:2443)
   at org.apache.axis.client.Call.invoke(Call.java:2366)
   at org.apache.axis.client.Call.invoke(Call.java:1812)
   at org.alfresco.webservice.repository.RepositoryServiceSoapBindingStub.update(RepositoryServiceSoapBindingStub.java:986)
   at oracle.alminternal.view.TestSample.main(TestSample.java:55)


From the network sniffer, I got the getStore request with extra end document tag as it was shown in bold below.  The same exception seems to also happen to other API, such as repository update API.  Would someone help me resolve this or point me to the direction that I can find the solution?  Thanks a lot.

BTW, I'm using Alfresco 2.1 server and client.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Header>
  <wsseSmiley Frustratedecurity xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1">
  <wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-16551541">
  <wsse:Username>ticket</wsse:Username>
  <wsseSmiley Tongueassword Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">
  TICKET_df658c1812fe628e07f4dcbb87e38de300095405
  </wsseSmiley Tongueassword>
  </wsse:UsernameToken>
  </wsseSmiley Frustratedecurity>
  </soapenv:Header>
  <soapenv:Body>
    <getStores xmlns="http://www.alfresco.org/ws/service/repository/1.0">
    </getStores>
  </soapenv:Body>
</soapenv:Envelope>
</#document>
11 REPLIES 11

ghost
Champ in-the-making
Champ in-the-making
Hi winson ,

I have the same issue.

Some details about how am I getting it:

I have some code. When I run it as a standalone application ( from the command line, with main() ) everything works. The XML request does not contain the </#document> closing tag.

However when I try to run the same code, using the same libraries in oracle application server I am getting this strange </#document> tag.

I tried everything, triple checked the libs versions, their implementations, etc.

Really strange.

Is it possible that you give me some details about how are you running your code ?

Perhaps we can exchange some sample codes and see if we can make them run.

Cheers,
Deyan

vnma
Champ in-the-making
Champ in-the-making
I get the same error.

I am developing a simple application with oracle jdeveloper. The app has just one button on a jsf page, the idea is that the user clicks that button to create a document in the alfresco repository. To insert the document I thought to use the web services API. But the update statement

            UpdateResult[] results = WebServiceFactory.getRepositoryService().update(cml);    

triggers the mentioned error

08/03/03 09:56:39 AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
faultActor:
faultNode:
faultDetail:
   {http://xml.apache.org/axis/}stackTraceSmiley Surprisedrg.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
   at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
   at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)

rwetherall
Confirmed Champ
Confirmed Champ
Hi,

This sounds like an issue that's only occuring when executed in a perticular environment.

The best course of action here is to create a JIRA issue at http://issues.alfresco.com  When creating the issue please give details of the error seen, the environments you have seen the issue on and any unit tests/smaple code that many help to reproduce the problem.

Cheers,
Roy

albgongar
Champ in-the-making
Champ in-the-making
I've got the same problem

I'm running an 10g Oracle application server and when I run in a standalone mode (using main()) I can write files with the web service.

has anyone find a solution?

marcus
Champ in-the-making
Champ in-the-making
Bumping in hope of someone finding a solution… anyone!

alcibiade
Champ in-the-making
Champ in-the-making
We got the same issue here on Oracle Application Server: This problem comes from a confusion between Oracle XML libs and the one used by your application.

You should try disabling the oracle.xml shared lib for your application. This can be done by setting the file EarContent/META-INF/orion-application.xml to:

<?xml version="1.0" encoding="UTF-8"?>
<orion-application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-application-10_0.xsd">
   <imported-shared-libraries>
      <remove-inherited name="oracle.xml">
      </remove-inherited>
      <!– Removing oracle.xml allows the use of the Alfresco WS API in OC4J by preventing the
      "The markup in the document following the root element must be well-formed." SAXParseException
      caused by a "</#document>" erroneously added to each XML request after the authentication one. –>
      <!–remove-inherited name="oracle.xml.security">
      </remove-inherited–>
      <!– Removing oracle.xml and oracle.xml.security is needed for JBoss RichFaces css to work in OC4J. –>
   </imported-shared-libraries>
</orion-application>

dipesh_mca
Champ in-the-making
Champ in-the-making
I'm facing the same problem. The solution posted here didn't work for me. Did it work for anyone of you? Has anyone found  a different solution to this problem?

We are using axis 1.4 for our Web Services.
Ever since we migrated our application from Tomcat 6.0 to Oracle Application Server 10.3 (OC4J), SOAP requests being generated have an additional tag '</#document>' appended to them. Hence the web service calls are failing.





Here's the error dump:

AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (400)Bad Request
faultActor:
faultNode:
faultDetail:
{}:return code: 400

{http://xml.apache.org/axis/}HttpErrorCode:400

(400)Bad Request
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812



I have spent a lot of time on this problem, but nothing worked. I would appreciate any kind of suggestions.



Thanks,

Dipesh

marcus
Champ in-the-making
Champ in-the-making
From a colleague of mine in passing…

- Deselect 'Inherit parent application's shared library imports'
- Select the following libraries:
– cryptix
– Oracle.jdbc

dipesh_mca
Champ in-the-making
Champ in-the-making
Reapplied the solution of orion-application.xml after taking the latest code again….this time it worked. I guess the R & D i did, messed up the code even more.