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
@narkuss did you find a solution to this problem? Or another way to debug JavaScript?
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.
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?
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)
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.
Here's the override bean: https://github.com/Alfresco/alfresco-sdk/blob/alfresco-sdk-aggregator-2.2.0/archetypes/alfresco-amp-...
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.