cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLR] NamespaceException: URI has already been defined

s_turner
Champ on-the-rise
Champ on-the-rise
Hi,

I've defined a custom model and it's seems to all be working in Alfresco - my aspect is available to add and use, custom properties appear on content items and advanced search form, there are no errors in alfresco.log. Problem is SOLR search is refusing to index. In solr.log I just get the repeated error:

00:00:00,089 ERROR [org.quartz.core.JobRunShell] Job Solr.CoreTracker-alfresco threw an unhandled Exception:
org.alfresco.service.namespace.NamespaceException: URI quotall.model has already been defined
   at org.alfresco.repo.dictionary.NamespaceDAOImpl.addURI(NamespaceDAOImpl.java:253)
   at org.alfresco.repo.dictionary.DictionaryDAOImpl.putModelImpl(DictionaryDAOImpl.java:327)
   at org.alfresco.repo.dictionary.DictionaryDAOImpl.putModelIgnoringConstraints(DictionaryDAOImpl.java:294)
   at org.alfresco.solr.AlfrescoSolrDataModel.putModel(AlfrescoSolrDataModel.java:670)
   at org.alfresco.solr.tracker.CoreTracker.loadModel(CoreTracker.java:4014)
   at org.alfresco.solr.tracker.CoreTracker.trackModels(CoreTracker.java:1824)
   at org.alfresco.solr.tracker.CoreTracker.trackRepository(CoreTracker.java:1129)
   at org.alfresco.solr.tracker.CoreTracker.updateIndex(CoreTracker.java:475)
   at org.alfresco.solr.tracker.CoreTrackerJob.execute(CoreTrackerJob.java:45)
   at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
   at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)

My customModel.xml file contains the definition of my model, (attached as customModel.txt). It's in the shared/classes/alfresco/extension folder and that's the only place I've made changes for my custom model. There are no other custom models defined.

I've attempted to reindex SOLR but that just gives this same error. I'm using Alfresco Community 4.2 and this custom model is the only change I've made to Alfresco after a standard install.

Anybody have any idea why SOLR is having this problem?

Thanks,
Stuart


2 REPLIES 2

kaynezhang
World-Class Innovator
World-Class Innovator
You can try to delete model files under  folder ${Solr home directory}/workspace-SpacesStore/alfrescoResources/alfresco/model first and then rebuild solr index.
By the way ,namespace uri definition in you custom model is not well formatted,you'd better name you namespace uri like "http://www.yourcompany.com/*****" instead of "quotall.model" .

Thanks for your reply. Sorry, should have said, I followed the instructions here http://docs.alfresco.com/4.2/tasks/solr-reindex.html which includes the deleting of model files under solr/workspace-SpacesStore/alfrescoModels. Before I deleted them I checked to see if there was a duplicate for "quotall.model" but there wasn't. Deleting the model files made no difference to the error.

If I change the namespace URI presumably that causes problems for any content already using the model? I've seen other posts where people have changed URIs and Alfresco then starts complaining about missing URIs and maybe refuses to start up. Kind of reluctant to change the URI if it means having to start again with an empty repository unless that's the only way to get search working.