Can't save search due to "Unknown type: faceted_search_default_cv"

Hi,

On my customized Nuxeo DM 5.6-HF22, I'm getting this error everytime I want to save a faceted search:

   Unknown type: faceted_search_default_cv

Caused by: java.lang.IllegalArgumentException: Unknown type: faceted_search_default_cv
at org.nuxeo.ecm.core.storage.sql.SessionImpl.addChildNode(SessionImpl.java:821)
at org.nuxeo.ecm.core.storage.sql.SessionImpl.addChildNode(SessionImpl.java:805)
at org.nuxeo.ecm.core.storage.sql.ra.ConnectionImpl.addChildNode(ConnectionImpl.java:246)
at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.addChild(SQLSession.java:786)
at org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentLive.addChild(SQLDocumentLive.java:568)
at org.nuxeo.ecm.core.api.AbstractSession.createDocument(AbstractSession.java:836)
...
at org.nuxeo.ecm.platform.faceted.search.jsf.service.FacetedSearchServiceImpl.saveSearch(FacetedSearchServiceImpl.java:204)
at org.nuxeo.ecm.platform.faceted.search.jsf.FacetedSearchActions.saveSearch(FacetedSearchActions.java:289)

I have registered several faceted searches through Studio, but all of them return this error, because for some reason the SQL-level model (org.nuxeo.ecm.core.storage.sql.Model) doesn't know of the associated types. It's weird since the types are registered without problems in the SchemaManager, so the search feature actually works, errors happen only when I need to persist the models.

NB: I don't do anything fancy with the document types, the only contribution is the one from Studio:

<doctype name="faceted_search_default_cv" extends="FacetedSearch">
  <facet name="FacetedSearch"/>
  <facet name="HiddenInNavigation"/>
  <schema name="faceted_search_default_cv"/>
</doctype>

Thanks for your help


EDIT-2: Nevermind for this part, I've been told I'm supposed to delete its document from the “Saved searches” folder in my personal workspace.

0 votes

1 answers

2297 views

ANSWER



Here is the fix:

 <extension point="doctype" target="org.nuxeo.ecm.core.schema.TypeService">
    <facet name="FacetedSearch" />
 </extension>

Studio contributions refer to the FacetedSearch facet which is declared nowhere, thus postponing the doctype registration until after the SQL Model is initialized.

I reported the issue on JIRA: https://jira.nuxeo.com/browse/NXP-12543

0 votes