<?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 How to set my CustomRestResponseFactory with spring config in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-set-my-customrestresponsefactory-with-spring-config/m-p/33727#M14271</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to make activiti-rest returning process variable of json type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this I understood I needed to add a&amp;nbsp;JsonRestVariableConverter and register it in a CustomRestResponseFactory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use spring to configure my web application but when I try to override the RestResponseFactory, my class is not found &amp;nbsp;at server startup, although it is on classpath.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;bean&lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;id&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;"restResponseFactory"&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;class&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;"mycompany.activiti.rest.CustomRestResponseFactory"&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I have read &lt;A _jive_internal="true" href="https://community.alfresco.com/thread/223333-how-to-create-list-and-map-variables-types-using-rest" rel="nofollow noopener noreferrer"&gt;a post from 2014&lt;/A&gt;&amp;nbsp;which says :&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;If you want to customise RestResponseFactory the best way is too clone the REST application and change the RestConfiguration class:&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Is it still true, is there no way to configure it via Spring ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you !&lt;/P&gt;&lt;P&gt;Stephane&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Mar 2017 18:03:34 GMT</pubDate>
    <dc:creator>ppcchh</dc:creator>
    <dc:date>2017-03-21T18:03:34Z</dc:date>
    <item>
      <title>How to set my CustomRestResponseFactory with spring config</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-set-my-customrestresponsefactory-with-spring-config/m-p/33727#M14271</link>
      <description>Hello,I am trying to make activiti-rest returning process variable of json type.For this I understood I needed to add a&amp;nbsp;JsonRestVariableConverter and register it in a CustomRestResponseFactory.I use spring to configure my web application but when I try to override the RestResponseFactory, my class i</description>
      <pubDate>Tue, 21 Mar 2017 18:03:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-set-my-customrestresponsefactory-with-spring-config/m-p/33727#M14271</guid>
      <dc:creator>ppcchh</dc:creator>
      <dc:date>2017-03-21T18:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to set my CustomRestResponseFactory with spring config</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-set-my-customrestresponsefactory-with-spring-config/m-p/33728#M14272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stephane,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is possible to 'overwrite' a java class, via including it in the classpath - load ordering depends on the server being used. For Tomcat, the load order is:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Bootstrap classes of your JVM&lt;/LI&gt;&lt;LI style="border: 0px; margin: 0px 0px 0.5em;"&gt;System class loader classes&lt;/LI&gt;&lt;LI style="border: 0px; margin: 0px 0px 0.5em;"&gt;/WEB-INF/classes of your web application&lt;/LI&gt;&lt;LI style="border: 0px; margin: 0px 0px 0.5em;"&gt;/WEB-INF/lib/*.jar of your web application&lt;/LI&gt;&lt;LI style="border: 0px;"&gt;Common class loader classes&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Search around a bit and make sure you're attempting this in the right manner; it's going to vary per server, as I said earlier - and I imagine there are some that it's not possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure I would recommend this as an approach - although there are plenty of StackOverflow comments and blogs that do similar things. I'm sure it's plausible, but our resources were not able to make this work and moved on to a different method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only way I've personally seen this done successfully, is to remove the&amp;nbsp;bean declaration of RestResponseFactory from the RestConfiguration, and establish it elsewhere - which still requires modifying the RestResponseFactory directly. I would recommend this, which is basically an endorsement of the clone+edit method.&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;-JEarles&lt;BR /&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 18:30:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-set-my-customrestresponsefactory-with-spring-config/m-p/33728#M14272</guid>
      <dc:creator>jearles</dc:creator>
      <dc:date>2017-03-22T18:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to set my CustomRestResponseFactory with spring config</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-set-my-customrestresponsefactory-with-spring-config/m-p/33729#M14273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the clear answer, I have done it overriding&amp;nbsp;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;RestResponseFactory and it works fine.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;Thanks !&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Mar 2017 00:54:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-set-my-customrestresponsefactory-with-spring-config/m-p/33729#M14273</guid>
      <dc:creator>ppcchh</dc:creator>
      <dc:date>2017-03-24T00:54:19Z</dc:date>
    </item>
  </channel>
</rss>

