0

ZK and JavaRebel

asked 2008-07-28 20:03:56 +0800

rmaugusto gravatar image rmaugusto
36

I'm trying using JavaRebel with ZK and context is reloaded always.
But JSP + Servlet works fine.

Have already tested that?

Thanks

Ricardo M Augusto

delete flag offensive retag edit

9 Replies

Sort by » oldest newest

answered 2012-05-04 17:43:10 +0800

yaminglin1977 gravatar image yaminglin1977
36 2

i use javaRebel too,but when i add an property to viewModel(i use zk 6.0.0 ee eval), reload zul will get following exception:
org.zkoss.zel.PropertyNotFoundException: Property 'aProperty' not found on type org.lym.test.test1.VM3
org.zkoss.zel.BeanELResolver$BeanProperties.get(BeanELResolver.java:258)
org.zkoss.zel.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:209)
org.zkoss.zel.BeanELResolver.property(BeanELResolver.java:368)
org.zkoss.zel.BeanELResolver.getValue(BeanELResolver.java:85)
org.zkoss.zel.CompositeELResolver.getValue(CompositeELResolver.java:67)
org.zkoss.zel.CompositeELResolver.getValue(CompositeELResolver.java:67)
org.zkoss.xel.zel.XelELResolver.getValue(XelELResolver.java:71)
org.zkoss.bind.xel.zel.BindELResolver.getValue(BindELResolver.java:64)
org.zkoss.zel.impl.parser.AstValue.getValue(AstValue.java:179)
org.zkoss.zel.impl.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189)
org.zkoss.xel.zel.ELXelExpression.evaluate(ELXelExpression.java:40)
org.zkoss.bind.impl.BindEvaluatorXImpl.getValue(BindEvaluatorXImpl.java:44)
org.zkoss.bind.impl.LoadPropertyBindingImpl.load(LoadPropertyBindingImpl.java:55)
org.zkoss.bind.impl.PropertyBindingHandler.doLoadBinding(PropertyBindingHandler.java:172)
org.zkoss.bind.impl.PropertyBindingHandler.doLoad(PropertyBindingHandler.java:373)
org.zkoss.bind.impl.BinderImpl.loadComponentProperties(BinderImpl.java:1758)
org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1740)
org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:1742)
org.zkoss.bind.BindComposer.doAfterCompose(BindComposer.java:128)
org.zkoss.zk.ui.impl.UiEngineImpl.doAfterCompose(UiEngineImpl.java:526)
org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:821)
org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:767)
org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:676)
org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:738)
org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:698)
org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:640)
org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:391)
org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:313)
org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:214)
org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:134)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

any idea to resolve it?Thanks

link publish delete flag offensive edit

answered 2012-05-04 17:48:17 +0800

yaminglin1977 gravatar image yaminglin1977
36 2

updated 2012-05-04 17:50:25 +0800

i found it is because the zk cache the property of Bean at the beginning ,so Reloading of javaRebel have not effect,is there any configure argument to cancel this cache?
below is the zk's code:
private final BeanProperty property(ELContext ctx, Object base,
Object property) {
Class<?> type = base.getClass();
String prop = property.toString();

BeanProperties props = this.cache.get(type.getName());
if (props == null || type != props.getType()) {
props = new BeanProperties(type);
this.cache.put(type.getName(), props);
}

return props.get(ctx, prop);
}

link publish delete flag offensive edit

answered 2012-05-05 00:26:15 +0800

yaminglin1977 gravatar image yaminglin1977
36 2

i found the url:http://tracker.zkoss.org/browse/ZK-1021 talk about similar problem.
now i know it is not possible to get some easy configure arment at now ,
the question is :what is the best practice in this situation?

link publish delete flag offensive edit

answered 2012-05-11 02:31:16 +0800

dennis gravatar image dennis
3679 1 6
http://www.javaworld.com....

look into the source code of BeanELResolver, it is possible to set the cache size to 0 in your development environment. by setting system property 'org.zkoss.zel.BeanELResolver.CACHE_SIZE' to '0'

link publish delete flag offensive edit

answered 2012-05-19 06:24:30 +0800

yaminglin1977 gravatar image yaminglin1977
36 2

updated 2012-05-19 06:25:53 +0800

thanks dennis for reply,i try setting system property 'org.zkoss.zel.BeanELResolver.CACHE_SIZE' to '0' ,as is blow in zk.xml:
<system-property>
<name>org.zkoss.zel.BeanELResolver.CACHE_SIZE</name>
<value>0</value>
</system-property>
,the result is the same,i look into the source code of BeanELResolver,find the following code:
public ConcurrentCache(int size) {
this.size = size;
this.eden = new ConcurrentHashMap<K,V>(size);
this.longterm = new WeakHashMap<K,V>(size);
}
,it seem no use to set size to 0 for disabling the cache,when i set 'org.zkoss.zel.BeanELResolver.CACHE_SIZE' to -1, the cosole show following exception when i visit the zul page:
java.lang.IllegalArgumentException
at java.util.concurrent.ConcurrentHashMap.<init>(Unknown Source)
at java.util.concurrent.ConcurrentHashMap.<init>(Unknown Source)
at org.zkoss.zel.BeanELResolver$ConcurrentCache.<init>(BeanELResolver.java:411)
at org.zkoss.zel.BeanELResolver.<init>(BeanELResolver.java:63)
at org.zkoss.xel.zel.XelELResolver.<clinit>(XelELResolver.java:49)
at org.zkoss.bind.xel.zel.BindELContext.newELResolver(BindELContext.java:58)
at org.zkoss.xel.zel.XelELContext.<init>(XelELContext.java:47)
at org.zkoss.bind.xel.zel.BindELContext.<init>(BindELContext.java:54)
at org.zkoss.bind.xel.BindXelFactory.newELContext(BindXelFactory.java:36)
at org.zkoss.bind.xel.BindXelFactory.parseExpression(BindXelFactory.java:30)
at org.zkoss.bind.impl.BindEvaluatorXImpl.parseExpressionX(BindEvaluatorXImpl.java:69)
at org.zkoss.bind.impl.BindEvaluatorXUtil.eval(BindEvaluatorXUtil.java:54)
at org.zkoss.bind.BindComposer.initViewModel(BindComposer.java:146)
at org.zkoss.bind.BindComposer.doAfterCompose(BindComposer.java:116)
at org.zkoss.zk.ui.impl.UiEngineImpl.doAfterCompose(UiEngineImpl.java:526)
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:821)
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:767)
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:676)
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:738)
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:698)
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:640)
at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:391)
<bold>any other solution to disable the cache?</bold>

link publish delete flag offensive edit

answered 2012-05-30 02:09:24 +0800

jhcruvinel gravatar image jhcruvinel
3

I got the same error.

I´m using a ViewModel bean and in a specific method I set the variables to null and notify the view, but seems the view uses an cache and gives the error below:

I tried to disable the cache but the same error occurs.

29/05/2012 22:45:53 org.zkoss.zk.ui.impl.UiEngineImpl handleError:1348
GRAVE: >>org.zkoss.zel.PropertyNotFoundException: Property '0' not found on type org.zkoss.zul.ListModelSet
>> at org.zkoss.zel.BeanELResolver$BeanProperties.get(BeanELResolver.java:258)
>> at org.zkoss.zel.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:209)
>> at org.zkoss.zel.BeanELResolver.property(BeanELResolver.java:368)
>> at org.zkoss.zel.BeanELResolver.getValue(BeanELResolver.java:85)
>> at org.zkoss.zel.CompositeELResolver.getValue(CompositeELResolver.java:67)
>> at org.zkoss.zel.CompositeELResolver.getValue(CompositeELResolver.java:67)
>> at org.zkoss.xel.zel.XelELResolver.getValue(XelELResolver.java:71)
>> at org.zkoss.bind.xel.zel.BindELResolver.getValue(BindELResolver.java:64)
>> at org.zkoss.zel.impl.parser.AstValue.getValue(AstValue.java:179)
>> at org.zkoss.zel.impl.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189)
>> at org.zkoss.xel.zel.ELXelExpression.evaluate(ELXelExpression.java:40)
>> at org.zkoss.bind.impl.BindEvaluatorXImpl.getValue(BindEvaluatorXImpl.java:44)
>> at org.zkoss.bind.impl.ReferenceBindingImpl.load(ReferenceBindingImpl.java:53)
>> at org.zkoss.bind.impl.BinderImpl.loadOnPropertyChange(BinderImpl.java:342)
>> at org.zkoss.bind.impl.BinderImpl.access$100(BinderImpl.java:92)
>> at org.zkoss.bind.impl.BinderImpl$QueueListener.onEvent(BinderImpl.java:228)
>> at org.zkoss.zk.ui.event.impl.DesktopEventQueue$QueueListener.onEvent(DesktopEventQueue.java:145)
>> at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2741)
>> at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2712)
>> at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2653)
>> at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136)
>> at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.process0(EventProcessingThreadImpl.java:534)
>> at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.run(EventProcessingThreadImpl.java:461)

I try to set -1 to org.zkoss.zel.BeanELResolver.CACHE_SIZE but got java.lang.ExceptionInInitializerError.

link publish delete flag offensive edit

answered 2012-06-13 09:37:56 +0800

dennis gravatar image dennis
3679 1 6
http://www.javaworld.com....

yaminglin, could you post a feature on the tracker about disabling class method cache.

jhcruvinel, I think it is another issue, could you provide a example to reproduce this. thanks.

link publish delete flag offensive edit

answered 2012-06-24 08:05:34 +0800

yaminglin1977 gravatar image yaminglin1977
36 2

ok, as showed in
http://tracker.zkoss.org/browse/ZK-1212

link publish delete flag offensive edit

answered 2012-07-02 09:38:57 +0800

dmitrid gravatar image dmitrid
3

The latest nightly build of JRebel (http://zeroturnaround.com/software/jrebel/early-access/) now has ZK Framework integration and supports these changes.

link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2008-07-28 20:03:56 +0800

Seen: 668 times

Last updated: Jul 02 '12

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