<?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 Re: Please help ActionExecuter and catching ConstraintViolation in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/please-help-actionexecuter-and-catching-constraintviolation/m-p/191539#M144669</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN style="color:#400080;"&gt;Through Alfresco Support (ACT) I found out what transaction to use to make the commit work inside&lt;BR /&gt;the ActionExecuter type class:&lt;BR /&gt;&lt;BR /&gt;I have implemented the&lt;STRONG&gt;transactionService.getNonPropagatingUserTransaction();&lt;/STRONG&gt;&amp;nbsp; for committing the transactions. &lt;BR /&gt;That works fine now. &lt;BR /&gt;&lt;BR /&gt;The ConstraintViolation Exceptions still can not be caught (not even by Exception or Throwable), but we modified the ConsistencyChecker behaviour through: &lt;BR /&gt;&lt;BR /&gt;custom-node-service-context.xml: &lt;BR /&gt;&lt;BR /&gt;&amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt; &lt;BR /&gt;&amp;lt;!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' '&lt;A href="http://www.springframework.org/dtd/spring-beans.dtd" rel="nofollow noopener noreferrer"&gt;http://www.springframework.org/dtd/spring-beans.dtd&lt;/A&gt;'&amp;gt; &lt;BR /&gt;&lt;BR /&gt;&amp;lt;!– Beans pertinent to node persistence and services –&amp;gt; &lt;BR /&gt;&amp;lt;beans&amp;gt; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;!– ensures model-compliance of node structures –&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;bean id="integrityChecker" class="org.alfresco.repo.node.integrity. IntegrityChecker" init-method="init"&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="policyComponent"&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ref bean="policyComponent"/&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="dictionaryService"&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ref bean="dictionaryService" /&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="nodeService"&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ref bean="nodeService" /&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="enabled"&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;value&amp;gt;true&amp;lt;/value&amp;gt;&amp;nbsp; &amp;lt;!– on/off switch –&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="traceOn"&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;value&amp;gt;false&amp;lt;/value&amp;gt;&amp;nbsp; &amp;lt;!– use only to trace problems –&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="failOnViolation" &amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;value&amp;gt;${integrity.failOnError}&amp;lt;/value&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="maxErrorsPerTransaction" &amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;value&amp;gt;100000&amp;lt;/value&amp;gt;&amp;nbsp; &amp;lt;!– limit output (exception and log) to the first N violation messages –&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/bean&amp;gt; &lt;BR /&gt;&lt;BR /&gt;&amp;lt;/beans&amp;gt; &lt;BR /&gt;—————————- &lt;BR /&gt;Changed the following setting in our application.properties: &lt;BR /&gt;integrity.failOnError=false &lt;BR /&gt;—————————- &lt;BR /&gt;Changed the loglevel in the log4j.properties to "WARN" &lt;BR /&gt;&lt;BR /&gt;So now the ConstraintViolation exceptions still aren't caught. But the document with a constraint violation is still processed. &lt;BR /&gt;We have to check the alfresco.log after each "import" batch to see what noderef got a ConstraintViolation and these properties changed manually afterwards. Of course hopefully there aren't too many constraint violations during the process of these batches &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Alex&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Oct 2008 07:40:12 GMT</pubDate>
    <dc:creator>alexr</dc:creator>
    <dc:date>2008-10-17T07:40:12Z</dc:date>
    <item>
      <title>Please help ActionExecuter and catching ConstraintViolation</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/please-help-actionexecuter-and-catching-constraintviolation/m-p/191538#M144668</link>
      <description>On a Alfresco 2.2 Enterprise/MySQL installation, I have encountered two issues while developing a Alfresco Java application to import a large number of documents (several thousands).The import is started by an inbound content rule on an added csv-file (delimited data).One csv-file contains multiple</description>
      <pubDate>Wed, 08 Oct 2008 05:38:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/please-help-actionexecuter-and-catching-constraintviolation/m-p/191538#M144668</guid>
      <dc:creator>alexr</dc:creator>
      <dc:date>2008-10-08T05:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Please help ActionExecuter and catching ConstraintViolation</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/please-help-actionexecuter-and-catching-constraintviolation/m-p/191539#M144669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN style="color:#400080;"&gt;Through Alfresco Support (ACT) I found out what transaction to use to make the commit work inside&lt;BR /&gt;the ActionExecuter type class:&lt;BR /&gt;&lt;BR /&gt;I have implemented the&lt;STRONG&gt;transactionService.getNonPropagatingUserTransaction();&lt;/STRONG&gt;&amp;nbsp; for committing the transactions. &lt;BR /&gt;That works fine now. &lt;BR /&gt;&lt;BR /&gt;The ConstraintViolation Exceptions still can not be caught (not even by Exception or Throwable), but we modified the ConsistencyChecker behaviour through: &lt;BR /&gt;&lt;BR /&gt;custom-node-service-context.xml: &lt;BR /&gt;&lt;BR /&gt;&amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt; &lt;BR /&gt;&amp;lt;!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' '&lt;A href="http://www.springframework.org/dtd/spring-beans.dtd" rel="nofollow noopener noreferrer"&gt;http://www.springframework.org/dtd/spring-beans.dtd&lt;/A&gt;'&amp;gt; &lt;BR /&gt;&lt;BR /&gt;&amp;lt;!– Beans pertinent to node persistence and services –&amp;gt; &lt;BR /&gt;&amp;lt;beans&amp;gt; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;!– ensures model-compliance of node structures –&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;bean id="integrityChecker" class="org.alfresco.repo.node.integrity. IntegrityChecker" init-method="init"&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="policyComponent"&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ref bean="policyComponent"/&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="dictionaryService"&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ref bean="dictionaryService" /&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="nodeService"&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ref bean="nodeService" /&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="enabled"&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;value&amp;gt;true&amp;lt;/value&amp;gt;&amp;nbsp; &amp;lt;!– on/off switch –&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="traceOn"&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;value&amp;gt;false&amp;lt;/value&amp;gt;&amp;nbsp; &amp;lt;!– use only to trace problems –&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="failOnViolation" &amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;value&amp;gt;${integrity.failOnError}&amp;lt;/value&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="maxErrorsPerTransaction" &amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;value&amp;gt;100000&amp;lt;/value&amp;gt;&amp;nbsp; &amp;lt;!– limit output (exception and log) to the first N violation messages –&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/bean&amp;gt; &lt;BR /&gt;&lt;BR /&gt;&amp;lt;/beans&amp;gt; &lt;BR /&gt;—————————- &lt;BR /&gt;Changed the following setting in our application.properties: &lt;BR /&gt;integrity.failOnError=false &lt;BR /&gt;—————————- &lt;BR /&gt;Changed the loglevel in the log4j.properties to "WARN" &lt;BR /&gt;&lt;BR /&gt;So now the ConstraintViolation exceptions still aren't caught. But the document with a constraint violation is still processed. &lt;BR /&gt;We have to check the alfresco.log after each "import" batch to see what noderef got a ConstraintViolation and these properties changed manually afterwards. Of course hopefully there aren't too many constraint violations during the process of these batches &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Alex&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2008 07:40:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/please-help-actionexecuter-and-catching-constraintviolation/m-p/191539#M144669</guid>
      <dc:creator>alexr</dc:creator>
      <dc:date>2008-10-17T07:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Please help ActionExecuter and catching ConstraintViolation</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/please-help-actionexecuter-and-catching-constraintviolation/m-p/191540#M144670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Has anyone found a solution to catching integrity violations in a transaction? I have a similar problem where a webscript performs some action on content (for example creating a node or updating the name of a node), however the script will NOT catch any integrity or constraint violations.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Simplest example is a script that creates a node with a name that has a "|" (a pipe char) in it. This will cause an integrity exception that appears in the logs, but the webscript is oblivious to it. I can't catch it either.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've used this code similar to this: &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;try{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;props.put(ContentModel.PROP_NAME, "test|pipe");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;nodeService.createNode(parent, assocQName, nodeName, type, props);&lt;BR /&gt;}&lt;BR /&gt;catch (IntegrityException ie){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;log.error("FOUND INTEGRITY EXCEPTION " + ie);&lt;BR /&gt;}&lt;BR /&gt;catch(ConstraintException ce){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;log.error("FOUND CONSTRAINTEXCEPTION " + ce);&lt;BR /&gt;}&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anyone found a solution to this?&amp;nbsp; I suspect it's because the integrity checker runs as a behaviour.. and therefore is outside of the code that can be caught by any try/catch statements.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, there must be a solution to this, because the web client catches integrity violations during a save of a node. Any suggestions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance for your help&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Lee&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2010 20:52:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/please-help-actionexecuter-and-catching-constraintviolation/m-p/191540#M144670</guid>
      <dc:creator>lee</dc:creator>
      <dc:date>2010-02-22T20:52:40Z</dc:date>
    </item>
  </channel>
</rss>

