cancel
Showing results for 
Search instead for 
Did you mean: 

Enable web script debugging on a headless server

smcardle
Champ in-the-making
Champ in-the-making
Hi All.

Is it possible to enable the web script debugger on a headlesss server?

I have installed the latest community version 4.2.c on Ubuntu 12.04, Mac OSX 10.7 and Windows 7.

On the Ubuntu server it just generates a headless missing X11 config exception when trying to enable the debugger. Since this is a server there is no UI and X11 is not installed so I am using a browser on another machine.
On the OSX environment I get a similar headless exception even though OSX DOES have a GUI so this one seems to be ODD!!! as I am using a browser on the same machine. I suspect it may be an issue with java 7 on OSX.
On the Windows 7 environment I had to disable the Alfresco services and run alfresco from the tomcat/bin/startup.bat file to enable the debugger (will not enable when Alfresco is run as a service), after this all is good….

I assume it's not possible to remotely debug web scripts… i.e. debug webscripts deployed to my ubuntu server using firefox on a Windows 7 machine.

I can't find any section in the documentation that states how to enable the debugger, actually that's not quite true, it states to enable it using the enable button. But as you can see there seems to be restrictions on what environments it can be enabled on and this is not mentioned….. Any chance somebody can update the documentation with the minimum requirements to be able to debug webscript controllers.

Regards

Steve
2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator
Hello,

unfortunately, it is not possible with the default Alfresco script environment to remote debug JavaScript web scripts (Java-baed web scripts can be remote debugged using any IDE debugger capable of remoting). There is a possibility to do this by adding some utilities from the Eclipse environment, namely the JavaScript Development Tools project. If you're interested, please see a blog post of mine about Alfresco and JSDT.

As I'm not familiar with Apple-tech, I can't say why you're not able to activate the debugger in your OSX environment. Is Alfresco running in a different user context than you are using when working with a browser? Does the user session in which Alfresco runs actually have access to the display on the OS layer (I don't know how OSX handles deamons)?

Regards
Axel

smcardle
Champ in-the-making
Champ in-the-making
Thanks for the comment Axel.

I am very familiar with remote debugging of Alfresco's java code using Eclipse and use this regularly. However, I am very keen to get an update as to your latest trials with the remote debugging of the WebScript JavaScript controllers. This is an area hat gives me lots of issues due to the fact that our installations are mostly deplyed to headless servers.

In fact, the usual aproach has been to deploy the scripts that need debugging to a debug instance of Alfresco running on a GUI enabled version of Ubuntu or Centos. As you can imagine this is often a real issue as a lot of the scripts we need to debug rely on various content being available, so it often involves a close inspection of the script (some quite complicated) before a debug session just to work out what content from a headless server instance is required (such as pre-defined templates) before we can even get down to the debuging.

Along with other issues such as the debug environment no longer represents a realistic copy of the headless environments etc.

Look forward to hearing back from you.

Regards