SOLVED: Cannot read property 'cloneNode' of null

Enonic version: v6.4.3
OS: Ubuntu 16.04

I’m trying to get Enonic working locally for the first time. I followed the instructions here:
https://xp.readthedocs.io/en/6.4/getstarted/download.html

I followed the configuration instructions to change the port in the Jetty config file to an alternative port, since 8080 is taken by an existing Tomcat installation. Also, my Java version is Oracle 1.8.0_171. I don’t seem to be able to get a higher version of 8 through any of the major package managers.

When I start Enonic up, the log looks good, and I can log in. However, the right hand launcher panel is transparent and empty. My Chrome developer console says:

launcher.js:62 Uncaught TypeError: Cannot read property 'cloneNode' of null
    at HTMLLinkElement.link.onload (launcher.js:62)
link.onload @ launcher.js:62
load (async)
createLauncherLink @ launcher.js:61
appendLauncherPanel @ launcher.js:39
init @ launcher.js:293
(anonymous) @ launcher.js:296
(anonymous) @ launcher.js:297

Then, if I look at the Enonic log, I see this stack trace has appeared. What can I do to get this working?

19:23:28.448 WARN  o.e.jetty.servlet.ServletHandler - Error for /admin/tool/com.enonic.xp.admin.ui/launcher
java.lang.NoSuchMethodError: jdk.nashorn.internal.objects.NativeArray.push(Ljava/lang/Object;Ljava/lang/Object;)J
	at com.enonic.xp.script.impl.util.NashornHelper.addToNativeArray(NashornHelper.java:54) ~[na:na]
	at com.enonic.xp.script.impl.value.JsObjectConverter.toJs(JsObjectConverter.java:59) ~[na:na]
	at com.enonic.xp.script.impl.value.JsObjectConverter.toJs(JsObjectConverter.java:30) ~[na:na]
	at com.enonic.xp.script.impl.function.ScriptFunctions.toNativeObject(ScriptFunctions.java:74) ~[na:na]
	at jdk.nashorn.internal.scripts.Script$Recompilation$23$456$launcher.L:1#getAdminTools(com.enonic.xp.admin.ui:/admin/tools/launcher/launcher.js:7) ~[na:na]
	at jdk.nashorn.internal.scripts.Script$Recompilation$22$613A$launcher.L:1#handleGet(com.enonic.xp.admin.ui:/admin/tools/launcher/launcher.js:16) ~[na:na]
	at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:639) ~[nashorn.jar:na]
	at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494) ~[nashorn.jar:na]
	at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393) ~[nashorn.jar:na]
	at jdk.nashorn.api.scripting.ScriptObjectMirror.call(ScriptObjectMirror.java:117) ~[nashorn.jar:na]
	at com.enonic.xp.script.impl.function.CallFunction.call(CallFunction.java:24) ~[na:na]
	at jdk.nashorn.api.scripting.ScriptObjectMirror.callMember(ScriptObjectMirror.java:201) ~[nashorn.jar:na]
	at jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScriptEngine.java:386) ~[nashorn.jar:na]
	at jdk.nashorn.api.scripting.NashornScriptEngine.invokeMethod(NashornScriptEngine.java:199) ~[nashorn.jar:na]
	at com.enonic.xp.script.impl.executor.ScriptExecutorImpl.invokeMethod(ScriptExecutorImpl.java:166) ~[na:na]
	at com.enonic.xp.script.impl.value.FunctionScriptValue.call(FunctionScriptValue.java:29) ~[na:na]
	at com.enonic.xp.script.impl.ScriptExportsImpl.executeMethod(ScriptExportsImpl.java:56) ~[na:na]
	at com.enonic.xp.portal.impl.controller.ControllerScriptImpl.doExecute(ControllerScriptImpl.java:53) ~[na:na]
	at com.enonic.xp.portal.impl.controller.ControllerScriptImpl.execute(ControllerScriptImpl.java:32) ~[na:na]
	at com.enonic.xp.admin.impl.portal.AdminToolHandlerWorker.execute(AdminToolHandlerWorker.java:48) ~[na:na]
	at com.enonic.xp.portal.handler.BaseHandler.handle(BaseHandler.java:68) ~[na:na]
	at com.enonic.xp.portal.impl.PortalServlet.doHandle(PortalServlet.java:205) ~[na:na]
	at com.enonic.xp.portal.impl.PortalServlet.service(PortalServlet.java:76) ~[na:na]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[web-jetty-6.4.3.jar:6.4.3]
	at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:85) ~[web-jetty-6.4.3.jar:6.4.3]
	at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:79) ~[web-jetty-6.4.3.jar:6.4.3]
	at com.enonic.xp.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:26) ~[na:na]
	at com.enonic.xp.web.filter.BaseWebFilter.doFilter(BaseWebFilter.java:33) ~[na:na]
	at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135) ~[web-jetty-6.4.3.jar:6.4.3]
	at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74) ~[web-jetty-6.4.3.jar:6.4.3]
	at com.enonic.xp.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:26) ~[na:na]
	at com.enonic.xp.web.filter.BaseWebFilter.doFilter(BaseWebFilter.java:33) ~[na:na]
	at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135) ~[web-jetty-6.4.3.jar:6.4.3]
	at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74) ~[web-jetty-6.4.3.jar:6.4.3]
	at com.enonic.xp.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:26) ~[na:na]
	at com.enonic.xp.web.filter.BaseWebFilter.doFilter(BaseWebFilter.java:33) ~[na:na]
	at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135) ~[web-jetty-6.4.3.jar:6.4.3]
	at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74) ~[web-jetty-6.4.3.jar:6.4.3]
	at org.apache.felix.http.base.internal.dispatch.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:73) ~[web-jetty-6.4.3.jar:6.4.3]
	at com.enonic.xp.admin.impl.portal.PortalToolForwardHandler.forwardToPortal(PortalToolForwardHandler.java:47) ~[na:na]
	at com.enonic.xp.admin.impl.portal.PortalToolForwardHandler.service(PortalToolForwardHandler.java:34) ~[na:na]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[web-jetty-6.4.3.jar:6.4.3]
	at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:85) ~[web-jetty-6.4.3.jar:6.4.3]
	at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:79) ~[web-jetty-6.4.3.jar:6.4.3]
	at com.enonic.xp.web.impl.auth.BasicAuthFilter.doHandle(BasicAuthFilter.java:31) ~[na:na]
	at com.enonic.xp.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:31) ~[na:na]
	at com.enonic.xp.web.filter.BaseWebFilter.doFilter(BaseWebFilter.java:33) ~[na:na]
	at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135) ~[web-jetty-6.4.3.jar:6.4.3]
	at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74) ~[web-jetty-6.4.3.jar:6.4.3]
	at com.enonic.xp.admin.ui.tool.simpleauth.SimpleAuthFilter.doHandle(SimpleAuthFilter.java:30) ~[na:na]
	at com.enonic.xp.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:31) ~[na:na]
	at com.enonic.xp.web.filter.BaseWebFilter.doFilter(BaseWebFilter.java:33) ~[na:na]
	at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135) ~[web-jetty-6.4.3.jar:6.4.3]
	at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74) ~[web-jetty-6.4.3.jar:6.4.3]
	at com.enonic.xp.web.impl.context.ContextFilter.lambda$doHandle$0(ContextFilter.java:34) ~[na:na]
	at com.enonic.xp.context.ContextImpl.callWith(ContextImpl.java:101) ~[na:na]
	at com.enonic.xp.web.impl.context.ContextFilter.doHandle(ContextFilter.java:33) ~[na:na]
	at com.enonic.xp.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:31) ~[na:na]
	at com.enonic.xp.web.filter.BaseWebFilter.doFilter(BaseWebFilter.java:33) ~[na:na]
	at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135) ~[web-jetty-6.4.3.jar:6.4.3]
	at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74) ~[web-jetty-6.4.3.jar:6.4.3]
	at com.enonic.xp.web.vhost.impl.VirtualHostFilter.doHandle(VirtualHostFilter.java:32) ~[na:na]
	at com.enonic.xp.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:31) ~[na:na]
	at com.enonic.xp.web.filter.BaseWebFilter.doFilter(BaseWebFilter.java:33) ~[na:na]
	at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135) ~[web-jetty-6.4.3.jar:6.4.3]
	at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74) ~[web-jetty-6.4.3.jar:6.4.3]
	at com.enonic.xp.web.impl.dos.DosFilterWrapper.doFilter(DosFilterWrapper.java:60) ~[na:na]
	at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135) ~[web-jetty-6.4.3.jar:6.4.3]
	at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74) ~[web-jetty-6.4.3.jar:6.4.3]
	at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:124) ~[web-jetty-6.4.3.jar:6.4.3]
	at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:61) ~[web-jetty-6.4.3.jar:6.4.3]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821) ~[web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583) [web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:437) [web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1158) [web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511) [web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1090) [web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119) [web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.server.Server.handle(Server.java:517) [web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:306) [web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242) [web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261) [web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) [web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75) [web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213) [web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147) [web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654) [web-jetty-6.4.3.jar:6.4.3]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572) [web-jetty-6.4.3.jar:6.4.3]
	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_171]

I’m marking this as solved. The instructions I followed, from a Google search on “install Enonic” were outdated. Once I went to the latest instructions and followed them, I was able to get Enonic to run on the first try, even with my alternate port. Latest instructions: http://xp.readthedocs.io/en/stable/getstarted/other.html

5 Likes