1

Host cannot be null [<Apply>]

asked 2017-03-17 09:00:02 +0800

dandiac gravatar image dandiac
11 1

In my index.zul I'm trying to use a simple template.

    <zk>
    <apply template="testTemplate" />
    <template name="testTemplate">
        <label value="testThisTemplate" />
    </template>
</zk>

In browser I get this error:

    HTTP ERROR 500

Problem accessing /pulse/. Reason:

    Host cannot be null [<Apply>]
Caused by:

org.zkoss.zk.ui.UiException: Host cannot be null [<Apply>]
    at org.zkoss.zk.ui.HtmlShadowElement.afterCompose(HtmlShadowElement.java:559)
    at org.zkoss.zuti.zul.TemplateBasedShadowElement.afterCompose(TemplateBasedShadowElement.java:78)
    at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:859)
    at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:827)
    at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:841)
    at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:797)
    at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:740)
    at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:460)
    at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:369)
    at org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:211)
    at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:137)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:447)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:574)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1038)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:374)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:972)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:293)
    at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:120)
    at org.eclipse.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:566)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:447)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:556)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1038)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:374)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:972)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:363)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483)
    at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:920)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:982)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
    at java.lang.Thread.run(Thread.java:745)

Can someone tell me what am I doing wrong?

delete flag offensive retag edit

Comments

what version do you use and CE/PE or EE?

chillworld ( 2017-03-17 11:20:57 +0800 )edit

I'm Using Eclipse IDE for java developers I have maven installed, and in the pom.xml I have zk.version 8.0.2.2-Eval and I run the app with jetty (it was the recommended plugin) : jetty-maven-plugin 7.6.8.v20121106

dandiac ( 2017-03-17 11:47:31 +0800 )edit

I've used the org.zkoss zk-ee-eval-archetype-webapp archetype from maven

dandiac ( 2017-03-17 11:55:00 +0800 )edit

Thank you. That was it.I replaced 8.0.2.2-Eval with 8.0.3-Eval, ran mvn clean install and now it works. Can I mark that comment as being the answer? Or do you want to post it as an answer?

dandiac ( 2017-03-17 19:47:38 +0800 )edit

converted comment to answer

chillworld ( 2017-03-17 22:15:52 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-03-17 14:33:57 +0800

chillworld gravatar image chillworld flag of Belgium
5322 4 9
https://github.com/chillw...

I tested it in fiddle, seems like a bug what's resolved in 8.0.3

link publish delete flag offensive edit

Comments

1

implemented here: http://tracker.zkoss.org/browse/ZK-2955 since 8.0.3

cor3000 ( 2017-03-20 09:10:10 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2017-03-17 09:00:02 +0800

Seen: 29 times

Last updated: Mar 17 '17

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More