AnsweredAssumed Answered

REST PUT for sites Error 500

Question asked by hridder on Jan 27, 2011
Latest reply on Jan 28, 2011 by mrogers
Hello,

I'm developing a Simple JAVA interface for Alfresco. It works fine for GET, POST and DELETE.

But the PUT command always gives me an error 500. I also tested it with the Chrome Simple REST Client: the same occurs: always an Error 500.

Has anybody more experiences with this ?
Many thanks for any Help.

Details (The site appinttst3 exists)
URL:
http://xxx.xxx.xxx.xxx:8080/alfresco/service/api/sites/appinttst3?alf_ticket=TICKET_d5f9caf3d7xxxxxxxxxxxxxxx

Headers:
Content-Type=application/json
Accept=application/json

Data:
{
    "title" : "Application Integration test 3"
}

Response:
500 Internal Server Error

{
    "status" :
  {
    "code" : 500,
    "name" : "Internal Error",
    "description" : "An error inside the HTTP server which prevented it from fulfilling the request."
  }, 
 
  "message" : "00270037 Wrapped Exception (with status template): 00270032 Error during processing of the template 'Expression site.shortName is undefined on line 4, column 57 in org\/alfresco\/repository\/site\/site.lib.ftl.'. Please contact your system administrator.", 
  "exception" : "org.springframework.extensions.webscripts.WebScriptException - 00270037 Wrapped Exception (with status template): 00270032 Error during processing of the template 'Expression site.shortName is undefined on line 4, column 57 in org\/alfresco\/repository\/site\/site.lib.ftl.'. Please contact your system administrator.",
 
  "callstack" :
  [
        ""      ,"freemarker.core.InvalidReferenceException: Expression site.shortName is undefined on line 4, column 57 in org\/alfresco\/repository\/site\/site.lib.ftl."
      ,"freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)"
      ,"freemarker.core.Expression.getStringValue(Expression.java:118)"
      ,"freemarker.core.AddConcatExpression._getAsTemplateModel(AddConcatExpression.java:98)"
      ,"freemarker.core.Expression.getAsTemplateModel(Expression.java:89)"
      ,"freemarker.core.ListLiteral.getModelList(ListLiteral.java:119)"
      ,"freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:89)"
      ,"freemarker.core.Expression.getAsTemplateModel(Expression.java:89)"
      ,"freemarker.core.Expression.getStringValue(Expression.java:93)"
      ,"freemarker.core.DollarVariable.accept(DollarVariable.java:76)"
      ,"freemarker.core.Environment.visit(Environment.java:210)"
      ,"freemarker.core.MixedContent.accept(MixedContent.java:92)"
      ,"freemarker.core.Environment.visit(Environment.java:210)"
      ,"freemarker.core.EscapeBlock.accept(EscapeBlock.java:84)"
      ,"freemarker.core.Environment.visit(Environment.java:210)"
      ,"freemarker.core.Macro$Context.runMacro(Macro.java:172)"
      ,"freemarker.core.Environment.visit(Environment.java:603)"
      ,"freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)"
      ,"freemarker.core.Environment.visit(Environment.java:210)"
      ,"freemarker.core.MixedContent.accept(MixedContent.java:92)"
      ,"freemarker.core.Environment.visit(Environment.java:210)"
      ,"freemarker.core.Environment.process(Environment.java:190)"
      ,"freemarker.template.Template.process(Template.java:237)"
      ,"org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:197)"
      ,"org.springframework.extensions.webscripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:589)"
      ,"org.springframework.extensions.webscripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:267)"
      ,"org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:147)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:383)"
      ,"org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:381)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:436)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:466)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:304)"
      ,"org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)"
      ,"org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)"
      ,"org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)"
      ,"javax.servlet.http.HttpServlet.service(HttpServlet.java:717)"
      ,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)"
      ,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)"
      ,"org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)"
      ,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)"
      ,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)"
      ,"org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)"
      ,"org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)"
      ,"org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)"
      ,"org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)"
      ,"org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)"
      ,"org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)"
      ,"org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)"
      ,"org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)"
      ,"org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)"
      ,"java.lang.Thread.run(Thread.java:619)"
      ,"org.alfresco.service.cmr.repository.TemplateException: 00270032 Error during processing of the template 'Expression site.shortName is undefined on line 4, column 57 in org\/alfresco\/repository\/site\/site.lib.ftl.'. Please contact your system administrator."
      ,"org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:201)"
      ,"org.springframework.extensions.webscripts.WebScriptException: 00270037 Wrapped Exception (with status template): 00270032 Error during processing of the template 'Expression site.shortName is undefined on line 4, column 57 in org\/alfresco\/repository\/site\/site.lib.ftl.'. Please contact your system administrator."
      ,"org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:758)"

  ],
 
  "server" : "Community v3.4.0 (c 3335) schema 4,113",
  "time" : "Jan 27, 2011 10:57:47 PM"
}

Outcomes