Questions Tagged With bughttps://answers.axonivy.com/tags/bug/?type=rssquestions tagged <span class="tag">bug</span>enFri, 11 Nov 2016 14:33:42 -0500Unable to use Apache POI - getting SchemaTypeLoaderExceptionhttps://answers.axonivy.com/questions/2179/unable-to-use-apache-poi-getting-schematypeloaderexception<p>I'm trying to use Apache POI (3.10 or 3.15) with XpertIvy Designer v5.0.18 and I'm getting the following exception:</p> <pre><code>SchemaTypeLoaderException: XML-BEANS compiled schema: Incompatible minor version - expecting up to 23, got 24 (schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707.index) - code 3 java.lang.reflect.InvocationTargetException RuntimeException: Could not instantiate SchemaTypeSystemImpl (java.lang.reflect.InvocationTargetException): is the version of xbean.jar correct? </code></pre> <p>I saw a few older threads (<a href="http://answers.axonivy.com/questions/511/poi-conflicted-xmlbeans-jars">POI conflicted xmlbeans.jar</a> [2014] or <a href="http://answers.axonivy.com/questions/1225/what-is-axis-lib-used-for">what is axis lib used for</a> [2015]) regarding this issue.</p> <p>Is it really true that you <strong>still have to hack</strong> the designer plugins folder and some server folder too??? </p>OliverFri, 11 Nov 2016 14:33:42 -0500https://answers.axonivy.com/questions/2179/unable-to-use-apache-poi-getting-schematypeloaderexceptiondesignerbug`TaskQuery.and(TaskQuery)` and `CaseQuery.and(CaseQuery)` doesn't work with `additionalProperty()`.https://answers.axonivy.com/questions/1337/taskquery-and-taskquery-and-casequery-and-casequery-doesn-t-work-with-additionalproperty<p>On our project, we extensively uses the API <code>TaskQuery</code> and <code>CaseQuery</code> in order to find <code>ITask</code> and <code>ICase</code> respectively. We also make use of the <code>additionalProperty</code> of both <code>ITask</code> and <code>ICase</code> in order to store custom fields.</p> <p>However, we later found out that the method <code>and(TaskQuery</code> and <code>or(TaskQuery)</code> doesn't work with the criteria <code>additionalProperty</code>.</p> <p>Consider the below snippet of code:</p> <pre><code>public List&lt;ITask&gt; findTask() { Ivy.wf().getTaskQueryExecutor() .getResults(TaskQuery.create().where() .state().isEqual(SUSPENDED) .and(hasCustomField())); } private static TaskQuery hasCustomField() { return TaskQuery.create().where().additionalProperty("custom").isLike("customized_value"); } </code></pre> <p>Runing the code will result as an exception:</p> <pre><code>java.sql.SQLException: Column not found: ADDITIONALPROPERTYFORTASK.NAME in statement [SELECT IWA_TASKQUERY.TASKID ....... FROM IWA_TaskQuery WHERE (IWA_TASKQUERY.APPLICATIONID = ? AND (IWA_TASKQUERY."STATE" = ? AND ((ADDITIONALPROPERTYFORTASK.NAME = ? OR ADDITIONALPROPERTYFORTASK.NAME IS NULL) AND ADDITIONALPROPERTYFORTASK."VALUE" LIKE ?))) ORDER BY IWA_TASKQUERY.TASKID ASC] </code></pre> <p>While this works:</p> <pre><code>public List&lt;ITask&gt; findTask() { Ivy.wf().getTaskQueryExecutor() .getResults(TaskQuery.create().where() .state().isEqual(SUSPENDED) .and().additionalProperty("custom").isLike("customized_value"); } </code></pre> <p>Please note that only the criterion <code>additionalPropety()</code> has this problem, the other criteria don't.</p> <p>Digging a little deeper, I found that the queries produced are different:</p> <p>The former (the problematic one) produces:</p> <pre><code>SELECT * FROM IWA_Task WHERE (Column(IWA_TaskQuery.State) = 4 &amp;amp;&amp;amp; ((Column(AdditionalPropertyForTask.Name) = custom || Column(AdditionalPropertyForTask.Name) IS NULL) &amp;amp;&amp;amp; Column(AdditionalPropertyForTask.Value) LIKE customized_value)) </code></pre> <p>...whereas the latter produces (correctly):</p> <pre><code>SELECT * FROM IWA_Task LEFT JOIN IWA_TaskAdditionalProperty ON Column(IWA_TaskQuery.TaskId) = Column(IWA_TaskAdditionalProperty.TaskId) LEFT JOIN IWA_AdditionalProperty ON Column(IWA_TaskAdditionalProperty.AdditionalPropertyId) = Column(IWA_AdditionalProperty.AdditionalPropertyId) WHERE (Column(IWA_TaskQuery.State) = 4 &amp;&amp; (Column(AdditionalPropertyForTask.Name) = custom || Column(AdditionalPropertyForTask.Name) IS NULL) &amp;&amp; Column(AdditionalPropertyForTask.Value) LIKE customized_value) </code></pre> <p>This problem occurs both on <code>TaskQuery</code> and <code>CaseQuery</code> and on Axon.ivy 5.1.x (<code>additionalProperty()</code> has been introduced since 5.1.x).</p> <p>I think this is probrably a bug in Axon.ivy query API. While there is a work-around (don't use <code>and(TaskQuery</code> with <code>additionalProperty()</code>), I think it is not good to have inconsistency in the API. I hope this would be fixed soon.</p> <p>I have created a demo project which can reproduce the problem on Axon.ivy. Download it at <a href="https://app.box.com/s/9wxc8iqqrfmqotljiutqdwlvvoem55dh">box.net</a>.</p>Genzer HawkerWed, 27 May 2015 09:04:31 -0400https://answers.axonivy.com/questions/1337/taskquery-and-taskquery-and-casequery-and-casequery-doesn-t-work-with-additionalpropertyadditional-propertycase-querybugtask-query