cancel
Showing results for 
Search instead for 
Did you mean: 

Error after adding custom model

blacksylo
Champ in-the-making
Champ in-the-making
Hi all!

I had an alfresco setup with several custom types and everything was working smoothly, then added another type, but Alfresco couldnt start :C.

Then I erased the newType.xml and Alfresco still couldnt start :'C.

Now I have tried removing and changing all the other types that were there before but with no success to make Alfresco start again.

So I went to the logs:


INFO: Server startup in 204311 ms
2016-01-12 17:42:40,006  ERROR [quartz.core.JobRunShell] [SolrTrackerScheduler_Worker-1] Job Solr.CoreWatcher threw an unhandled Exception:
org.alfresco.service.cmr.dictionary.DictionaryException: 00120009 Failed to compile model dl:datalistmodel
        at org.alfresco.repo.dictionary.CompiledModel.<init>(CompiledModel.java:108)
        at org.alfresco.repo.dictionary.M2Model.compile(M2Model.java:163)
        at org.alfresco.repo.dictionary.DictionaryDAOImpl.putModelImpl(DictionaryDAOImpl.java:266)
        at org.alfresco.repo.dictionary.DictionaryDAOImpl.putModelIgnoringConstraints(DictionaryDAOImpl.java:259)
        at org.alfresco.solr.AlfrescoSolrDataModel.putModel(AlfrescoSolrDataModel.java:1173)
        at org.alfresco.solr.SolrInformationServer.putModel(SolrInformationServer.java:2849)
        at org.alfresco.solr.tracker.ModelTracker.loadModel(ModelTracker.java:516)
        at org.alfresco.solr.tracker.ModelTracker.loadPersistedModels(ModelTracker.java:138)
        at org.alfresco.solr.tracker.ModelTracker.<init>(ModelTracker.java:85)
        at org.alfresco.solr.tracker.CoreWatcherJob.registerForCore(CoreWatcherJob.java:123)
        at org.alfresco.solr.tracker.CoreWatcherJob.execute(CoreWatcherJob.java:74)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
Caused by: org.alfresco.service.namespace.NamespaceException: URI http://www.alfresco.org/model/dictionary/1.0 cannot be imported as it is not defined (with prefix d
        at org.alfresco.repo.dictionary.CompiledModel.createLocalPrefixResolver(CompiledModel.java:206)
        at org.alfresco.repo.dictionary.CompiledModel.constructDefinitions(CompiledModel.java:130)
        at org.alfresco.repo.dictionary.CompiledModel.<init>(CompiledModel.java:88)
        … 12 more
2016-01-12 17:42:40,008  ERROR [quartz.core.ErrorLogger] [SolrTrackerScheduler_Worker-1] Job (Solr.CoreWatcher threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.alfresco.service.cmr.dictionary.DictionaryException: 00120009 Failed to compile model dl:datalistmodel]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:227)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 00120009 Failed to compile model dl:datalistmodel
        at org.alfresco.repo.dictionary.CompiledModel.<init>(CompiledModel.java:108)
        at org.alfresco.repo.dictionary.M2Model.compile(M2Model.java:163)
        at org.alfresco.repo.dictionary.DictionaryDAOImpl.putModelImpl(DictionaryDAOImpl.java:266)
        at org.alfresco.repo.dictionary.DictionaryDAOImpl.putModelIgnoringConstraints(DictionaryDAOImpl.java:259)
        at org.alfresco.solr.AlfrescoSolrDataModel.putModel(AlfrescoSolrDataModel.java:1173)
        at org.alfresco.solr.SolrInformationServer.putModel(SolrInformationServer.java:2849)
        at org.alfresco.solr.tracker.ModelTracker.loadModel(ModelTracker.java:516)
        at org.alfresco.solr.tracker.ModelTracker.loadPersistedModels(ModelTracker.java:138)
        at org.alfresco.solr.tracker.ModelTracker.<init>(ModelTracker.java:85)
        at org.alfresco.solr.tracker.CoreWatcherJob.registerForCore(CoreWatcherJob.java:123)
        at org.alfresco.solr.tracker.CoreWatcherJob.execute(CoreWatcherJob.java:74)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
        … 1 more
Caused by: org.alfresco.service.namespace.NamespaceException: URI http://www.alfresco.org/model/dictionary/1.0 cannot be imported as it is not defined (with prefix d
        at org.alfresco.repo.dictionary.CompiledModel.createLocalPrefixResolver(CompiledModel.java:206)
        at org.alfresco.repo.dictionary.CompiledModel.constructDefinitions(CompiledModel.java:130)
        at org.alfresco.repo.dictionary.CompiledModel.<init>(CompiledModel.java:88)
        … 12 more
2016-01-12 17:43:00,006  ERROR [quartz.core.JobRunShell] [SolrTrackerScheduler_Worker-2] Job Solr.CoreWatcher threw an unhandled Exception:
org.alfresco.service.cmr.dictionary.DictionaryException: 00120010 Failed to compile model dl:datalistmodel
        at org.alfresco.repo.dictionary.CompiledModel.<init>(CompiledModel.java:108)
        at org.alfresco.repo.dictionary.M2Model.compile(M2Model.java:163)
        at org.alfresco.repo.dictionary.DictionaryDAOImpl.putModelImpl(DictionaryDAOImpl.java:266)
        at org.alfresco.repo.dictionary.DictionaryDAOImpl.putModelIgnoringConstraints(DictionaryDAOImpl.java:259)
        at org.alfresco.solr.AlfrescoSolrDataModel.putModel(AlfrescoSolrDataModel.java:1173)
        at org.alfresco.solr.SolrInformationServer.putModel(SolrInformationServer.java:2849)
        at org.alfresco.solr.tracker.ModelTracker.loadModel(ModelTracker.java:516)
        at org.alfresco.solr.tracker.ModelTracker.loadPersistedModels(ModelTracker.java:138)
        at org.alfresco.solr.tracker.ModelTracker.<init>(ModelTracker.java:85)
        at org.alfresco.solr.tracker.CoreWatcherJob.registerForCore(CoreWatcherJob.java:123)
        at org.alfresco.solr.tracker.CoreWatcherJob.execute(CoreWatcherJob.java:74)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
Caused by: org.alfresco.service.namespace.NamespaceException: URI http://www.alfresco.org/model/dictionary/1.0 cannot be imported as it is not defined (with prefix d
        at org.alfresco.repo.dictionary.CompiledModel.createLocalPrefixResolver(CompiledModel.java:206)
        at org.alfresco.repo.dictionary.CompiledModel.constructDefinitions(CompiledModel.java:130)
        at org.alfresco.repo.dictionary.CompiledModel.<init>(CompiledModel.java:88)
        … 12 more
2016-01-12 17:43:00,007  ERROR [quartz.core.ErrorLogger] [SolrTrackerScheduler_Worker-2] Job (Solr.CoreWatcher threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.alfresco.service.cmr.dictionary.DictionaryException: 00120010 Failed to compile model dl:datalistmodel]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:227)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 00120010 Failed to compile model dl:datalistmodel
        at org.alfresco.repo.dictionary.CompiledModel.<init>(CompiledModel.java:108)
        at org.alfresco.repo.dictionary.M2Model.compile(M2Model.java:163)
        at org.alfresco.repo.dictionary.DictionaryDAOImpl.putModelImpl(DictionaryDAOImpl.java:266)
        at org.alfresco.repo.dictionary.DictionaryDAOImpl.putModelIgnoringConstraints(DictionaryDAOImpl.java:259)
        at org.alfresco.solr.AlfrescoSolrDataModel.putModel(AlfrescoSolrDataModel.java:1173)
        at org.alfresco.solr.SolrInformationServer.putModel(SolrInformationServer.java:2849)
        at org.alfresco.solr.tracker.ModelTracker.loadModel(ModelTracker.java:516)
        at org.alfresco.solr.tracker.ModelTracker.loadPersistedModels(ModelTracker.java:138)
        at org.alfresco.solr.tracker.ModelTracker.<init>(ModelTracker.java:85)
        at org.alfresco.solr.tracker.CoreWatcherJob.registerForCore(CoreWatcherJob.java:123)
        at org.alfresco.solr.tracker.CoreWatcherJob.execute(CoreWatcherJob.java:74)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
        … 1 more
Caused by: org.alfresco.service.namespace.NamespaceException: URI http://www.alfresco.org/model/dictionary/1.0 cannot be imported as it is not defined (with prefix d
        at org.alfresco.repo.dictionary.CompiledModel.createLocalPrefixResolver(CompiledModel.java:206)
        at org.alfresco.repo.dictionary.CompiledModel.constructDefinitions(CompiledModel.java:130)
        at org.alfresco.repo.dictionary.CompiledModel.<init>(CompiledModel.java:88)
        … 12 more


I dont really know what to do now, hope someone can help me, thanks in advance!
7 REPLIES 7

darkredd
Star Contributor
Star Contributor
Hi,

Remove you newly defined model from the solr indexes, then it will start.
And also check that your import statements in your model header is correctly done as the error states.

I don't think removing the model only from the Solr indexes will solve the issue. He also needs to remove the model from the repository as well, otherwise he will still get an error in the alfresco.log, maybe just not in solr.log anymore. The problem is though, how to remove a dynamic model from the repository when the repository does not even start up anymore.

I just come across this answer now because I have the exact same problem (http://stackoverflow.com/questions/34883278/alfresco-how-to-override-a-corrupt-dynamic-content-model...).

<strong>Update:</strong>
Ok, sorry, I overread that he already removed the file newType.xml; I thought it was dynamic. (Wondering why Alfresco would not start with just a Solr model error.)

blacksylo
Champ in-the-making
Champ in-the-making
Hi, thanks for the comments.

I ended up reinstalling alfresco and trying to add all the models again, which failed again.. hehe
But this time the log helped by giving me a more reasonable error about the xml file, which led me to fix it, strange because it was about the namespace URI not mapped.. but no error appeared before because of that :/.
So now everything is working as expected but that was really strange :C
BTW alfresco was running but didnt let me "log in" in Share.

Kinda solved, thank you!

muralidharand
Star Contributor
Star Contributor
Are you able to login into Share now or not?
Can you please share, share.log file here?

Yes, im able to login into Share now, but I had to reinstall.

I dont have the share.log since I reinstalled and later fixed the error.

Thanks

Hello,

Re-installing a system because there is an error is not a "good" solution, because you have not gotten to the root of the problem; it might resurface later again.
But rather, when you deal with content models; no matter what; Alfresco will never break for that reason. All you need to do is:

1. Remove everything custom that lead up to the problem.
2. Clean your indexes.
3. The log carefully, they almost always tell what the problem was. In your case your incorrectly declared model cause Alfresco to even confuse its own OOTB models.

NB: Cleaning your indexes after files removal is critical as I have to learn.

blacksylo
Champ in-the-making
Champ in-the-making
Yes, as you say re-installing is a bad solution, I tried to fix it several times before doing that but the logs were truly rare to me, so I couldnt figure out the error.
But it is exactly as you described, "In your case your incorrectly declared model cause Alfresco to even confuse its own OOTB models."
It is good that now I have some experience and know that I need to remove everything custom and clean the indexes, thank you!