cancel
Showing results for 
Search instead for 
Did you mean: 

WebScripts TaggingService

zafarale
Champ in-the-making
Champ in-the-making
Hi chaps,
        Got a new challenge from alfresco, i am programmatically creating tags, in my local enviornment running with maven sdk it works fine.But on dev server alfresco was installed using community bundle and the same web script fails on this line

  var store = "workspace://SpacesStore/";
  var tag = taggingService.createTag(store, tagName);


with a very misleading message to me at least.

This is the only line i passin store refrence

2014-05-16 12:09:39,640  ERROR [extensions.webscripts.AbstractRuntime] [http-apr-11130-exec-15] Exception from executeScript - redirecting to status template error: 04160196 Wrapped Exception (with status template): 04160250 Failed to execute script 'classpath*:alfresco/templates/webscripts/com/passivsystems/upload.post.js': 04160249 No solr query support for store workspace://SpacesStore/
org.springframework.extensions.webscripts.WebScriptException: 04160196 Wrapped Exception (with status template): 04160250 Failed to execute script 'classpath*:alfresco/templates/webscripts/company/upload.post.js': 04160249 No solr query support for store workspace://SpacesStore/
   at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1067)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:171)
   at org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:429)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:452)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:491)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:529)
   at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:341)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
   at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
   at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
   at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
   at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:1810)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   at java.lang.Thread.run(Thread.java:744)
Caused by: org.alfresco.scripts.ScriptException: 04160250 Failed to execute script 'classpath*:alfresco/templates/webscripts/company/upload.post.js': 04160249 No solr query support for store workspace://SpacesStore/


3 REPLIES 3

mrogers
Star Contributor
Star Contributor
04160249 No solr query support for store workspace://SpacesStore/

There's something wrong with your SOLR configuration.   That error's comming out of SOLRQueryHttpClient.

Check your search configuration.

zafarale
Champ in-the-making
Champ in-the-making
Hi mrogers,
          Can you suggest possible soultion, or does this error code indicates what went wrong.

zafarale
Champ in-the-making
Champ in-the-making
fixing space store to


function addTagToNode(node, tags){
  var store = "workspace://SpacesStore"; //removed Trailing slash

  for(var t=0; t< tags.length; t++) {
    var tag = taggingService.getTag(store, "/"+tags[t]);
    var tagExists = (tag != null);
    if (!tagExists){
                                      //Trailing Slash might have been screwing this up
       tag = taggingService.createTag(store, tags[t]);
        /*
           var tagNode = search.findNode("workspace://SpacesStore/"+tag.id);
           tagNode.properties.name=tags[t];
           tagNode.save();
        */
    }
    //tags[t] = tag;
    node.addTag(tags[t]);
  }
  //return tags;
}




"message" : "04190008 Wrapped Exception (with status template): 04190024 Failed to execute script 'classpath*:alfresco\/templates\/webscripts\/com\/passivsystems\/upload.post.js': 04190023 Request failed 404 \/solr\/alfresco\/alfresco?wt=json&fl=DBID%2Cscore&rows=1000&df=TEXT&start=0&locale=en_US&alternativeDic=DEFAULT_DICTIONARY&fq=%7B%21afts%7DAUTHORITY_FILTER_FROM_JSON&fq=%7B%21afts%7DTENANT_FILTER_FROM_JSON", 
  "exception" : "org.springframework.extensions.webscripts.WebScriptException - 04190008 Wrapped Exception (with status template): 04190024 Failed to execute script 'classpath*:alfresco\/templates\/webscripts\/company\/upload.post.js': 04190023 Request failed 404 \/solr\/alfresco\/alfresco?wt=json&fl=DBID%2Cscore&rows=1000&df=TEXT&start=0&locale=en_US&alternativeDic=DEFAULT_DICTIONARY&fq=%7B%21afts%7DAUTHORITY_FILTER_FROM_JSON&fq=%7B%21afts%7DTENANT_FILTER_FROM_JSON",