0

ZK CDI - ZK component injection issue

asked 2010-09-12 11:24:38 +0800

petrslavotinek gravatar image petrslavotinek
6

Hello everyone,
I am trying to use ZK CDI extension. Everything works fine except for ZK component injection.
I have a controller in Java bean which extends org.zkoss.cdi.util.GenericComposer. There I try to inject ZK component using:
@Inject @ComponentId("username") Textbox username;

but I always get one of these two exceptions:
1)
WELD-001409 Injection point has ambiguous dependencies ...
It is interesting, that the two possible dependencies are exactly the same.
2)
WELD-001400 Normal scoped bean org.jboss.weld.bean-flat-ProducerMethod-org.zkoss.zkplus.cdi.ZKComponentProducerMethods.method [method name] is not proxyable

I am using ZK 5.0.4, Java EE 5/6, Glassfish/Tomcat.

Does anyone know where the problem is and how to solve it? Any help is really appreciated.
Thank you!

---------------------------------------

My second question is concerning ZK CDI as well.
Is there any advantage of extending controller class with org.zkoss.cdi.util.GenericComposer instead of org.zkoss.zk.ui.util.GenericForwardComposer? The only one I know about is that with org.zkoss.cdi.util.GenericComposer I can name my methods freely and more comprehensibly - I am not bound with naming rules given by org.zkoss.zk.ui.util.GenericForwardComposer (for example onClick$myButton).
But are there any other differences which influence perfomance and so on?
Thank you for your answers!

Best regards,
Petr

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2010-11-11 04:16:50 +0800

eldiegos gravatar image eldiegos
15 1

In my case,

i'm using weld 1.1Beta2 and ZK 5.05 on tomcat and i'm trying to reproduce the example in http://docs.zkoss.org/wiki/Getting_started_with_ZK_CDI

When i start tomcat i always get this ERROR message.

org.jboss.weld.exceptions.UnproxyableResolutionException: WELD-001437 Normal scoped bean class org.zkoss.zk.ui.AbstractComponent is not proxyable because the type is final or it contains a final method final void org.zkoss.zk.ui.AbstractComponent.replaceWith(org.zkoss.zk.ui.AbstractComponent,boolean,boolean).

Any idea to solve it?

link publish delete flag offensive edit

answered 2010-09-14 15:32:14 +0800

petrslavotinek gravatar image petrslavotinek
6

Yes, you are right, I get only the second exception (WELD-001400) in Tomcat. But in Glassfish both of them occur.

link publish delete flag offensive edit

answered 2010-09-14 03:01:37 +0800

oberinspector gravatar image oberinspector
219 2 2

hi ashishd,

i tried to debug this in glassfish and you are right... it seems impossible. But glassfish is the reference implementation for Java EE6 and it would be very good to get ZKCDI up and running.
I checked out the code for CKCDI and played around with it, but i could not get it up and running. With the zkcdi jar GF started without errors, but injection does not happen. It would be very nice to provide ZKCDI as a maven Projekt.

I havent tried it in Tomcat yet.

/thomas

link publish delete flag offensive edit

answered 2010-09-13 21:25:23 +0800

ashishd gravatar image ashishd flag of Taiwan
1972 6

Hi petrslavotinek & oberinspector,
>>WELD-001409 Injection point has ambiguous dependencies ...
seems to be a class loading problem on Glassfish which is near impossible to debug but I'll try. Are you sure it is also occurring in Tomcat 6?

>>Is there any advantage of extending controller class with org.zkoss.cdi.util.GenericComposer instead of org.zkoss.zk.ui.util.GenericForwardComposer?
org.zkoss.cdi.util.GenericComposer uses CDI event notification model for defining & wiring of events so its performance depends on how CDI is implemented by the underlying Java EE 6 container.

link publish delete flag offensive edit

answered 2010-09-13 08:20:42 +0800

oberinspector gravatar image oberinspector
219 2 2

i also had some simular problems with glassfish and was asked to write issues: http://code.google.com/p/zkcdi/issues/list. There seems to be not much activity with ZKCDI at the moment. I tried several things with glassfish and zkcdi, but did not get it up and running.

Some things i would like to see from ZKCDI is injekt components and EJBs in a Composer and injekt components and EJBs in a richlet with glassfish.

/thomas

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: 2010-09-12 11:24:38 +0800

Seen: 595 times

Last updated: Nov 11 '10

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