cancel
Showing results for 
Search instead for 
Did you mean: 

Back-end javascript debugger in docker environment

narkuss
Star Contributor
Star Contributor

Hi all,

When I try to activate backend javascript debugger in a dockerized Alfresco environment, it throws a 500 internal server error stating:

No X11 DISPLAY variable was set, but this program performed an operation which requires it.

Has anybody found a way to get it to work? I tried display redirect with no luck. I'm currently trying from my local machine, but I'd like to find a solution that can be applied when installed on a remote server too.

Thanks

6 REPLIES 6

upforsin
Star Collaborator
Star Collaborator

@narkuss did you find a solution to this problem? Or another way to debug JavaScript?

howkymike
Alfresco Developer

afaust
Legendary Innovator
Legendary Innovator

The backend JavaScript debugger simply cannot work in a Docker environment, or any environment where the process runs without an attached and accessible screen device. E.g. this has always been a limitation on headless servers, way before Docker was even used in the Alfresco environment. There is no workaround for this, no solution to find - the debugger itself (a component of the Rhino library) is simply not built for that.

narkuss
Star Contributor
Star Contributor

Aaargh, that was exactly the answer I was expecting to not hear from someone.

Answering the original question, no, I didn't find a way to make it work. I tried it with screen redirection from docker, as stated in some posts; installing some dependencies, but I wasn't able to make it work.

I really was expecting some CentOS / Docker expert to give us a magical answer but tonight I've lost any hope.

Then, there's no way to debug server-side javascript right now?

upforsin
Star Collaborator
Star Collaborator

Thank you @afaust for the reply. I guess the old good printing method is the only option left. 

Sadly, there is no way to "hot reload" JavaScript just like Java files, am right? (constant server restarts are really frustrating)

howkymike
Alfresco Developer

ohej
Star Contributor
Star Contributor

If you are developing a web script you can try "Refresh Webscripts" from /alfresco/service/index. If the files have changed on disk they should be reloaded.

Way back in the day the Alfresco SDK would override the RhinoScriptProcessor bean and disable the caching. I have not tested this in years so I cannot verify if this will work, however it might point you in the right direction.