Back-end javascript debugger in docker environment

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2019 06:49 AM
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
- Labels:
-
Alfresco Content Services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2020 11:59 AM
@narkuss did you find a solution to this problem? Or another way to debug JavaScript?
Alfresco Developer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2020 12:19 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2020 05:05 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2020 07:36 PM
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)
Alfresco Developer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2020 05:33 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2020 05:34 AM
Here's the override bean: https://github.com/Alfresco/alfresco-sdk/blob/alfresco-sdk-aggregator-2.2.0/archetypes/alfresco-amp-...
