Creation of REST API using Java

cancel
Showing results for 
Search instead for 
Did you mean: 
Tabu
Member II

Creation of REST API using Java

Hello,
I have created a maven project using platform-jar archetype for Alfresco Repository to fetch the details of the workflows. Iam using Alfresco 5.1 Community Edition. Once the execution is started it displays its running on the local server with the port number but it doesn't display any output on the installed Alfresco and then suddenly I get this error.

2021-02-06 17:20:41,569 ERROR [solr.tracker.AbstractTracker] [org.alfresco.solr.AlfrescoCoreAdminHandler@27269a45_Worker-1] Model tracking failed
org.alfresco.error.AlfrescoRuntimeException: 01060000 GetModelsDiff return status is 404
at org.alfresco.solr.client.SOLRAPIClient.getModelsDiff(SOLRAPIClient.java:1181)
at org.alfresco.solr.tracker.ModelTracker.trackModelsImpl(ModelTracker.java:256)
at org.alfresco.solr.tracker.ModelTracker.trackModels(ModelTracker.java:214)
at org.alfresco.solr.tracker.ModelTracker.ensureFirstModelSync(ModelTracker.java:236)
at org.alfresco.solr.tracker.CoreWatcherJob.registerForCore(CoreWatcherJob.java:145)
at org.alfresco.solr.tracker.CoreWatcherJob.execute(CoreWatcherJob.java:82)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
2021-02-06 17:20:41,633 ERROR [solr.tracker.AbstractTracker] [org.alfresco.solr.AlfrescoCoreAdminHandler@27269a45_Worker-1] Model tracking failed
org.alfresco.error.AlfrescoRuntimeException: 01060001 GetModelsDiff return status is 404
at org.alfresco.solr.client.SOLRAPIClient.getModelsDiff(SOLRAPIClient.java:1181)
at org.alfresco.solr.tracker.ModelTracker.trackModelsImpl(ModelTracker.java:256)
at org.alfresco.solr.tracker.ModelTracker.trackModels(ModelTracker.java:214)
at org.alfresco.solr.tracker.ModelTracker.ensureFirstModelSync(ModelTracker.java:236)
at org.alfresco.solr.tracker.CoreWatcherJob.registerForCore(CoreWatcherJob.java:145)
at org.alfresco.solr.tracker.CoreWatcherJob.execute(CoreWatcherJob.java:82)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
2021-02-06 17:20:45,107 ERROR [solr.tracker.AbstractTracker] [org.alfresco.solr.AlfrescoCoreAdminHandler@27269a45_Worker-4] Tracking failed
org.alfresco.error.AlfrescoRuntimeException: 01060003 api/solr/aclchangesets return status:404
at org.alfresco.solr.client.SOLRAPIClient.getAclChangeSets(SOLRAPIClient.java:169)
at org.alfresco.solr.tracker.AclTracker.checkRepoAndIndexConsistency(AclTracker.java:342)
at org.alfresco.solr.tracker.AclTracker.trackRepository(AclTracker.java:320)
at org.alfresco.solr.tracker.AclTracker.doTrack(AclTracker.java:111)
at org.alfresco.solr.tracker.AbstractTracker.track(AbstractTracker.java:190)
at org.alfresco.solr.tracker.TrackerJob.execute(TrackerJob.java:54)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
2021-02-06 17:20:45,122 ERROR [solr.tracker.AbstractTracker] [org.alfresco.solr.AlfrescoCoreAdminHandler@27269a45_Worker-3] Tracking failed
org.alfresco.error.AlfrescoRuntimeException: 01060002 api/solr/aclchangesets return status:404
at org.alfresco.solr.client.SOLRAPIClient.getAclChangeSets(SOLRAPIClient.java:169)
at org.alfresco.solr.tracker.AclTracker.checkRepoAndIndexConsistency(AclTracker.java:342)
at org.alfresco.solr.tracker.AclTracker.trackRepository(AclTracker.java:320)
at org.alfresco.solr.tracker.AclTracker.doTrack(AclTracker.java:111)
at org.alfresco.solr.tracker.AbstractTracker.track(AbstractTracker.java:190)
at org.alfresco.solr.tracker.TrackerJob.execute(TrackerJob.java:54)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
2021-02-06 17:20:45,140 ERROR [solr.tracker.AbstractTracker] [org.alfresco.solr.AlfrescoCoreAdminHandler@27269a45_Worker-2] Tracking failed
org.alfresco.error.AlfrescoRuntimeException: 01060004 GetModelsDiff return status is 404
at org.alfresco.solr.client.SOLRAPIClient.getModelsDiff(SOLRAPIClient.java:1181)
at org.alfresco.solr.tracker.ModelTracker.trackModelsImpl(ModelTracker.java:256)
at org.alfresco.solr.tracker.ModelTracker.trackModels(ModelTracker.java:214)
at org.alfresco.solr.tracker.ModelTracker.doTrack(ModelTracker.java:174)
at org.alfresco.solr.tracker.AbstractTracker.track(AbstractTracker.java:190)
at org.alfresco.solr.tracker.TrackerJob.execute(TrackerJob.java:54)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
2021-02-06 17:20:45,149 ERROR [solr.tracker.AbstractTracker] [org.alfresco.solr.AlfrescoCoreAdminHandler@27269a45_Worker-6] Model tracking failed
org.alfresco.error.AlfrescoRuntimeException: 01060005 GetModelsDiff return status is 404
at org.alfresco.solr.client.SOLRAPIClient.getModelsDiff(SOLRAPIClient.java:1181)
at org.alfresco.solr.tracker.ModelTracker.trackModelsImpl(ModelTracker.java:256)
at org.alfresco.solr.tracker.ModelTracker.trackModels(ModelTracker.java:214)
at org.alfresco.solr.tracker.ModelTracker.ensureFirstModelSync(ModelTracker.java:236)
at org.alfresco.solr.component.EnsureModelsComponent.prepare(EnsureModelsComponent.java:87)
at org.apache.solr.handler.component.AlfrescoSearchHandler.handleRequestBody(AlfrescoSearchHandler.java:292)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
at org.alfresco.solr.Cloud.getResponse(Cloud.java:166)
at org.alfresco.solr.Cloud.getSolrDocumentList(Cloud.java:150)
at org.alfresco.solr.SolrInformationServer.getDocsWithUncleanContent(SolrInformationServer.java:722)
at org.alfresco.solr.tracker.ContentTracker.doTrack(ContentTracker.java:81)
at org.alfresco.solr.tracker.AbstractTracker.track(AbstractTracker.java:190)
at org.alfresco.solr.tracker.TrackerJob.execute(TrackerJob.java:54)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
2021-02-06 17:20:45,223 ERROR [solr.tracker.AbstractTracker] [org.alfresco.solr.AlfrescoCoreAdminHandler@27269a45_Worker-5] Model tracking failed
org.alfresco.error.AlfrescoRuntimeException: 01060006 GetModelsDiff return status is 404
at org.alfresco.solr.client.SOLRAPIClient.getModelsDiff(SOLRAPIClient.java:1181)
at org.alfresco.solr.tracker.ModelTracker.trackModelsImpl(ModelTracker.java:256)
at org.alfresco.solr.tracker.ModelTracker.trackModels(ModelTracker.java:214)
at org.alfresco.solr.tracker.ModelTracker.ensureFirstModelSync(ModelTracker.java:236)
at org.alfresco.solr.component.EnsureModelsComponent.prepare(EnsureModelsComponent.java:87)
at org.apache.solr.handler.component.AlfrescoSearchHandler.handleRequestBody(AlfrescoSearchHandler.java:292)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
at org.alfresco.solr.Cloud.getResponse(Cloud.java:166)
at org.alfresco.solr.Cloud.getSolrDocumentList(Cloud.java:150)
at org.alfresco.solr.SolrInformationServer.getDocsWithUncleanContent(SolrInformationServer.java:722)
at org.alfresco.solr.tracker.ContentTracker.doTrack(ContentTracker.java:81)
at org.alfresco.solr.tracker.AbstractTracker.track(AbstractTracker.java:190)
at org.alfresco.solr.tracker.TrackerJob.execute(TrackerJob.java:54)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
2021-02-06 17:21:00,022 ERROR [solr.tracker.AbstractTracker] [org.alfresco.solr.AlfrescoCoreAdminHandler@27269a45_Worker-9] Tracking failed
org.alfresco.error.AlfrescoRuntimeException: 01060007 api/solr/aclchangesets return status:404
at org.alfresco.solr.client.SOLRAPIClient.getAclChangeSets(SOLRAPIClient.java:169)
at org.alfresco.solr.tracker.AclTracker.checkRepoAndIndexConsistency(AclTracker.java:342)
at org.alfresco.solr.tracker.AclTracker.trackRepository(AclTracker.java:320)
at org.alfresco.solr.tracker.AclTracker.doTrack(AclTracker.java:111)
at org.alfresco.solr.tracker.AbstractTracker.track(AbstractTracker.java:190)
at org.alfresco.solr.tracker.TrackerJob.execute(TrackerJob.java:54)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
2021-02-06 17:21:00,053 ERROR [solr.tracker.AbstractTracker] [org.alfresco.solr.AlfrescoCoreAdminHandler@27269a45_Worker-11] Model tracking failed
org.alfresco.error.AlfrescoRuntimeException: 01060008 GetModelsDiff return status is 404
at org.alfresco.solr.client.SOLRAPIClient.getModelsDiff(SOLRAPIClient.java:1181)
at org.alfresco.solr.tracker.ModelTracker.trackModelsImpl(ModelTracker.java:256)
at org.alfresco.solr.tracker.ModelTracker.trackModels(ModelTracker.java:214)
at org.alfresco.solr.tracker.ModelTracker.ensureFirstModelSync(ModelTracker.java:236)
at org.alfresco.solr.component.EnsureModelsComponent.prepare(EnsureModelsComponent.java:87)
at org.apache.solr.handler.component.AlfrescoSearchHandler.handleRequestBody(AlfrescoSearchHandler.java:292)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
at org.alfresco.solr.Cloud.getResponse(Cloud.java:166)
at org.alfresco.solr.Cloud.getSolrDocumentList(Cloud.java:150)
at org.alfresco.solr.SolrInformationServer.getDocsWithUncleanContent(SolrInformationServer.java:722)
at org.alfresco.solr.tracker.ContentTracker.doTrack(ContentTracker.java:81)
at org.alfresco.solr.tracker.AbstractTracker.track(AbstractTracker.java:190)
at org.alfresco.solr.tracker.TrackerJob.execute(TrackerJob.java:54)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
2021-02-06 17:21:00,067 ERROR [solr.tracker.AbstractTracker] [org.alfresco.solr.AlfrescoCoreAdminHandler@27269a45_Worker-10] Tracking failed
org.alfresco.error.AlfrescoRuntimeException: 01060009 api/solr/aclchangesets return status:404
at org.alfresco.solr.client.SOLRAPIClient.getAclChangeSets(SOLRAPIClient.java:169)
at org.alfresco.solr.tracker.AclTracker.checkRepoAndIndexConsistency(AclTracker.java:342)
at org.alfresco.solr.tracker.AclTracker.trackRepository(AclTracker.java:320)
at org.alfresco.solr.tracker.AclTracker.doTrack(AclTracker.java:111)
at org.alfresco.solr.tracker.AbstractTracker.track(AbstractTracker.java:190)
at org.alfresco.solr.tracker.TrackerJob.execute(TrackerJob.java:54)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
2021-02-06 17:21:00,085 ERROR [solr.tracker.AbstractTracker] [org.alfresco.solr.AlfrescoCoreAdminHandler@27269a45_Worker-12] Model tracking failed
org.alfresco.error.AlfrescoRuntimeException: 01060010 GetModelsDiff return status is 404
at org.alfresco.solr.client.SOLRAPIClient.getModelsDiff(SOLRAPIClient.java:1181)
at org.alfresco.solr.tracker.ModelTracker.trackModelsImpl(ModelTracker.java:256)
at org.alfresco.solr.tracker.ModelTracker.trackModels(ModelTracker.java:214)
at org.alfresco.solr.tracker.ModelTracker.ensureFirstModelSync(ModelTracker.java:236)
at org.alfresco.solr.component.EnsureModelsComponent.prepare(EnsureModelsComponent.java:87)
at org.apache.solr.handler.component.AlfrescoSearchHandler.handleRequestBody(AlfrescoSearchHandler.java:292)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
at org.alfresco.solr.Cloud.getResponse(Cloud.java:166)
at org.alfresco.solr.Cloud.getSolrDocumentList(Cloud.java:150)
at org.alfresco.solr.SolrInformationServer.getDocsWithUncleanContent(SolrInformationServer.java:722)
at org.alfresco.solr.tracker.ContentTracker.doTrack(ContentTracker.java:81)
at org.alfresco.solr.tracker.AbstractTracker.track(AbstractTracker.java:190)
at org.alfresco.solr.tracker.TrackerJob.execute(TrackerJob.java:54)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
2021-02-06 17:21:00,116 ERROR [solr.tracker.AbstractTracker] [org.alfresco.solr.AlfrescoCoreAdminHandler@27269a45_Worker-16] Tracking failed
org.alfresco.error.AlfrescoRuntimeException: 01060011 GetModelsDiff return status is 404
at org.alfresco.solr.client.SOLRAPIClient.getModelsDiff(SOLRAPIClient.java:1181)
at org.alfresco.solr.tracker.ModelTracker.trackModelsImpl(ModelTracker.java:256)
at org.alfresco.solr.tracker.ModelTracker.trackModels(ModelTracker.java:214)
at org.alfresco.solr.tracker.ModelTracker.doTrack(ModelTracker.java:174)
at org.alfresco.solr.tracker.AbstractTracker.track(AbstractTracker.java:190)
at org.alfresco.solr.tracker.TrackerJob.execute(TrackerJob.java:54)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)

Please do provide a solution. Any help would be appreciated.
Thank You!

6 Replies
sufo
Established Member II

Re: Creation of REST API using Java

Seems that Repository did not start and Solr logs these errors as it can't contact Repository.
How do you start it?
Try to search for alfresco.log and look for the errors there.

jpotts
Professional

Re: Creation of REST API using Java

What version of the SDK did you use? You are using Alfresco 5.1 so that will require SDK 2.2.x according to this compatability page in the docs.

Tabu
Member II

Re: Creation of REST API using Java

Iam starting it by building the maven project in Eclipse IDE

Tabu
Member II

Re: Creation of REST API using Java

Iam using SDK 3.0

abhinavmishra14
Moderator
Moderator

Re: Creation of REST API using Java

@Tabu As indicated by Jeff already, the compitable SDK version for 5.1.x is SDK2.2.0. SDK.3.x may not work for alfresco 5.1.x correctly. If you have generate the artifacts using sdk3.x and update (<alfresco.platform.version>5.1.e</alfresco.platform.version> and <alfresco.share.version>5.1.e</alfresco.share.version>) properties with version as 5.1.x then you may be able to run alfresco and share using sdk3.x. Any change to structure may cause errors. So its better to go for recommended sdk version for 5.1.x

Try with SDK2.2.0, i just tried 5.1.e and it runs completely fine.  

Use goals with profile for SDK2.2.0: mvn clean install -Prun

Check the documentation here: https://docs.alfresco.com/5.1/concepts/alfresco-sdk-intro.html

https://docs.alfresco.com/5.1/tasks/alfresco-sdk-tutorials-all-in-one-archetype.html

 

 

5.1.e.PNG

 

~Abhinav
(ACSCE, AWS SAA-C02, GAIQ)
Tabu
Member II

Re: Creation of REST API using Java

alfresco_version.png

Iam using 5.1.f version of Alfresco Community edition.
In Eclipse IDE the Maven Central link(https://artifacts.alfresco.com/nexus/content/groups/public/archetype-catalog.xml) to create the Alfresco All-in-one Archetype and the goal(clean install -DskipTests=true alfresco:run).
Please do provide the link which can be compatible with my version of installed Alfresco.