cancel
Showing results for 
Search instead for 
Did you mean: 

Error trying to retrieve json from out-of-the-box query web script

jrorke
Champ in-the-making
Champ in-the-making
Newbie trying to use the out of the box web scripts to retrieve json data.  Does "format=json" work out of the box. Or do I need to install the cmis-query-webscript amp add on?

when doing this…


http://localhost:8080/alfresco/service/cmis/query?q=SELECT%20cmis:name%20FROM%20swaom:doc%20WHERE%20...


I get this…


{
    "status" :
  {
    "code" : 500,
    "name" : "Internal Error",
    "description" : "An error inside the HTTP server which prevented it from fulfilling the request."
  }, 
 
  "message" : "09060001 Cannot locate template processor for template org\/alfresco\/cmis\/query.get.json", 
  "exception" : "org.springframework.extensions.webscripts.WebScriptException - 09060001 Cannot locate template processor for template org\/alfresco\/cmis\/query.get.json",
 
  "callstack" :
  [
       ""      ,"org.springframework.extensions.webscripts.WebScriptException: 09060001 Cannot locate template processor for template org\/alfresco\/cmis\/query.get.json"
      ,"org.springframework.extensions.webscripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:904)"
      ,"org.springframework.extensions.webscripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:267)"
      ,"org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:147)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:426)"
      ,"org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:433)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:495)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:533)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:349)"
      ,"org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:377)"
      ,"org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)"
      ,"org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)"
      ,"javax.servlet.http.HttpServlet.service(HttpServlet.java:722)"
      ,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)"
      ,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)"
      ,"org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)"
      ,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)"
      ,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)"
      ,"org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)"
      ,"org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)"
      ,"org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)"
      ,"org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)"
      ,"org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)"
      ,"org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)"
      ,"org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)"
      ,"org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)"
      ,"org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)"
      ,"org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)"
      ,"org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1813)"
      ,"java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)"
      ,"java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)"
      ,"java.lang.Thread.run(Thread.java:722)"

  ],
 
  "server" : "Community v4.2.0 (4576) schema 6,022",
  "time" : "Oct 6, 2013 8:34:13 AM"
}
5 REPLIES 5

kaynezhang
World-Class Innovator
World-Class Innovator
By default CMIS Query webscript only support atomfeed format and also atomfeed is it's default format.
If you want to return json format you should install cmis-query-webscript amp add on

jrorke
Champ in-the-making
Champ in-the-making
Thank you. That is what I suspected.

jrorke
Champ in-the-making
Champ in-the-making
Is this the extension I am looking for:
https://code.google.com/p/alfresco-cmis-query-webscript-extencion/

I installed it, per the alfresco-mmt.jar instructions, and I still have the same error.  Am I missing something here?

jrorke
Champ in-the-making
Champ in-the-making
Had to clean Tomcat.  That did the trick.

Thanks.

kaynezhang
World-Class Innovator
World-Class Innovator
Yes Alfresco CMIS Query Webscript Extention is what you need ,before installing  the amp you should stop your repository server.