<?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 Node Reference Retrieval Issues and XPath Issues in Alfresco 7.4 / Solr6 Kubernetes Deployment in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/node-reference-retrieval-issues-and-xpath-issues-in-alfresco-7-4/m-p/140494#M37532</link>
    <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;I'm encountering issues with Node References and XPath searches after migrating to Alfresco 7.4 running on Kubernetes with Solr6.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;&lt;STRONG&gt;Node Reference Issue:&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;In my Java code, methods for retrieving Node References are working correctly in my local testing environment. However, when deployed to Kubernetes, these methods return NULL. XPath Issue: The Node Browser fails to find the Company Home node using XPath searches in the Kubernetes environment.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Environment:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Alfresco 7.4 Solr6 Kubernetes&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Troubleshooting Steps Taken:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Solr Reindex: I've fully reindexed the Solr search container. Local Verification: Confirmed functionality in a local test environment. Basic Searches: General searches seem to return files as expected.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Logs show this:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;2024&lt;/SPAN&gt;-&lt;SPAN class=""&gt;02&lt;/SPAN&gt;-&lt;SPAN class=""&gt;13&lt;/SPAN&gt;T19:&lt;SPAN class=""&gt;32&lt;/SPAN&gt;:&lt;SPAN class=""&gt;00&lt;/SPAN&gt;,&lt;SPAN class=""&gt;150&lt;/SPAN&gt; [] &lt;SPAN class=""&gt;ERROR&lt;/SPAN&gt; [quartz.core.JobRunShell] [DefaultScheduler_Worker-&lt;SPAN class=""&gt;4&lt;/SPAN&gt;] Job jobGroup.filingScheduledActionCronJob threw an unhandled Exception:
java.lang.NullPointerException: Cannot invoke &lt;SPAN class=""&gt;"org.alfresco.service.cmr.repository.NodeRef.getStoreRef()"&lt;/SPAN&gt; because &lt;SPAN class=""&gt;"nodeRef"&lt;/SPAN&gt; &lt;SPAN class=""&gt;is&lt;/SPAN&gt; &lt;SPAN class=""&gt;null&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;P&gt;Methods&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;private&lt;/SPAN&gt; NodeRef &lt;SPAN class=""&gt;getNodeByPath&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;SPAN class=""&gt;final&lt;/SPAN&gt; String nodePath)&lt;/SPAN&gt; {
        &lt;SPAN class=""&gt;final&lt;/SPAN&gt; &lt;SPAN class=""&gt;String&lt;/SPAN&gt; &lt;SPAN class=""&gt;escNodePath&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; nodePath.replace(&lt;SPAN class=""&gt;" "&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"_x0020_"&lt;/SPAN&gt;);
        &lt;SPAN class=""&gt;StoreRef&lt;/SPAN&gt; &lt;SPAN class=""&gt;storeRef&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;new&lt;/SPAN&gt; &lt;SPAN class=""&gt;StoreRef&lt;/SPAN&gt;(StoreRef.PROTOCOL_WORKSPACE, &lt;SPAN class=""&gt;"SpacesStore"&lt;/SPAN&gt;);
        &lt;SPAN class=""&gt;final&lt;/SPAN&gt; &lt;SPAN class=""&gt;String&lt;/SPAN&gt; &lt;SPAN class=""&gt;query&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;"PATH:\""&lt;/SPAN&gt; + escNodePath + &lt;SPAN class=""&gt;"\""&lt;/SPAN&gt;;
        &lt;SPAN class=""&gt;ResultSet&lt;/SPAN&gt; &lt;SPAN class=""&gt;rs&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; serviceRegistry.getSearchService().query(storeRef, SearchService.LANGUAGE_LUCENE, query);
        &lt;SPAN class=""&gt;NodeRef&lt;/SPAN&gt; &lt;SPAN class=""&gt;nodeRef&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;null&lt;/SPAN&gt;;
        &lt;SPAN class=""&gt;try&lt;/SPAN&gt; {
            &lt;SPAN class=""&gt;if&lt;/SPAN&gt; (rs.length() == &lt;SPAN class=""&gt;0&lt;/SPAN&gt;) {
                &lt;SPAN class=""&gt;return&lt;/SPAN&gt; &lt;SPAN class=""&gt;null&lt;/SPAN&gt;;
            }
            nodeRef = rs.getNodeRef(&lt;SPAN class=""&gt;0&lt;/SPAN&gt;);
            &lt;SPAN class=""&gt;return&lt;/SPAN&gt; nodeRef;
        } &lt;SPAN class=""&gt;finally&lt;/SPAN&gt; {
            rs.close();
        }
    }&lt;/PRE&gt;&lt;PRE&gt;    &lt;SPAN class=""&gt;public&lt;/SPAN&gt; NodeRef &lt;SPAN class=""&gt;getCompanyHome&lt;/SPAN&gt;&lt;SPAN class=""&gt;()&lt;/SPAN&gt; {
        &lt;SPAN class=""&gt;NodeRef&lt;/SPAN&gt; &lt;SPAN class=""&gt;nodeRef&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;null&lt;/SPAN&gt;;
        &lt;SPAN class=""&gt;ResultSet&lt;/SPAN&gt; &lt;SPAN class=""&gt;rs&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; serviceRegistry.getSearchService().query(
                &lt;SPAN class=""&gt;new&lt;/SPAN&gt; &lt;SPAN class=""&gt;StoreRef&lt;/SPAN&gt;(StoreRef.PROTOCOL_WORKSPACE, &lt;SPAN class=""&gt;"SpacesStore"&lt;/SPAN&gt;), SearchService.LANGUAGE_XPATH,
                &lt;SPAN class=""&gt;"/app:company_home"&lt;/SPAN&gt;);
        &lt;SPAN class=""&gt;try&lt;/SPAN&gt; {
            &lt;SPAN class=""&gt;if&lt;/SPAN&gt; (rs.length() == &lt;SPAN class=""&gt;0&lt;/SPAN&gt;) {
                &lt;SPAN class=""&gt;throw&lt;/SPAN&gt; &lt;SPAN class=""&gt;new&lt;/SPAN&gt; &lt;SPAN class=""&gt;AlfrescoRuntimeException&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"Didn't find Company Home"&lt;/SPAN&gt;);
            }
            nodeRef = rs.getNodeRef(&lt;SPAN class=""&gt;0&lt;/SPAN&gt;);
        } &lt;SPAN class=""&gt;finally&lt;/SPAN&gt; {
            rs.close();
        }
        &lt;SPAN class=""&gt;return&lt;/SPAN&gt; nodeRef;
    }&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Questions:&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;What are common causes for Node Reference retrieval failures specifically within a Kubernetes deployment of Alfresco? Could there be a configuration issue (Kubernetes or Alfresco) that's preventing correct XPath queries from working?&lt;/P&gt;&lt;P&gt;Troubleshooting Steps Taken:&lt;/P&gt;&lt;P&gt;Solr Reindex: I've fully reindexed the Solr search container.&lt;/P&gt;&lt;P&gt;Local Verification: Confirmed functionality in a local test environment.&lt;/P&gt;&lt;P&gt;Basic Searches: General searches seem to return files as expected.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 13 Feb 2024 19:44:48 GMT</pubDate>
    <dc:creator>cjbautista</dc:creator>
    <dc:date>2024-02-13T19:44:48Z</dc:date>
    <item>
      <title>Node Reference Retrieval Issues and XPath Issues in Alfresco 7.4 / Solr6 Kubernetes Deployment</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/node-reference-retrieval-issues-and-xpath-issues-in-alfresco-7-4/m-p/140494#M37532</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;I'm encountering issues with Node References and XPath searches after migrating to Alfresco 7.4 running on Kubernetes with Solr6.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;&lt;STRONG&gt;Node Reference Issue:&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;In my Java code, methods for retrieving Node References are working correctly in my local testing environment. However, when deployed to Kubernetes, these methods return NULL. XPath Issue: The Node Browser fails to find the Company Home node using XPath searches in the Kubernetes environment.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Environment:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Alfresco 7.4 Solr6 Kubernetes&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Troubleshooting Steps Taken:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Solr Reindex: I've fully reindexed the Solr search container. Local Verification: Confirmed functionality in a local test environment. Basic Searches: General searches seem to return files as expected.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Logs show this:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;2024&lt;/SPAN&gt;-&lt;SPAN class=""&gt;02&lt;/SPAN&gt;-&lt;SPAN class=""&gt;13&lt;/SPAN&gt;T19:&lt;SPAN class=""&gt;32&lt;/SPAN&gt;:&lt;SPAN class=""&gt;00&lt;/SPAN&gt;,&lt;SPAN class=""&gt;150&lt;/SPAN&gt; [] &lt;SPAN class=""&gt;ERROR&lt;/SPAN&gt; [quartz.core.JobRunShell] [DefaultScheduler_Worker-&lt;SPAN class=""&gt;4&lt;/SPAN&gt;] Job jobGroup.filingScheduledActionCronJob threw an unhandled Exception:
java.lang.NullPointerException: Cannot invoke &lt;SPAN class=""&gt;"org.alfresco.service.cmr.repository.NodeRef.getStoreRef()"&lt;/SPAN&gt; because &lt;SPAN class=""&gt;"nodeRef"&lt;/SPAN&gt; &lt;SPAN class=""&gt;is&lt;/SPAN&gt; &lt;SPAN class=""&gt;null&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;P&gt;Methods&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;private&lt;/SPAN&gt; NodeRef &lt;SPAN class=""&gt;getNodeByPath&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;SPAN class=""&gt;final&lt;/SPAN&gt; String nodePath)&lt;/SPAN&gt; {
        &lt;SPAN class=""&gt;final&lt;/SPAN&gt; &lt;SPAN class=""&gt;String&lt;/SPAN&gt; &lt;SPAN class=""&gt;escNodePath&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; nodePath.replace(&lt;SPAN class=""&gt;" "&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"_x0020_"&lt;/SPAN&gt;);
        &lt;SPAN class=""&gt;StoreRef&lt;/SPAN&gt; &lt;SPAN class=""&gt;storeRef&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;new&lt;/SPAN&gt; &lt;SPAN class=""&gt;StoreRef&lt;/SPAN&gt;(StoreRef.PROTOCOL_WORKSPACE, &lt;SPAN class=""&gt;"SpacesStore"&lt;/SPAN&gt;);
        &lt;SPAN class=""&gt;final&lt;/SPAN&gt; &lt;SPAN class=""&gt;String&lt;/SPAN&gt; &lt;SPAN class=""&gt;query&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;"PATH:\""&lt;/SPAN&gt; + escNodePath + &lt;SPAN class=""&gt;"\""&lt;/SPAN&gt;;
        &lt;SPAN class=""&gt;ResultSet&lt;/SPAN&gt; &lt;SPAN class=""&gt;rs&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; serviceRegistry.getSearchService().query(storeRef, SearchService.LANGUAGE_LUCENE, query);
        &lt;SPAN class=""&gt;NodeRef&lt;/SPAN&gt; &lt;SPAN class=""&gt;nodeRef&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;null&lt;/SPAN&gt;;
        &lt;SPAN class=""&gt;try&lt;/SPAN&gt; {
            &lt;SPAN class=""&gt;if&lt;/SPAN&gt; (rs.length() == &lt;SPAN class=""&gt;0&lt;/SPAN&gt;) {
                &lt;SPAN class=""&gt;return&lt;/SPAN&gt; &lt;SPAN class=""&gt;null&lt;/SPAN&gt;;
            }
            nodeRef = rs.getNodeRef(&lt;SPAN class=""&gt;0&lt;/SPAN&gt;);
            &lt;SPAN class=""&gt;return&lt;/SPAN&gt; nodeRef;
        } &lt;SPAN class=""&gt;finally&lt;/SPAN&gt; {
            rs.close();
        }
    }&lt;/PRE&gt;&lt;PRE&gt;    &lt;SPAN class=""&gt;public&lt;/SPAN&gt; NodeRef &lt;SPAN class=""&gt;getCompanyHome&lt;/SPAN&gt;&lt;SPAN class=""&gt;()&lt;/SPAN&gt; {
        &lt;SPAN class=""&gt;NodeRef&lt;/SPAN&gt; &lt;SPAN class=""&gt;nodeRef&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;null&lt;/SPAN&gt;;
        &lt;SPAN class=""&gt;ResultSet&lt;/SPAN&gt; &lt;SPAN class=""&gt;rs&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; serviceRegistry.getSearchService().query(
                &lt;SPAN class=""&gt;new&lt;/SPAN&gt; &lt;SPAN class=""&gt;StoreRef&lt;/SPAN&gt;(StoreRef.PROTOCOL_WORKSPACE, &lt;SPAN class=""&gt;"SpacesStore"&lt;/SPAN&gt;), SearchService.LANGUAGE_XPATH,
                &lt;SPAN class=""&gt;"/app:company_home"&lt;/SPAN&gt;);
        &lt;SPAN class=""&gt;try&lt;/SPAN&gt; {
            &lt;SPAN class=""&gt;if&lt;/SPAN&gt; (rs.length() == &lt;SPAN class=""&gt;0&lt;/SPAN&gt;) {
                &lt;SPAN class=""&gt;throw&lt;/SPAN&gt; &lt;SPAN class=""&gt;new&lt;/SPAN&gt; &lt;SPAN class=""&gt;AlfrescoRuntimeException&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"Didn't find Company Home"&lt;/SPAN&gt;);
            }
            nodeRef = rs.getNodeRef(&lt;SPAN class=""&gt;0&lt;/SPAN&gt;);
        } &lt;SPAN class=""&gt;finally&lt;/SPAN&gt; {
            rs.close();
        }
        &lt;SPAN class=""&gt;return&lt;/SPAN&gt; nodeRef;
    }&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Questions:&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;What are common causes for Node Reference retrieval failures specifically within a Kubernetes deployment of Alfresco? Could there be a configuration issue (Kubernetes or Alfresco) that's preventing correct XPath queries from working?&lt;/P&gt;&lt;P&gt;Troubleshooting Steps Taken:&lt;/P&gt;&lt;P&gt;Solr Reindex: I've fully reindexed the Solr search container.&lt;/P&gt;&lt;P&gt;Local Verification: Confirmed functionality in a local test environment.&lt;/P&gt;&lt;P&gt;Basic Searches: General searches seem to return files as expected.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Feb 2024 19:44:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/node-reference-retrieval-issues-and-xpath-issues-in-alfresco-7-4/m-p/140494#M37532</guid>
      <dc:creator>cjbautista</dc:creator>
      <dc:date>2024-02-13T19:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Node Reference Retrieval Issues and XPath Issues in Alfresco 7.4 / Solr6 Kubernetes Deployment</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/node-reference-retrieval-issues-and-xpath-issues-in-alfresco-7-4/m-p/140495#M37533</link>
      <description>&lt;P&gt;For XPath lookups like /app:company_home there is the separate selectNodes-method in the SearchService API. Especially paths that should be guaranteed to exist / consistent should be resolved that way. The primary difference from the query method is that query always uses the index for XPath lookups, while selectNodes will use actual DB-based hierarchy traversals, unless you explicitly use full text search selectors in the XPath expression - and even then the evaluation will only use index-based sub-queries for those selectors individually.&lt;/P&gt;
&lt;P&gt;The Lucene language should NOT be used at all anymore. Only FTS and CMIS are fully supported for index-based queries.&lt;/P&gt;
&lt;P&gt;Other than these basic remarks, I have not run into any specific issues with index-based queries (even including paths like this) in k8s-based Alfresco deployments. Without additional information (like a screenshot from the Company Home node in Node Browser to check its actual primary path) or low-level inspection of the index state, it is hard to guess what might be the cause in your constellation.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 13:00:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/node-reference-retrieval-issues-and-xpath-issues-in-alfresco-7-4/m-p/140495#M37533</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2024-02-20T13:00:00Z</dc:date>
    </item>
  </channel>
</rss>

