<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic &amp;quot;Blob.AttachOnDocument api call giving 400 error. in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/quot-blob-attachondocument-api-call-giving-400-error/m-p/316189#M3190</link>
    <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;While calling Blob.AttachOnDocument api getting error.&lt;/P&gt;
&lt;P&gt;My code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;HttpAutomationClient client = new HttpAutomationClient("url");
 Session session = client.getSession("myuser","mypassword");

File dummyFile = new File(myfilepath");
Object request = session.newRequest("Blob.AttachOnDocument")
 .set("document", "5eed9909-010b-4adc-8be7-2f1dca472bc3")
 .set("xpath", "file:content")
 .setInput(new FileBlob(dummyFile)).execute();
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Error :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.PoolingClientConnectionManager).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See &lt;A href="http://logging.apache.org/log4j/1.2/faq.html#noconfig" target="test_blank"&gt;http://logging.apache.org/log4j/1.2/faq.html#noconfig&lt;/A&gt; for more info.
org.nuxeo.ecm.automation.client.RemoteException: Server Error
at org.nuxeo.ecm.automation.client.jaxrs.spi.Request.handleException(Request.java:221)
at org.nuxeo.ecm.automation.client.jaxrs.spi.Request.handleResult(Request.java:126)
at org.nuxeo.ecm.automation.client.jaxrs.impl.HttpConnector.execute(HttpConnector.java:143)
at org.nuxeo.ecm.automation.client.jaxrs.impl.HttpConnector.execute(HttpConnector.java:125)
at org.nuxeo.ecm.automation.client.jaxrs.spi.ConnectorHandler.execute(ConnectorHandler.java:37)
at org.nuxeo.ecm.automation.client.jaxrs.spi.DefaultSession.execute(DefaultSession.java:119)
at org.nuxeo.ecm.automation.client.jaxrs.spi.DefaultOperationRequest.execute(DefaultOperationRequest.java:174)
at com.example.nuxeo.SampleAttachFiles.main(SampleAttachFiles.java:33)
====== Remote Stack Trace:
400 - Server Error
&amp;lt;!doctype html&amp;gt;&amp;lt;html lang="en"&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;HTTP Status 400 – Bad Request&amp;lt;/title&amp;gt;&amp;lt;style type="text/css"&amp;gt;h1  {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTTP Status 400 – Bad Request&amp;lt;/h1&amp;gt;&amp;lt;/body&amp;gt;    &amp;lt;/html&amp;gt;400 - Server Error
&amp;lt;!doctype html&amp;gt;&amp;lt;html lang="en"&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;HTTP Status 400 – Bad Request&amp;lt;/title&amp;gt;&amp;lt;style type="text/css"&amp;gt;h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTTP Status 400 – Bad Request&amp;lt;/h1&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Weird thing is , I have installed nuxeo on my local machine and one on AWS ec2 server. When pointing to localhost above code is working fine and when I am pointing to Nuxeo on ec2, I am getting this error. I tried to hit my remote nuxeo through Postman and there also it works fine.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Feb 2018 09:46:57 GMT</pubDate>
    <dc:creator>sangam_</dc:creator>
    <dc:date>2018-02-06T09:46:57Z</dc:date>
    <item>
      <title>"Blob.AttachOnDocument api call giving 400 error.</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/quot-blob-attachondocument-api-call-giving-400-error/m-p/316189#M3190</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;While calling Blob.AttachOnDocument api getting error.&lt;/P&gt;
&lt;P&gt;My code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;HttpAutomationClient client = new HttpAutomationClient("url");
 Session session = client.getSession("myuser","mypassword");

File dummyFile = new File(myfilepath");
Object request = session.newRequest("Blob.AttachOnDocument")
 .set("document", "5eed9909-010b-4adc-8be7-2f1dca472bc3")
 .set("xpath", "file:content")
 .setInput(new FileBlob(dummyFile)).execute();
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Error :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.PoolingClientConnectionManager).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See &lt;A href="http://logging.apache.org/log4j/1.2/faq.html#noconfig" target="test_blank"&gt;http://logging.apache.org/log4j/1.2/faq.html#noconfig&lt;/A&gt; for more info.
org.nuxeo.ecm.automation.client.RemoteException: Server Error
at org.nuxeo.ecm.automation.client.jaxrs.spi.Request.handleException(Request.java:221)
at org.nuxeo.ecm.automation.client.jaxrs.spi.Request.handleResult(Request.java:126)
at org.nuxeo.ecm.automation.client.jaxrs.impl.HttpConnector.execute(HttpConnector.java:143)
at org.nuxeo.ecm.automation.client.jaxrs.impl.HttpConnector.execute(HttpConnector.java:125)
at org.nuxeo.ecm.automation.client.jaxrs.spi.ConnectorHandler.execute(ConnectorHandler.java:37)
at org.nuxeo.ecm.automation.client.jaxrs.spi.DefaultSession.execute(DefaultSession.java:119)
at org.nuxeo.ecm.automation.client.jaxrs.spi.DefaultOperationRequest.execute(DefaultOperationRequest.java:174)
at com.example.nuxeo.SampleAttachFiles.main(SampleAttachFiles.java:33)
====== Remote Stack Trace:
400 - Server Error
&amp;lt;!doctype html&amp;gt;&amp;lt;html lang="en"&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;HTTP Status 400 – Bad Request&amp;lt;/title&amp;gt;&amp;lt;style type="text/css"&amp;gt;h1  {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTTP Status 400 – Bad Request&amp;lt;/h1&amp;gt;&amp;lt;/body&amp;gt;    &amp;lt;/html&amp;gt;400 - Server Error
&amp;lt;!doctype html&amp;gt;&amp;lt;html lang="en"&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;HTTP Status 400 – Bad Request&amp;lt;/title&amp;gt;&amp;lt;style type="text/css"&amp;gt;h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTTP Status 400 – Bad Request&amp;lt;/h1&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Weird thing is , I have installed nuxeo on my local machine and one on AWS ec2 server. When pointing to localhost above code is working fine and when I am pointing to Nuxeo on ec2, I am getting this error. I tried to hit my remote nuxeo through Postman and there also it works fine.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 09:46:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/quot-blob-attachondocument-api-call-giving-400-error/m-p/316189#M3190</guid>
      <dc:creator>sangam_</dc:creator>
      <dc:date>2018-02-06T09:46:57Z</dc:date>
    </item>
  </channel>
</rss>

