AnsweredAssumed Answered

javascript debugger error

Question asked by sharifu on Sep 11, 2012
Latest reply on Sep 23, 2012 by shazada
When i visit the following link and try o enable the debugger i get an error

http://localhost:8080/alfresco/service/api/javascript/debugger


The Web Script /alfresco/service/api/javascript/debugger has responded with a status of 500 - Internal Error.

500 Description:

An error inside the HTTP server which prevented it from fulfilling the request.

Message:

08110007 Wrapped Exception (with status template): No X11 DISPLAY variable was set, but this program performed an operation which requires it.

Exception:

java.awt.HeadlessException - No X11 DISPLAY variable was set, but this program performed an operation which requires it.
java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
java.awt.Window.<init>(Window.java:432)
java.awt.Frame.<init>(Frame.java:403)
javax.swing.JFrame.<init>(JFrame.java:202)
org.mozilla.javascript.tools.debugger.SwingGui.<init>(SwingGui.java:152)
org.springframework.extensions.webscripts.ScriptDebugger$AlfrescoGui.<init>(ScriptDebugger.java:165)
org.springframework.extensions.webscripts.ScriptDebugger.activate(ScriptDebugger.java:86)
org.springframework.extensions.webscripts.ScriptDebugger.show(ScriptDebugger.java:104)
org.springframework.extensions.webscripts.bean.JavascriptDebuggerPost.executeImpl(JavascriptDebuggerPost.java:61)
org.springframework.extensions.webscripts.DeclarativeWebScript.executeImpl(DeclarativeWebScript.java:235)
org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:64)
org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:400)
org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:388)
org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:462)
org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:500)
org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:316)
org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:372)
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: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.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
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:857)
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:662)

Exception:

org.springframework.extensions.webscripts.WebScriptException - 08110007 Wrapped Exception (with status template): No X11 DISPLAY variable was set, but this program performed an operation which requires it.
org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:970)


Server:

Community v4.0.0 (4003) schema 5,025



Time:

11-Sep-2012 11:08:36


Diagnostics:

Inspect Web Script (org/springframework/extensions/webscripts/jsdebugger.post)


When I click on diagnostic link i get the following




Web Script: org/springframework/extensions/webscripts/jsdebugger.post



Generated from /alfresco/service/script/org/springframework/extensions/webscripts/jsdebugger.post on 11-Sep-2012 11:11:14






Script Properties



Id:

org/springframework/extensions/webscripts/jsdebugger.post



Short Name:

Javascript Debugger Maintenance



Description:

Javascript Debugger Maintenance



Authentication:

admin



Transaction:

required



Method:

POST



URL Template:

/api/javascript/debugger?active={active?}



Format Style:

any



Default Format:

html



Negotiated Formats:

[undefined]



Implementation:

class org.springframework.extensions.webscripts.bean.JavascriptDebuggerPost



Extensions:

[undefined]


Store: workspace://SpacesStore/app:company_home/app:dictionary/cm:extensionwebscripts





[No implementation files]


Store: workspace://SpacesStore/app:company_home/app:dictionary/cm:webscripts





[No implementation files]


Store: classpath:alfresco/extension/templates/webscripts





[No implementation files]


Store: classpath:alfresco/templates/webscripts





[No implementation files]


Store: classpath:webscripts








File: org/springframework/extensions/webscripts/jsdebugger.post.desc.xml



<webscript>
  <shortname>Javascript Debugger Maintenance</shortname>
  <description>Javascript Debugger Maintenance</description>
  <url>/api/javascript/debugger?active={active?}</url>
  <authentication>admin</authentication>
</webscript>


File: org/springframework/extensions/webscripts/jsdebugger.post.html.ftl



<#import "/org/springframework/extensions/webscripts/webscripts.lib.html.ftl" as wsLib/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   <@wsLib.head>Alfresco Javascript Debugger</@wsLib.head>
   <body>
     <div>
      <form action="${url.serviceContext}${url.match}" method="post">
         <div>
            <input type="hidden" name="visible" value="<#if visible>false<#else>true</#if>" />
            <table>
               <tr>
                  <td><img src="${resourceurl('/images/logo/AlfrescoLogo32.png', true)}" alt="Alfresco" /></td>
                  <td><span class="title">Alfresco Javascript Debugger</span></td>
               </tr>
               <tr><td colspan="2">Alfresco ${server.edition?html} v${server.version?html}</td></tr>
               <tr><td colspan="2">Currently <#if visible>enabled<#else>disabled</#if>.
                                   <input type="submit" name="submit" value="<#if visible>Disable<#else>Enable</#if>" /></td></tr>
            </table>
         </div>
      </form>
      </div>
   </body>
</html>

Outcomes