Skip to content

Loading document fails when used with a MetaData object with property set #646

@srinathgit

Description

@srinathgit

Loading document fails when used with a MetaData object with property set. If ".withProperty("docMeta-1", "true").withQuality(1)" is removed from DocumentMetadataHandle object, the documents are written fine.

@Test
public void addWithMetadata() throws Exception{
      
  final String query1 = "fn:count(fn:doc())";
      
  try{
    DocumentMetadataHandle meta6 = new DocumentMetadataHandle()
         .withCollections("Sample Collection 1").withProperty("docMeta-1", "true").withQuality(1);
    meta6.setFormat(Format.XML);
    Assert.assertTrue(dbClient.newServerEval().xquery(query1).eval().next().getNumber().intValue() == 0);

    Thread.currentThread().sleep(5000L);
    
    DatabaseClient dbClient = DatabaseClientFactory.newClient(host, port, user, password, Authentication.DIGEST);
    DataMovementManager dmManager = dbClient.newDataMovementManager();
    
    WriteBatcher ihb2 =  dmManager.newWriteBatcher();
    ihb2.withBatchSize(50).withThreadCount(1);
      
    ihb2.onBatchSuccess(
            batch -> {
              }
            )
            .onBatchFailure(
              (batch, throwable) -> {
                throwable.printStackTrace();
              
              }
    );
    for (int j =0 ;j < 1000; j++){
      String uri ="/local/string-"+ j;
      ihb2.addAs(uri , meta6,jsonNode);
    }
    
  
    ihb2.flushAndWait();
  
    Assert.assertTrue(dbClient.newServerEval().xquery(query1).eval().next().getNumber().intValue() == 1000);
    
  }
  catch(Exception e){
    e.printStackTrace();
  }
}

Log:



16:32:32.839 [main] DEBUG c.m.client.impl.JerseyServices - Connecting to localhost at 8000 as admin
16:32:33.535 [main] DEBUG c.m.client.impl.JerseyServices - Getting forestinfo as application/json
16:32:33.878 [main] DEBUG c.m.client.impl.JerseyServices - Posting eval
16:32:39.001 [main] DEBUG c.m.client.impl.JerseyServices - Connecting to localhost at 8000 as admin
16:32:39.251 [main] DEBUG c.m.client.impl.JerseyServices - Getting forestinfo as application/json
16:32:39.278 [main] INFO  c.m.c.d.impl.WriteBatcherImpl - (withForestConfig) Using [localhost] hosts with forests for "WriteHostBatcher"
16:32:39.283 [main] INFO  c.m.c.d.impl.WriteBatcherImpl - Adding DatabaseClient on port 8000 for host "localhost" to the rotation
16:32:39.325 [main] INFO  c.m.c.d.impl.WriteBatcherImpl - threadCount=1
16:32:39.325 [main] INFO  c.m.c.d.impl.WriteBatcherImpl - batchSize=50
16:32:39.412 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Posting documents
16:32:39.413 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Sending multipart for /v1/documents
16:32:39.419 [main] DEBUG c.m.client.impl.JerseyServices - Posting documents
16:32:39.420 [main] DEBUG c.m.client.impl.JerseyServices - Sending multipart for /v1/documents
16:32:43.731 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Posting documents
16:32:43.731 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Sending multipart for /v1/documents
16:32:43.733 [main] DEBUG c.m.client.impl.JerseyServices - Posting documents
16:32:43.734 [main] DEBUG c.m.client.impl.JerseyServices - Sending multipart for /v1/documents
com.sun.jersey.api.client.ClientHandlerException: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:184)
	at com.marklogic.client.impl.DigestChallengeFilter.handle(DigestChallengeFilter.java:34)
	at com.sun.jersey.api.client.filter.HTTPDigestAuthFilter.handle(HTTPDigestAuthFilter.java:493)
	at com.sun.jersey.api.client.Client.handle(Client.java:648)
	at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)
	at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
	at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:568)
	at com.marklogic.client.impl.JerseyServices.doPost(JerseyServices.java:3940)
	at com.marklogic.client.impl.JerseyServices.postResource(JerseyServices.java:3227)
	at com.marklogic.client.impl.JerseyServices.postBulkDocuments(JerseyServices.java:3345)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:619)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:611)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl$BatchWriter.run(WriteBatcherImpl.java:1032)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.marklogic.client.io.DocumentMetadataHandle$ValueSerializer.process(DocumentMetadataHandle.java:904)
	at com.marklogic.client.impl.ValueConverter.convertFromJava(ValueConverter.java:270)
	at com.marklogic.client.impl.ValueConverter.convertFromJava(ValueConverter.java:87)
	at com.marklogic.client.io.DocumentMetadataHandle.sendPropertiesImpl(DocumentMetadataHandle.java:873)
	at com.marklogic.client.io.DocumentMetadataHandle.sendMetadataImpl(DocumentMetadataHandle.java:776)
	at com.marklogic.client.io.DocumentMetadataHandle.write(DocumentMetadataHandle.java:559)
	at com.marklogic.client.impl.StreamingOutputImpl.write(StreamingOutputImpl.java:48)
	at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71)
	at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57)
	at com.sun.jersey.multipart.impl.MultiPartWriter.writeTo(MultiPartWriter.java:218)
	at com.sun.jersey.multipart.impl.MultiPartWriter.writeTo(MultiPartWriter.java:71)
	at com.sun.jersey.api.client.RequestWriter$RequestEntityWriterImpl.writeRequestEntity(RequestWriter.java:231)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler$2.writeTo(ApacheHttpClient4Handler.java:262)
	at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:96)
	at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108)
	at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:120)
	at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:263)
	at org.apache.http.impl.conn.AbstractClientConnAdapter.sendRequestEntity(AbstractClientConnAdapter.java:227)
	at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:255)
	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
	at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:776)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:170)
	... 19 more
Caused by: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1564)
	at com.ctc.wstx.sw.RepairingNsStreamWriter.writeAttribute(RepairingNsStreamWriter.java:124)
	at com.marklogic.client.io.DocumentMetadataHandle$ValueSerializer.process(DocumentMetadataHandle.java:900)
	... 43 more
com.sun.jersey.api.client.ClientHandlerException: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:184)
	at com.marklogic.client.impl.DigestChallengeFilter.handle(DigestChallengeFilter.java:34)
	at com.sun.jersey.api.client.filter.HTTPDigestAuthFilter.handle(HTTPDigestAuthFilter.java:493)
	at com.sun.jersey.api.client.Client.handle(Client.java:648)
	at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)
	at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
	at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:568)
	at com.marklogic.client.impl.JerseyServices.doPost(JerseyServices.java:3940)
	at com.marklogic.client.impl.JerseyServices.postResource(JerseyServices.java:3227)
	at com.marklogic.client.impl.JerseyServices.postBulkDocuments(JerseyServices.java:3345)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:619)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:611)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl$BatchWriter.run(WriteBatcherImpl.java:1032)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.marklogic.client.io.DocumentMetadataHandle$ValueSerializer.process(DocumentMetadataHandle.java:904)
	at com.marklogic.client.impl.ValueConverter.convertFromJava(ValueConverter.java:270)
	at com.marklogic.client.impl.ValueConverter.convertFromJava(ValueConverter.java:87)
	at com.marklogic.client.io.DocumentMetadataHandle.sendPropertiesImpl(DocumentMetadataHandle.java:873)
	at com.marklogic.client.io.DocumentMetadataHandle.sendMetadataImpl(DocumentMetadataHandle.java:776)
	at com.marklogic.client.io.DocumentMetadataHandle.write(DocumentMetadataHandle.java:559)
	at com.marklogic.client.impl.StreamingOutputImpl.write(StreamingOutputImpl.java:48)
	at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71)
	at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57)
	at com.sun.jersey.multipart.impl.MultiPartWriter.writeTo(MultiPartWriter.java:218)
	at com.sun.jersey.multipart.impl.MultiPartWriter.writeTo(MultiPartWriter.java:71)
	at com.sun.jersey.api.client.RequestWriter$RequestEntityWriterImpl.writeRequestEntity(RequestWriter.java:231)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler$2.writeTo(ApacheHttpClient4Handler.java:262)
	at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:96)
	at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108)
	at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:120)
	at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:263)
	at org.apache.http.impl.conn.AbstractClientConnAdapter.sendRequestEntity(AbstractClientConnAdapter.java:227)
	at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:255)
	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
	at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:776)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:170)
	... 19 more
Caused by: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1564)
	at com.ctc.wstx.sw.RepairingNsStreamWriter.writeAttribute(RepairingNsStreamWriter.java:124)
	at com.marklogic.client.io.DocumentMetadataHandle$ValueSerializer.process(DocumentMetadataHandle.java:900)
	... 43 more
com.sun.jersey.api.client.ClientHandlerException: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:184)
	at com.marklogic.client.impl.DigestChallengeFilter.handle(DigestChallengeFilter.java:34)
	at com.sun.jersey.api.client.filter.HTTPDigestAuthFilter.handle(HTTPDigestAuthFilter.java:493)
	at com.sun.jersey.api.client.Client.handle(Client.java:648)
	at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)
	at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
	at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:568)
	at com.marklogic.client.impl.JerseyServices.doPost(JerseyServices.java:3940)
	at com.marklogic.client.impl.JerseyServices.postResource(JerseyServices.java:3227)
	at com.marklogic.client.impl.JerseyServices.postBulkDocuments(JerseyServices.java:3345)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:619)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:611)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl$BatchWriter.run(WriteBatcherImpl.java:1032)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.marklogic.client.io.DocumentMetadataHandle$ValueSerializer.process(DocumentMetadataHandle.java:904)
	at com.marklogic.client.impl.ValueConverter.convertFromJava(ValueConverter.java:270)
	at com.marklogic.client.impl.ValueConverter.convertFromJava(ValueConverter.java:87)
	at com.marklogic.client.io.DocumentMetadataHandle.sendPropertiesImpl(DocumentMetadataHandle.java:873)
	at com.marklogic.client.io.DocumentMetadataHandle.sendMetadataImpl(DocumentMetadataHandle.java:776)
	at com.marklogic.client.io.DocumentMetadataHandle.write(DocumentMetadataHandle.java:559)
	at com.marklogic.client.impl.StreamingOutputImpl.write(StreamingOutputImpl.java:48)
	at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71)
	at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57)
	at com.sun.jersey.multipart.impl.MultiPartWriter.writeTo(MultiPartWriter.java:218)
	at com.sun.jersey.multipart.impl.MultiPartWriter.writeTo(MultiPartWriter.java:71)
	at com.sun.jersey.api.client.RequestWriter$RequestEntityWriterImpl.writeRequestEntity(RequestWriter.java:231)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler$2.writeTo(ApacheHttpClient4Handler.java:262)
	at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:96)
	at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108)
	at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:120)
	at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:263)
	at org.apache.http.impl.conn.AbstractClientConnAdapter.sendRequestEntity(AbstractClientConnAdapter.java:227)
	at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:255)
	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
	at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:776)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:170)
	... 19 more
Caused by: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1564)
	at com.ctc.wstx.sw.RepairingNsStreamWriter.writeAttribute(RepairingNsStreamWriter.java:124)
	at com.marklogic.client.io.DocumentMetadataHandle$ValueSerializer.process(DocumentMetadataHandle.java:900)
	... 43 more
com.sun.jersey.api.client.ClientHandlerException: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:184)
	at com.marklogic.client.impl.DigestChallengeFilter.handle(DigestChallengeFilter.java:34)
	at com.sun.jersey.api.client.filter.HTTPDigestAuthFilter.handle(HTTPDigestAuthFilter.java:493)
	at com.sun.jersey.api.client.Client.handle(Client.java:648)
	at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)
	at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
	at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:568)
	at com.marklogic.client.impl.JerseyServices.doPost(JerseyServices.java:3940)
	at com.marklogic.client.impl.JerseyServices.postResource(JerseyServices.java:3227)
	at com.marklogic.client.impl.JerseyServices.postBulkDocuments(JerseyServices.java:3345)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:619)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:611)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl$BatchWriter.run(WriteBatcherImpl.java:1032)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.marklogic.client.io.DocumentMetadataHandle$ValueSerializer.process(DocumentMetadataHandle.java:904)
	at com.marklogic.client.impl.ValueConverter.convertFromJava(ValueConverter.java:270)
	at com.marklogic.client.impl.ValueConverter.convertFromJava(ValueConverter.java:87)
	at com.marklogic.client.io.DocumentMetadataHandle.sendPropertiesImpl(DocumentMetadataHandle.java:873)
	at com.marklogic.client.io.DocumentMetadataHandle.sendMetadataImpl(DocumentMetadataHandle.java:776)
	at com.marklogic.client.io.DocumentMetadataHandle.write(DocumentMetadataHandle.java:559)
	at com.marklogic.client.impl.StreamingOutputImpl.write(StreamingOutputImpl.java:48)
	at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71)
	at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57)
	at com.sun.jersey.multipart.impl.MultiPartWriter.writeTo(MultiPartWriter.java:218)
	at com.sun.jersey.multipart.impl.MultiPartWriter.writeTo(MultiPartWriter.java:71)
	at com.sun.jersey.api.client.RequestWriter$RequestEntityWriterImpl.writeRequestEntity(RequestWriter.java:231)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler$2.writeTo(ApacheHttpClient4Handler.java:262)
	at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:96)
	at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108)
	at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:120)
	at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:263)
	at org.apache.http.impl.conn.AbstractClientConnAdapter.sendRequestEntity(AbstractClientConnAdapter.java:227)
	at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:255)
	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
	at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:776)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:170)
	... 19 more
Caused by: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1564)
	at com.ctc.wstx.sw.RepairingNsStreamWriter.writeAttribute(RepairingNsStreamWriter.java:124)
	at com.marklogic.client.io.DocumentMetadataHandle$ValueSerializer.process(DocumentMetadataHandle.java:900)
	... 43 more
16:32:43.746 [pool-1-thread-1] WARN  c.m.c.d.impl.WriteBatcherImpl - Error writing batch: com.sun.jersey.api.client.ClientHandlerException: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
16:32:43.748 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Posting documents
16:32:43.748 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Sending multipart for /v1/documents
16:32:43.756 [pool-1-thread-1] WARN  c.m.c.d.impl.WriteBatcherImpl - Error writing batch: com.sun.jersey.api.client.ClientHandlerException: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
16:32:43.758 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Posting documents
16:32:43.758 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Sending multipart for /v1/documents
16:32:43.767 [pool-1-thread-1] WARN  c.m.c.d.impl.WriteBatcherImpl - Error writing batch: com.sun.jersey.api.client.ClientHandlerException: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
16:32:43.769 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Posting documents
16:32:43.770 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Sending multipart for /v1/documents
16:32:43.783 [pool-1-thread-1] WARN  c.m.c.d.impl.WriteBatcherImpl - Error writing batch: com.sun.jersey.api.client.ClientHandlerException: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
16:32:43.785 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Posting documents
16:32:43.786 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Sending multipart for /v1/documents
16:32:44.198 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Posting documents
16:32:44.199 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Sending multipart for /v1/documents
16:32:44.753 [main] WARN  c.m.c.d.impl.WriteBatcherImpl - Error writing batch: com.marklogic.client.FailedRequestException: Local message: failed to apply resource at documents: Bad Request. Server Message: XDMP-DOCSTARTTAGCHAR: xdmp:get-request-part-body("xml") -- Unexpected character "&quot;" in start tag at  line 1
com.marklogic.client.FailedRequestException: Local message: failed to apply resource at documents: Bad Request. Server Message: XDMP-DOCSTARTTAGCHAR: xdmp:get-request-part-body("xml") -- Unexpected character "&quot;" in start tag at  line 1
	at com.marklogic.client.impl.JerseyServices.checkStatus(JerseyServices.java:4243)
	at com.marklogic.client.impl.JerseyServices.postResource(JerseyServices.java:3257)
	at com.marklogic.client.impl.JerseyServices.postBulkDocuments(JerseyServices.java:3345)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:619)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:611)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl$BatchWriter.run(WriteBatcherImpl.java:1032)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy.rejectedExecution(ThreadPoolExecutor.java:2022)
	at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:823)
	at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1369)
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl.add(WriteBatcherImpl.java:292)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl.addAs(WriteBatcherImpl.java:320)
	at com.marklogic.client.datamovement.functionaltests.WriteHostBatcherTest.addWithMetadata(WriteHostBatcherTest.java:2458)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
16:32:44.756 [main] DEBUG c.m.client.impl.JerseyServices - Posting documents
16:32:44.756 [main] DEBUG c.m.client.impl.JerseyServices - Sending multipart for /v1/documents
16:32:44.768 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Posting documents
16:32:44.768 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Sending multipart for /v1/documents
com.marklogic.client.FailedRequestException: Local message: failed to apply resource at documents: Bad Request. Server Message: XDMP-DOCSTARTTAGCHAR: xdmp:get-request-part-body("xml") -- Unexpected character "&quot;" in start tag at  line 1
16:32:44.852 [main] WARN  c.m.c.d.impl.WriteBatcherImpl - Error writing batch: com.marklogic.client.FailedRequestException: Local message: failed to apply resource at documents: Bad Request. Server Message: XDMP-DOCSTARTTAGCHAR: xdmp:get-request-part-body("xml") -- Unexpected character "&quot;" in start tag at  line 1
16:32:44.854 [main] DEBUG c.m.client.impl.JerseyServices - Posting documents
16:32:44.854 [main] DEBUG c.m.client.impl.JerseyServices - Sending multipart for /v1/documents
	at com.marklogic.client.impl.JerseyServices.checkStatus(JerseyServices.java:4243)
	at com.marklogic.client.impl.JerseyServices.postResource(JerseyServices.java:3257)
	at com.marklogic.client.impl.JerseyServices.postBulkDocuments(JerseyServices.java:3345)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:619)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:611)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl$BatchWriter.run(WriteBatcherImpl.java:1032)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy.rejectedExecution(ThreadPoolExecutor.java:2022)
	at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:823)
	at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1369)
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl.add(WriteBatcherImpl.java:292)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl.addAs(WriteBatcherImpl.java:320)
	at com.marklogic.client.datamovement.functionaltests.WriteHostBatcherTest.addWithMetadata(WriteHostBatcherTest.java:2458)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
com.marklogic.client.FailedRequestException: Local message: failed to apply resource at documents: Bad Request. Server Message: XDMP-DOCSTARTTAGCHAR: xdmp:get-request-part-body("xml") -- Unexpected character "&quot;" in start tag at  line 1
	at com.marklogic.client.impl.JerseyServices.checkStatus(JerseyServices.java:4243)
	at com.marklogic.client.impl.JerseyServices.postResource(JerseyServices.java:3257)
	at com.marklogic.client.impl.JerseyServices.postBulkDocuments(JerseyServices.java:3345)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:619)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:611)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl$BatchWriter.run(WriteBatcherImpl.java:1032)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
16:32:44.859 [pool-1-thread-1] WARN  c.m.c.d.impl.WriteBatcherImpl - Error writing batch: com.marklogic.client.FailedRequestException: Local message: failed to apply resource at documents: Bad Request. Server Message: XDMP-DOCSTARTTAGCHAR: xdmp:get-request-part-body("xml") -- Unexpected character "&quot;" in start tag at  line 1
16:32:44.860 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Posting documents
16:32:44.860 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Sending multipart for /v1/documents
com.sun.jersey.api.client.ClientHandlerException: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:184)
	at com.marklogic.client.impl.DigestChallengeFilter.handle(DigestChallengeFilter.java:34)
	at com.sun.jersey.api.client.filter.HTTPDigestAuthFilter.handle(HTTPDigestAuthFilter.java:493)
	at com.sun.jersey.api.client.Client.handle(Client.java:648)
	at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)
	at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
	at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:568)
	at com.marklogic.client.impl.JerseyServices.doPost(JerseyServices.java:3940)
	at com.marklogic.client.impl.JerseyServices.postResource(JerseyServices.java:3227)
	at com.marklogic.client.impl.JerseyServices.postBulkDocuments(JerseyServices.java:3345)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:619)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:611)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl$BatchWriter.run(WriteBatcherImpl.java:1032)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.marklogic.client.io.DocumentMetadataHandle$ValueSerializer.process(DocumentMetadataHandle.java:904)
	at com.marklogic.client.impl.ValueConverter.convertFromJava(ValueConverter.java:270)
	at com.marklogic.client.impl.ValueConverter.convertFromJava(ValueConverter.java:87)
	at com.marklogic.client.io.DocumentMetadataHandle.sendPropertiesImpl(DocumentMetadataHandle.java:873)
	at com.marklogic.client.io.DocumentMetadataHandle.sendMetadataImpl(DocumentMetadataHandle.java:776)
	at com.marklogic.client.io.DocumentMetadataHandle.write(DocumentMetadataHandle.java:559)
	at com.marklogic.client.impl.StreamingOutputImpl.write(StreamingOutputImpl.java:48)
	at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71)
	at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57)
	at com.sun.jersey.multipart.impl.MultiPartWriter.writeTo(MultiPartWriter.java:218)
	at com.sun.jersey.multipart.impl.MultiPartWriter.writeTo(MultiPartWriter.java:71)
	at com.sun.jersey.api.client.RequestWriter$RequestEntityWriterImpl.writeRequestEntity(RequestWriter.java:231)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler$2.writeTo(ApacheHttpClient4Handler.java:262)
	at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:96)
	at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108)
	at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:120)
	at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:263)
	at org.apache.http.impl.conn.AbstractClientConnAdapter.sendRequestEntity(AbstractClientConnAdapter.java:227)
	at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:255)
	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
	at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:776)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:170)
	... 19 more
Caused by: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1564)
	at com.ctc.wstx.sw.RepairingNsStreamWriter.writeAttribute(RepairingNsStreamWriter.java:124)
	at com.marklogic.client.io.DocumentMetadataHandle$ValueSerializer.process(DocumentMetadataHandle.java:900)
	... 43 more
com.sun.jersey.api.client.ClientHandlerException: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:184)
	at com.marklogic.client.impl.DigestChallengeFilter.handle(DigestChallengeFilter.java:34)
	at com.sun.jersey.api.client.filter.HTTPDigestAuthFilter.handle(HTTPDigestAuthFilter.java:493)
	at com.sun.jersey.api.client.Client.handle(Client.java:648)
	at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)
	at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
	at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:568)
	at com.marklogic.client.impl.JerseyServices.doPost(JerseyServices.java:3940)
	at com.marklogic.client.impl.JerseyServices.postResource(JerseyServices.java:3227)
	at com.marklogic.client.impl.JerseyServices.postBulkDocuments(JerseyServices.java:3345)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:619)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:611)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl$BatchWriter.run(WriteBatcherImpl.java:1032)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy.rejectedExecution(ThreadPoolExecutor.java:2022)
	at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:823)
	at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1369)
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl.add(WriteBatcherImpl.java:292)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl.addAs(WriteBatcherImpl.java:320)
	at com.marklogic.client.datamovement.functionaltests.WriteHostBatcherTest.addWithMetadata(WriteHostBatcherTest.java:2458)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.marklogic.client.io.DocumentMetadataHandle$ValueSerializer.process(DocumentMetadataHandle.java:904)
	at com.marklogic.client.impl.ValueConverter.convertFromJava(ValueConverter.java:270)
	at com.marklogic.client.impl.ValueConverter.convertFromJava(ValueConverter.java:87)
	at com.marklogic.client.io.DocumentMetadataHandle.sendPropertiesImpl(DocumentMetadataHandle.java:873)
	at com.marklogic.client.io.DocumentMetadataHandle.sendMetadataImpl(DocumentMetadataHandle.java:776)
	at com.marklogic.client.io.DocumentMetadataHandle.write(DocumentMetadataHandle.java:559)
	at com.marklogic.client.impl.StreamingOutputImpl.write(StreamingOutputImpl.java:48)
	at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71)
	at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57)
	at com.sun.jersey.multipart.impl.MultiPartWriter.writeTo(MultiPartWriter.java:218)
	at com.sun.jersey.multipart.impl.MultiPartWriter.writeTo(MultiPartWriter.java:71)
	at com.sun.jersey.api.client.RequestWriter$RequestEntityWriterImpl.writeRequestEntity(RequestWriter.java:231)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler$2.writeTo(ApacheHttpClient4Handler.java:262)
	at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:96)
	at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108)
	at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:120)
	at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:263)
	at org.apache.http.impl.conn.AbstractClientConnAdapter.sendRequestEntity(AbstractClientConnAdapter.java:227)
	at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:255)
	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
	at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:776)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:170)
	... 50 more
Caused by: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1564)
	at com.ctc.wstx.sw.RepairingNsStreamWriter.writeAttribute(RepairingNsStreamWriter.java:124)
	at com.marklogic.client.io.DocumentMetadataHandle$ValueSerializer.process(DocumentMetadataHandle.java:900)
	... 74 more
16:32:44.887 [pool-1-thread-1] WARN  c.m.c.d.impl.WriteBatcherImpl - Error writing batch: com.sun.jersey.api.client.ClientHandlerException: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
16:32:44.888 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Posting documents
16:32:44.888 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Sending multipart for /v1/documents
16:32:44.899 [main] WARN  c.m.c.d.impl.WriteBatcherImpl - Error writing batch: com.sun.jersey.api.client.ClientHandlerException: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
16:32:44.900 [main] DEBUG c.m.client.impl.JerseyServices - Posting documents
16:32:44.901 [main] DEBUG c.m.client.impl.JerseyServices - Sending multipart for /v1/documents
16:32:44.936 [pool-1-thread-1] WARN  c.m.c.d.impl.WriteBatcherImpl - Error writing batch: com.sun.jersey.api.client.ClientHandlerException: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
com.sun.jersey.api.client.ClientHandlerException: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:184)
	at com.marklogic.client.impl.DigestChallengeFilter.handle(DigestChallengeFilter.java:34)
	at com.sun.jersey.api.client.filter.HTTPDigestAuthFilter.handle(HTTPDigestAuthFilter.java:493)
	at com.sun.jersey.api.client.Client.handle(Client.java:648)
	at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)
	at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
	at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:568)
	at com.marklogic.client.impl.JerseyServices.doPost(JerseyServices.java:3940)
	at com.marklogic.client.impl.JerseyServices.postResource(JerseyServices.java:3227)
	at com.marklogic.client.impl.JerseyServices.postBulkDocuments(JerseyServices.java:3345)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:619)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:611)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl$BatchWriter.run(WriteBatcherImpl.java:1032)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.marklogic.client.io.DocumentMetadataHandle$ValueSerializer.process(DocumentMetadataHandle.java:904)
	at com.marklogic.client.impl.ValueConverter.convertFromJava(ValueConverter.java:270)
	at com.marklogic.client.impl.ValueConverter.convertFromJava(ValueConverter.java:87)
	at com.marklogic.client.io.DocumentMetadataHandle.sendPropertiesImpl(DocumentMetadataHandle.java:873)
	at com.marklogic.client.io.DocumentMetadataHandle.sendMetadataImpl(DocumentMetadataHandle.java:776)
	at com.marklogic.client.io.DocumentMetadataHandle.write(DocumentMetadataHandle.java:559)
	at com.marklogic.client.impl.StreamingOutputImpl.write(StreamingOutputImpl.java:48)
	at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71)
	at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57)
	at com.sun.jersey.multipart.impl.MultiPartWriter.writeTo(MultiPartWriter.java:218)
	at com.sun.jersey.multipart.impl.MultiPartWriter.writeTo(MultiPartWriter.java:71)
	at com.sun.jersey.api.client.RequestWriter$RequestEntityWriterImpl.writeRequestEntity(RequestWriter.java:231)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler$2.writeTo(ApacheHttpClient4Handler.java:262)
	at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:96)
	at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108)
	at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:120)
	at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:263)
	at org.apache.http.impl.conn.AbstractClientConnAdapter.sendRequestEntity(AbstractClientConnAdapter.java:227)
	at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:255)
	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
	at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:776)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:170)
	... 19 more
Caused by: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1564)
	at com.ctc.wstx.sw.RepairingNsStreamWriter.writeAttribute(RepairingNsStreamWriter.java:124)
	at com.marklogic.client.io.DocumentMetadataHandle$ValueSerializer.process(DocumentMetadataHandle.java:900)
	... 43 more
16:32:44.937 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Posting documents
16:32:44.937 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Sending multipart for /v1/documents
16:32:45.127 [main] INFO  c.m.c.d.impl.WriteBatcherImpl - flushing 0 queued docs
16:32:45.129 [pool-3-thread-1] DEBUG c.m.client.impl.JerseyServices - Posting documents
16:32:45.130 [pool-3-thread-1] DEBUG c.m.client.impl.JerseyServices - Sending multipart for /v1/documents
16:32:45.160 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Posting documents
16:32:45.160 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Sending multipart for /v1/documents
com.sun.jersey.api.client.ClientHandlerException: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:184)
	at com.marklogic.client.impl.DigestChallengeFilter.handle(DigestChallengeFilter.java:34)
	at com.sun.jersey.api.client.filter.HTTPDigestAuthFilter.handle(HTTPDigestAuthFilter.java:493)
	at com.sun.jersey.api.client.filter.HTTPDigestAuthFilter.handle(HTTPDigestAuthFilter.java:539)
	at com.sun.jersey.api.client.Client.handle(Client.java:648)
	at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)
	at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
	at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:568)
	at com.marklogic.client.impl.JerseyServices.doPost(JerseyServices.java:3940)
	at com.marklogic.client.impl.JerseyServices.postResource(JerseyServices.java:3227)
	at com.marklogic.client.impl.JerseyServices.postBulkDocuments(JerseyServices.java:3345)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:619)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:611)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl$BatchWriter.run(WriteBatcherImpl.java:1032)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl.lambda$5(WriteBatcherImpl.java:658)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.marklogic.client.io.DocumentMetadataHandle$ValueSerializer.process(DocumentMetadataHandle.java:904)
	at com.marklogic.client.impl.ValueConverter.convertFromJava(ValueConverter.java:270)
	at com.marklogic.client.impl.ValueConverter.convertFromJava(ValueConverter.java:87)
	at com.marklogic.client.io.DocumentMetadataHandle.sendPropertiesImpl(DocumentMetadataHandle.java:873)
	at com.marklogic.client.io.DocumentMetadataHandle.sendMetadataImpl(DocumentMetadataHandle.java:776)
	at com.marklogic.client.io.DocumentMetadataHandle.write(DocumentMetadataHandle.java:559)
	at com.marklogic.client.impl.StreamingOutputImpl.write(StreamingOutputImpl.java:48)
	at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71)
	at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57)
	at com.sun.jersey.multipart.impl.MultiPartWriter.writeTo(MultiPartWriter.java:218)
	at com.sun.jersey.multipart.impl.MultiPartWriter.writeTo(MultiPartWriter.java:71)
	at com.sun.jersey.api.client.RequestWriter$RequestEntityWriterImpl.writeRequestEntity(RequestWriter.java:231)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler$2.writeTo(ApacheHttpClient4Handler.java:262)
	at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:96)
	at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108)
	at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:120)
	at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:263)
	at org.apache.http.impl.conn.AbstractClientConnAdapter.sendRequestEntity(AbstractClientConnAdapter.java:227)
	at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:255)
	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
	at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:776)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:170)
	... 22 more
Caused by: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1564)
	at com.ctc.wstx.sw.RepairingNsStreamWriter.writeAttribute(RepairingNsStreamWriter.java:124)
	at com.marklogic.client.io.DocumentMetadataHandle$ValueSerializer.process(DocumentMetadataHandle.java:900)
	... 46 more
16:32:45.169 [pool-3-thread-1] WARN  c.m.c.d.impl.WriteBatcherImpl - Error writing batch: com.sun.jersey.api.client.ClientHandlerException: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
16:32:45.170 [pool-3-thread-1] DEBUG c.m.client.impl.JerseyServices - Posting documents
16:32:45.170 [pool-3-thread-1] DEBUG c.m.client.impl.JerseyServices - Sending multipart for /v1/documents
com.sun.jersey.api.client.ClientHandlerException: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to output non-whitespace characters outside main element tree (in prolog or epilog)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:184)
	at com.marklogic.client.impl.DigestChallengeFilter.handle(DigestChallengeFilter.java:34)
	at com.sun.jersey.api.client.filter.HTTPDigestAuthFilter.handle(HTTPDigestAuthFilter.java:493)
	at com.sun.jersey.api.client.Client.handle(Client.java:648)
	at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)
	at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
	at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:568)
	at com.marklogic.client.impl.JerseyServices.doPost(JerseyServices.java:3940)
	at com.marklogic.client.impl.JerseyServices.postResource(JerseyServices.java:3227)
	at com.marklogic.client.impl.JerseyServices.postBulkDocuments(JerseyServices.java:3345)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:619)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:611)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl$BatchWriter.run(WriteBatcherImpl.java:1032)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to output non-whitespace characters outside main element tree (in prolog or epilog)
	at com.marklogic.client.io.DocumentMetadataHandle$ValueSerializer.process(DocumentMetadataHandle.java:904)
	at com.marklogic.client.impl.ValueConverter.convertFromJava(ValueConverter.java:270)
	at com.marklogic.client.impl.ValueConverter.convertFromJava(ValueConverter.java:87)
	at com.marklogic.client.io.DocumentMetadataHandle.sendPropertiesImpl(DocumentMetadataHandle.java:873)
	at com.marklogic.client.io.DocumentMetadataHandle.sendMetadataImpl(DocumentMetadataHandle.java:776)
	at com.marklogic.client.io.DocumentMetadataHandle.write(DocumentMetadataHandle.java:559)
	at com.marklogic.client.impl.StreamingOutputImpl.write(StreamingOutputImpl.java:48)
	at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71)
	at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57)
	at com.sun.jersey.multipart.impl.MultiPartWriter.writeTo(MultiPartWriter.java:218)
	at com.sun.jersey.multipart.impl.MultiPartWriter.writeTo(MultiPartWriter.java:71)
	at com.sun.jersey.api.client.RequestWriter$RequestEntityWriterImpl.writeRequestEntity(RequestWriter.java:231)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler$2.writeTo(ApacheHttpClient4Handler.java:262)
	at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:96)
	at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108)
	at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:120)
	at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:263)
	at org.apache.http.impl.conn.AbstractClientConnAdapter.sendRequestEntity(AbstractClientConnAdapter.java:227)
	at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:255)
	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
	at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:776)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:170)
	... 19 more
Caused by: javax.xml.stream.XMLStreamException: Trying to output non-whitespace characters outside main element tree (in prolog or epilog)
	at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1564)
	at com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1593)
	at com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:420)
	at com.marklogic.client.io.DocumentMetadataHandle$ValueSerializer.process(DocumentMetadataHandle.java:902)
	... 43 more
com.sun.jersey.api.client.ClientHandlerException: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:184)
	at com.marklogic.client.impl.DigestChallengeFilter.handle(DigestChallengeFilter.java:34)
	at com.sun.jersey.api.client.filter.HTTPDigestAuthFilter.handle(HTTPDigestAuthFilter.java:493)
	at com.sun.jersey.api.client.Client.handle(Client.java:648)
	at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)
	at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
	at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:568)
	at com.marklogic.client.impl.JerseyServices.doPost(JerseyServices.java:3940)
	at com.marklogic.client.impl.JerseyServices.postResource(JerseyServices.java:3227)
	at com.marklogic.client.impl.JerseyServices.postBulkDocuments(JerseyServices.java:3345)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:619)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:611)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl$BatchWriter.run(WriteBatcherImpl.java:1032)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.marklogic.client.io.DocumentMetadataHandle$ValueSerializer.process(DocumentMetadataHandle.java:904)
	at com.marklogic.client.impl.ValueConverter.convertFromJava(ValueConverter.java:270)
	at com.marklogic.client.impl.ValueConverter.convertFromJava(ValueConverter.java:87)
	at com.marklogic.client.io.DocumentMetadataHandle.sendPropertiesImpl(DocumentMetadataHandle.java:873)
	at com.marklogic.client.io.DocumentMetadataHandle.sendMetadataImpl(DocumentMetadataHandle.java:776)
	at com.marklogic.client.io.DocumentMetadataHandle.write(DocumentMetadataHandle.java:559)
	at com.marklogic.client.impl.StreamingOutputImpl.write(StreamingOutputImpl.java:48)
	at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71)
	at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57)
	at com.sun.jersey.multipart.impl.MultiPartWriter.writeTo(MultiPartWriter.java:218)
	at com.sun.jersey.multipart.impl.MultiPartWriter.writeTo(MultiPartWriter.java:71)
	at com.sun.jersey.api.client.RequestWriter$RequestEntityWriterImpl.writeRequestEntity(RequestWriter.java:231)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler$2.writeTo(ApacheHttpClient4Handler.java:262)
	at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:96)
	at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108)
	at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:120)
	at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:263)
	at org.apache.http.impl.conn.AbstractClientConnAdapter.sendRequestEntity(AbstractClientConnAdapter.java:227)
	at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:255)
	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
	at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:776)
	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:170)
	... 19 more
Caused by: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
	at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1564)
	at com.ctc.wstx.sw.RepairingNsStreamWriter.writeAttribute(RepairingNsStreamWriter.java:124)
	at com.marklogic.client.io.DocumentMetadataHandle$ValueSerializer.process(DocumentMetadataHandle.java:900)
	... 43 more
16:32:45.178 [pool-1-thread-1] WARN  c.m.c.d.impl.WriteBatcherImpl - Error writing batch: com.sun.jersey.api.client.ClientHandlerException: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to output non-whitespace characters outside main element tree (in prolog or epilog)
16:32:45.179 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Posting documents
16:32:45.180 [pool-1-thread-1] DEBUG c.m.client.impl.JerseyServices - Sending multipart for /v1/documents
16:32:45.183 [pool-1-thread-1] WARN  c.m.c.d.impl.WriteBatcherImpl - Error writing batch: com.sun.jersey.api.client.ClientHandlerException: com.marklogic.client.MarkLogicIOException: javax.xml.stream.XMLStreamException: Trying to write an attribute when there is no open start element.
com.marklogic.client.FailedRequestException: Local message: failed to apply resource at documents: Bad Request. Server Message: XDMP-DOCSTARTTAGCHAR: xdmp:get-request-part-body("xml") -- Unexpected character "&quot;" in start tag at  line 1
	at com.marklogic.client.impl.JerseyServices.checkStatus(JerseyServices.java:4243)
	at com.marklogic.client.impl.JerseyServices.postResource(JerseyServices.java:3257)
	at com.marklogic.client.impl.JerseyServices.postBulkDocuments(JerseyServices.java:3345)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:619)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:611)
	at com.marklogic.client.impl.GenericDocumentImpl.write(GenericDocumentImpl.java:1)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl$BatchWriter.run(WriteBatcherImpl.java:1032)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at com.marklogic.client.datamovement.impl.WriteBatcherImpl.lambda$5(WriteBatcherImpl.java:658)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
16:32:45.223 [pool-3-thread-1] WARN  c.m.c.d.impl.WriteBatcherImpl - Error writing batch: com.marklogic.client.FailedRequestException: Local message: failed to apply resource at documents: Bad Request. Server Message: XDMP-DOCSTARTTAGCHAR: xdmp:get-request-part-body("xml") -- Unexpected character "&quot;" in start tag at  line 1
16:32:45.224 [main] DEBUG c.m.client.impl.JerseyServices - Posting eval
S is true
WriteHostBatcher-1


Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions