0

wizard with zkoss 8.6

asked 2019-07-16 19:12:29 +0800

Matthias84 gravatar image Matthias84
3 2

updated 2019-07-16 19:41:20 +0800

Hi everyone,

I am trying to get the wizard example described in the small talks section (unfortunately, I am not allowed to post a complete URL, so: www zkoss org wiki SmallTalks 2015 September ZK8WizardExample-Part1) to run under zkoss 8.6.01 but I keep getting an instantiation error deep inside the framework:

org.zkoss.zk.ui.UiException: java.lang.InstantiationException: org.zkoss.zk.ui.HtmlShadowElement at sun.reflect.GeneratedConstructorAccessor40.newInstance at java.lang.reflect.Constructor.newInstance(Constructor.java:437) at org.zkoss.lang.Classes.newInstance(Classes.java:76) at org.zkoss.lang.Exceptions.wrap(Exceptions.java:163) at org.zkoss.zk.ui.UiException$Aide.wrap(UiException.java:51) at org.zkoss.zk.ui.metainfo.impl.ComponentDefinitionImpl.newInstance(ComponentDefinitionImpl.java:346) at org.zkoss.zk.ui.metainfo.impl.ComponentDefinitionImpl.newInstance(ComponentDefinitionImpl.java:326) at org.zkoss.zk.ui.metainfo.ShadowInfo.newInstance(ShadowInfo.java:138) at org.zkoss.zk.ui.impl.AbstractUiFactory.newComponent(AbstractUiFactory.java:103) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:846) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:822) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:740) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:934) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:889) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:776) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:836) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:794) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:740) at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:461) at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:369) at org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:215) at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:140) at javax.servlet.http.HttpServlet.service(HttpServlet.java:686) at [internal classes] Caused by: java.lang.InstantiationException: org.zkoss.zk.ui.HtmlShadowElement at java.lang.J9VMInternals.newInstanceImpl(J9VMInternals.java:-2) at java.lang.Class.newInstance(Class.java:1899) at org.zkoss.zk.ui.metainfo.impl.ComponentDefinitionImpl.newInstance(ComponentDefinitionImpl.java:344) ... 18 more

Any ideas anyone? Is that a framework bug? My code is exactly the same as in the example. I just copied it....:)

delete flag offensive retag edit

4 Answers

Sort by ยป oldest newest most voted
0

answered 2019-07-16 23:08:17 +0800

cor3000 gravatar image cor3000
6280 2 7

updated 2019-07-16 23:09:23 +0800

No idea, I tried it, both master and part-1 branch, both versions work after changing to 8.0.6.1-Eval (and jetty 9.4.19.v20190610 - for faster startup)

here the commands:

git clone [email protected]:zkoss-demo/zk-wizard-example.git
cd zk-wizard-example
#edit the pom (zk version, jetty version)
nano pom.xml 
mvn jetty:run

http://localhost:8080/wizardexample/survey.zul

I couldn't get it to produce the error you mentioned ... Maybe you forgot to add the dependency to zuti.jar? Which contains the shadow element support (key for this demo).

<dependency>
    <groupId>org.zkoss.zk</groupId>
    <artifactId>zuti</artifactId>
    <version>${zk.version}</version>
</dependency>

https://github.com/zkoss-demo/zk-wizard-example/blob/master/pom.xml#L53-L57

if that doesn't help please provide the exact steps required to produce this error.

link publish delete flag offensive edit
0

answered 2019-07-17 20:08:20 +0800

Matthias84 gravatar image Matthias84
3 2

updated 2019-07-17 20:13:00 +0800

That could be it. Can you provide the URL to the maven repo for the zuti jar? I can only find EVAL Versions here: http mavensync zkoss org eval org zkoss zk zuti

link publish delete flag offensive edit
0

answered 2019-07-18 09:28:12 +0800

cor3000 gravatar image cor3000
6280 2 7

zuti.jar is available in ZK EE and requires a maven repository login.

The maven repositories are and their required license level are listed here: https://www.zkoss.org/wiki/ZKInstallationGuide/SettingupIDE/Maven/ResolvingZKFrameworkArtifactsviaMaven#HowtoChoosetheRightZKMavenRepositoryforaZKPackage

link publish delete flag offensive edit
0

answered 2019-07-18 13:41:21 +0800

Matthias84 gravatar image Matthias84
3 2

Aaah.... :) Thanks for your help. For the Moment, I have to find some other solution then. We are currently only using the community version of zk.

link publish delete flag offensive edit

Comments

the <include> component can be used to replace content dynamically by changing the src attribute (be careful not to use url params, or you'll get into defer mode ...) <include someData="@load(vm.data)" src="@load(vm.contentUri)"/> ...

cor3000 ( 2019-07-18 13:47:11 +0800 )edit

Thanks, I will try that!

Matthias84 ( 2019-07-18 15:03:55 +0800 )edit

make sure to set the someData property before changing the src. or the updated src will render using the old data. You can access the someData in your ViewModel via @Init public void init(@ExecutionArgParam("someData" AnyType mydata) {}

cor3000 ( 2019-07-18 17:12:46 +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
2 followers

RSS

Stats

Asked: 2019-07-16 19:12:29 +0800

Seen: 11 times

Last updated: Jul 18 '19

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