Re: CODI issue with CDI Observer
Hi Thomas, here it goes: https://issues.apache.org/jira/browse/DELTASPIKE-546 Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://conventions.github.io/home/ http://rpestano.wordpress.com/ @realpestano Em Segunda-feira, 24 de Março de 2014 5:08, Thomas Andraschko andraschko.tho...@gmail.com escreveu: Ok. Rafael, could you create an issue? 2014-03-23 23:49 GMT+01:00 Gerhard Petracek gerhard.petra...@gmail.com: it isn't nice that we need such a workaround, however, we can add it easily (in codi as well as in deltaspike). regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2014-03-23 23:07 GMT+01:00 Thomas Andraschko andraschko.tho...@gmail.com : Gerhard, i would add the null check but we should do it in AbstractContext. Could it break anything? 2014-03-23 22:57 GMT+01:00 Rafael Pestano rmpest...@yahoo.com.br: Hi again, i just solved it in my custom scope by checking the null contextual: @Override public T T get(final ContextualT contextual, final CreationalContextT creationalContext) { if(creationalContext == null){ return null; } i dont know what the spec says about trying to get a bean which doesnt have to participate in an event but in my opinion the easiest way to get DS compatible with GF4 is to do that nullcheck in deltaspike instead of waiting for GF guys... https://github.com/apache/deltaspike/blob/master/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessContext.java#L79 Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://conventions.github.io/home/ http://rpestano.wordpress.com/ @realpestano Em Domingo, 23 de Março de 2014 18:48, Rafael Pestano rmpest...@yahoo.com.br escreveu: Hi Gerhard, i can confirm its a GF4 issue, justed added a simple custom scope and received the same NPE in the scope GET method: @Override public T T get(final ContextualT contextual, final CreationalContextT creationalContext) { Bean bean = (Bean) contextual; if (customScopeContextHolder.getBeans().containsKey(bean.getBeanClass())) { return (T) customScopeContextHolder.getBean(bean.getBeanClass()).instance; } else { T t = (T) bean.create(creationalContext);//NPE here, contextual is null I'll open an issue at glassfish tracker. thanks for your help Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://conventions.github.io/home/ http://rpestano.wordpress.com/ @realpestano Em Domingo, 23 de Março de 2014 18:25, Gerhard Petracek gerhard.petra...@gmail.com escreveu: since the implementation in ds is different and it works with other servers, it sounds like a general glassfish-issue with custom scopes. regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2014-03-23 22:15 GMT+01:00 Rafael Pestano rmpest...@yahoo.com.br: Hi gerhard, same thing with ds 0.6: [2014-03-23T18:14:20.514-0300] [glassfish 4.0] [WARNING] [] [javax.enterprise.web.core] [tid: _ThreadID=20 _ThreadName=http-listener-1(1)] [timeMillis: 1395609260514] [levelValue: 900] [[ Servlet.service() for servlet FacesServlet threw exception java.lang.NullPointerException at org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:178) at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:157) at org.jboss.weld.context.ForwardingContextual.create(ForwardingContextual.java:27) at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:117) at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:124) at org.apache.deltaspike.core.impl.scope.viewaccess.ViewAccessContext.get(ViewAccessContext.java:83) at org.jboss.weld.context.PassivatingContextWrapper$AbstractPassivatingContextWrapper.get(PassivatingContextWrapper.java:67) Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://conventions.github.io/home/ http
CODI issue with CDI Observer
Hi guys, i'm facing an issue with CODI on Glassfish 4 which i can't observe CDI events with notifyObserver = Reception.IF_EXISTS if my bean uses a CODI scope, here is some code: @ViewAccessScoped @Named public class MyBean implements Serializable{ @Inject EventMyEvent myEvent; public void fire(){ myEvent.fire(new MyEvent()); } } @ViewAccessScoped //@SessionScoped @Named public class AnotherBean implements Serializable{ protected Logger log = Logger.getLogger(getClass().getSimpleName()); public void observe(@Observes(notifyObserver = Reception.IF_EXISTS) MyEvent event){ log.fine(event received:+event); } i receive nullpointer exception when i fire the event: javax.faces.FacesException: #{myBean.fire}: java.lang.NullPointerException at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118) at org.apache.myfaces.extensions.cdi.jsf.impl.security.SecurityViolationAwareActionListener.processAction(SecurityViolationAwareActionListener.java:56) at org.apache.myfaces.extensions.cdi.jsf.impl.config.view.ViewControllerActionListener.processAction(ViewControllerActionListener.java:68) at org.apache.myfaces.extensions.cdi.jsf.impl.listener.action.CodiActionListener.processAction(CodiActionListener.java:58) full stacktrace is here:http://pastebin.com/fMaMqS72 Here is some observations: - if i replace ViewAccessScoped with SessionScope i get no errors. - if i remove notifyObserver = Reception.IF_EXISTS i receive the event without problems - I have no issue with JbossAS 7, wildfly and also Glassfish 3.1.1.2 I pushed a simple project at github which reproduces the issue: github.com/rmpestano/codi-issue any help is appreciated. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://conventions.github.io/home/ http://rpestano.wordpress.com/ @realpestano
Re: CODI issue with CDI Observer
Hi gerhard, same thing with ds 0.6: [2014-03-23T18:14:20.514-0300] [glassfish 4.0] [WARNING] [] [javax.enterprise.web.core] [tid: _ThreadID=20 _ThreadName=http-listener-1(1)] [timeMillis: 1395609260514] [levelValue: 900] [[ Servlet.service() for servlet FacesServlet threw exception java.lang.NullPointerException at org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:178) at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:157) at org.jboss.weld.context.ForwardingContextual.create(ForwardingContextual.java:27) at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:117) at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:124) at org.apache.deltaspike.core.impl.scope.viewaccess.ViewAccessContext.get(ViewAccessContext.java:83) at org.jboss.weld.context.PassivatingContextWrapper$AbstractPassivatingContextWrapper.get(PassivatingContextWrapper.java:67) Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://conventions.github.io/home/ http://rpestano.wordpress.com/ @realpestano Em Domingo, 23 de Março de 2014 17:44, Gerhard Petracek gerhard.petra...@gmail.com escreveu: hi rafael, please test the same with deltaspike 0.6 regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2014-03-23 18:23 GMT+01:00 Rafael Pestano rmpest...@yahoo.com.br: Hi guys, i'm facing an issue with CODI on Glassfish 4 which i can't observe CDI events with notifyObserver = Reception.IF_EXISTS if my bean uses a CODI scope, here is some code: @ViewAccessScoped @Named public class MyBean implements Serializable{ @Inject EventMyEvent myEvent; public void fire(){ myEvent.fire(new MyEvent()); } } @ViewAccessScoped //@SessionScoped @Named public class AnotherBean implements Serializable{ protected Logger log = Logger.getLogger(getClass().getSimpleName()); public void observe(@Observes(notifyObserver = Reception.IF_EXISTS) MyEvent event){ log.fine(event received:+event); } i receive nullpointer exception when i fire the event: javax.faces.FacesException: #{myBean.fire}: java.lang.NullPointerException at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118) at org.apache.myfaces.extensions.cdi.jsf.impl.security.SecurityViolationAwareActionListener.processAction(SecurityViolationAwareActionListener.java:56) at org.apache.myfaces.extensions.cdi.jsf.impl.config.view.ViewControllerActionListener.processAction(ViewControllerActionListener.java:68) at org.apache.myfaces.extensions.cdi.jsf.impl.listener.action.CodiActionListener.processAction(CodiActionListener.java:58) full stacktrace is here:http://pastebin.com/fMaMqS72 Here is some observations: - if i replace ViewAccessScoped with SessionScope i get no errors. - if i remove notifyObserver = Reception.IF_EXISTS i receive the event without problems - I have no issue with JbossAS 7, wildfly and also Glassfish 3.1.1.2 I pushed a simple project at github which reproduces the issue: github.com/rmpestano/codi-issue any help is appreciated. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://conventions.github.io/home/ http://rpestano.wordpress.com/ @realpestano
Re: CODI issue with CDI Observer
Hi Gerhard, i can confirm its a GF4 issue, justed added a simple custom scope and received the same NPE in the scope GET method: @Override public T T get(final ContextualT contextual, final CreationalContextT creationalContext) { Bean bean = (Bean) contextual; if (customScopeContextHolder.getBeans().containsKey(bean.getBeanClass())) { return (T) customScopeContextHolder.getBean(bean.getBeanClass()).instance; } else { T t = (T) bean.create(creationalContext);//NPE here, contextual is null I'll open an issue at glassfish tracker. thanks for your help Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://conventions.github.io/home/ http://rpestano.wordpress.com/ @realpestano Em Domingo, 23 de Março de 2014 18:25, Gerhard Petracek gerhard.petra...@gmail.com escreveu: since the implementation in ds is different and it works with other servers, it sounds like a general glassfish-issue with custom scopes. regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2014-03-23 22:15 GMT+01:00 Rafael Pestano rmpest...@yahoo.com.br: Hi gerhard, same thing with ds 0.6: [2014-03-23T18:14:20.514-0300] [glassfish 4.0] [WARNING] [] [javax.enterprise.web.core] [tid: _ThreadID=20 _ThreadName=http-listener-1(1)] [timeMillis: 1395609260514] [levelValue: 900] [[ Servlet.service() for servlet FacesServlet threw exception java.lang.NullPointerException at org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:178) at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:157) at org.jboss.weld.context.ForwardingContextual.create(ForwardingContextual.java:27) at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:117) at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:124) at org.apache.deltaspike.core.impl.scope.viewaccess.ViewAccessContext.get(ViewAccessContext.java:83) at org.jboss.weld.context.PassivatingContextWrapper$AbstractPassivatingContextWrapper.get(PassivatingContextWrapper.java:67) Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://conventions.github.io/home/ http://rpestano.wordpress.com/ @realpestano Em Domingo, 23 de Março de 2014 17:44, Gerhard Petracek gerhard.petra...@gmail.com escreveu: hi rafael, please test the same with deltaspike 0.6 regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2014-03-23 18:23 GMT+01:00 Rafael Pestano rmpest...@yahoo.com.br: Hi guys, i'm facing an issue with CODI on Glassfish 4 which i can't observe CDI events with notifyObserver = Reception.IF_EXISTS if my bean uses a CODI scope, here is some code: @ViewAccessScoped @Named public class MyBean implements Serializable{ @Inject EventMyEvent myEvent; public void fire(){ myEvent.fire(new MyEvent()); } } @ViewAccessScoped //@SessionScoped @Named public class AnotherBean implements Serializable{ protected Logger log = Logger.getLogger(getClass().getSimpleName()); public void observe(@Observes(notifyObserver = Reception.IF_EXISTS) MyEvent event){ log.fine(event received:+event); } i receive nullpointer exception when i fire the event: javax.faces.FacesException: #{myBean.fire}: java.lang.NullPointerException at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118) at org.apache.myfaces.extensions.cdi.jsf.impl.security.SecurityViolationAwareActionListener.processAction(SecurityViolationAwareActionListener.java:56) at org.apache.myfaces.extensions.cdi.jsf.impl.config.view.ViewControllerActionListener.processAction(ViewControllerActionListener.java:68) at org.apache.myfaces.extensions.cdi.jsf.impl.listener.action.CodiActionListener.processAction(CodiActionListener.java:58) full stacktrace is here:http://pastebin.com/fMaMqS72 Here is some observations: - if i replace ViewAccessScoped with SessionScope i get no errors. - if i remove notifyObserver = Reception.IF_EXISTS i receive the event without problems - I have no issue with JbossAS 7, wildfly and also Glassfish 3.1.1.2 I pushed a simple project at github which reproduces the issue: github.com/rmpestano/codi-issue any help is appreciated. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da
Re: CODI issue with CDI Observer
Hi again, i just solved it in my custom scope by checking the null contextual: @Override public T T get(final ContextualT contextual, final CreationalContextT creationalContext) { if(creationalContext == null){ return null; } i dont know what the spec says about trying to get a bean which doesnt have to participate in an event but in my opinion the easiest way to get DS compatible with GF4 is to do that nullcheck in deltaspike instead of waiting for GF guys... https://github.com/apache/deltaspike/blob/master/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessContext.java#L79 Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://conventions.github.io/home/ http://rpestano.wordpress.com/ @realpestano Em Domingo, 23 de Março de 2014 18:48, Rafael Pestano rmpest...@yahoo.com.br escreveu: Hi Gerhard, i can confirm its a GF4 issue, justed added a simple custom scope and received the same NPE in the scope GET method: @Override public T T get(final ContextualT contextual, final CreationalContextT creationalContext) { Bean bean = (Bean) contextual; if (customScopeContextHolder.getBeans().containsKey(bean.getBeanClass())) { return (T) customScopeContextHolder.getBean(bean.getBeanClass()).instance; } else { T t = (T) bean.create(creationalContext);//NPE here, contextual is null I'll open an issue at glassfish tracker. thanks for your help Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://conventions.github.io/home/ http://rpestano.wordpress.com/ @realpestano Em Domingo, 23 de Março de 2014 18:25, Gerhard Petracek gerhard.petra...@gmail.com escreveu: since the implementation in ds is different and it works with other servers, it sounds like a general glassfish-issue with custom scopes. regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2014-03-23 22:15 GMT+01:00 Rafael Pestano rmpest...@yahoo.com.br: Hi gerhard, same thing with ds 0.6: [2014-03-23T18:14:20.514-0300] [glassfish 4.0] [WARNING] [] [javax.enterprise.web.core] [tid: _ThreadID=20 _ThreadName=http-listener-1(1)] [timeMillis: 1395609260514] [levelValue: 900] [[ Servlet.service() for servlet FacesServlet threw exception java.lang.NullPointerException at org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:178) at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:157) at org.jboss.weld.context.ForwardingContextual.create(ForwardingContextual.java:27) at org.apache.deltaspike.core.util.context.ContextualStorage.createContextualInstance(ContextualStorage.java:117) at org.apache.deltaspike.core.util.context.AbstractContext.get(AbstractContext.java:124) at org.apache.deltaspike.core.impl.scope.viewaccess.ViewAccessContext.get(ViewAccessContext.java:83) at org.jboss.weld.context.PassivatingContextWrapper$AbstractPassivatingContextWrapper.get(PassivatingContextWrapper.java:67) Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://conventions.github.io/home/ http://rpestano.wordpress.com/ @realpestano Em Domingo, 23 de Março de 2014 17:44, Gerhard Petracek gerhard.petra...@gmail.com escreveu: hi rafael, please test the same with deltaspike 0.6 regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2014-03-23 18:23 GMT+01:00 Rafael Pestano rmpest...@yahoo.com.br: Hi guys, i'm facing an issue with CODI on Glassfish 4 which i can't observe CDI events with notifyObserver = Reception.IF_EXISTS if my bean uses a CODI scope, here is some code: @ViewAccessScoped @Named public class MyBean implements Serializable{ @Inject EventMyEvent myEvent; public void fire(){ myEvent.fire(new MyEvent()); } } @ViewAccessScoped //@SessionScoped @Named public class AnotherBean implements Serializable{ protected Logger log = Logger.getLogger(getClass().getSimpleName()); public void observe(@Observes(notifyObserver = Reception.IF_EXISTS) MyEvent event){ log.fine(event received:+event); } i receive nullpointer exception when i fire the event: javax.faces.FacesException: #{myBean.fire}: java.lang.NullPointerException at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118
Re: Migrating to CDI: injecting stateless/facade in Converter via facescontext
you can also use CODI @Advanced and then inject anything in the converter, see [1]. i hope it helps. [1]:https://cwiki.apache.org/EXTCDI/jsf-usage.html#JSFUsage-DependencyInjection Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://conventionsframework.org http://rpestano.wordpress.com/ @realpestano De: Howard W. Smith, Jr. smithh032...@gmail.com Para: Mark Struberg strub...@yahoo.de; MyFaces Discussion users@myfaces.apache.org Cc: us...@openejb.apache.org us...@openejb.apache.org Enviadas: Terça-feira, 20 de Novembro de 2012 11:37 Assunto: Re: Migrating to CDI: injecting stateless/facade in Converter via facescontext Interesting and noted, thanks. Yes, I did hear JSF 2.2 will allow CDI in facesconverter. Thanks. On Nov 20, 2012 8:34 AM, Mark Struberg strub...@yahoo.de wrote: you could also have used CODI BeanManagerProvider#getReference to get access to the bean. The support you need out of the box will come in JSF-2.2. LieGrue, strub - Original Message - From: Howard W. Smith, Jr. smithh032...@gmail.com To: us...@openejb.apache.org; MyFaces Discussion users@myfaces.apache.org Cc: Sent: Tuesday, November 20, 2012 1:56 PM Subject: Re: Migrating to CDI: injecting stateless/facade in Converter via facescontext T he goal was to inject bean in facesconverter via CDI, but I don't have this need anymore, since faces converter is not an eligible injection point, so I opted to use request scoped JSF managed beans that have facesconverter defined within the bean. That's working fine. Thanks. Okay, I can cc myfaces user group as well, going forward. :-) On Nov 20, 2012 7:37 AM, Romain Manni-Bucau rmannibu...@gmail.com wrote: i'm still not clear about your goal and where you need injection maybe share a (runnable) sample to show us what you are talking about side note: myfaces list can help you a lot about it too *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2012/11/20 Howard W. Smith, Jr. smithh032...@gmail.com Interesting, that will allow you to get instance of beans, if already instantiated, and that could have helped in converter, only if beans already injected earlier? On Nov 20, 2012 7:11 AM, Romain Manni-Bucau rmannibu...@gmail.com wrote: was thinking to http://docs.oracle.com/javaee/6/api/javax/faces/context/FacesContext.html getAttributes() method (depend a bit on your real need) *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2012/11/20 Howard W. Smith, Jr. smithh032...@gmail.com Faces context? Please explain. On Nov 20, 2012 1:56 AM, Romain Manni-Bucau rmannibu...@gmail.com wrote: You cant use faces context? Le 20 nov. 2012 03:01, Howard W. Smith, Jr. smithh032...@gmail.com a écrit : For minimal changes, I'm adding FacesConverter to JSF requestscoped managedBean's as per the Stackoverflow answer below: How can I inject in @FacesConverter? http://stackoverflow.com/a/13156834/933054 Yes, this means more classes in the project, but honestly, I have not had to spend much time 'maintaining' my Converter classes at all. I just tested this concept, and I'm not experiencing this exceptioin any more. While testing the above, I see more exceptions to resolve related to migrating to CDI. Will let you all know, if I have any more questions. Thanks for all the responses/help, so far. :) On Mon, Nov 19, 2012 at 7:20 PM, Romain Manni-Bucau rmannibu...@gmail.comwrote: If it is a nested class you need it otherwise (class foo in foo.java file) you dont need it Le 20 nov. 2012 01:16, Howard W. Smith, Jr. smithh032...@gmail.com a écrit : Good question. I removed 'static', because I didn't see it in the code at following URLs: https://cwiki.apache.org/confluence/display/EXTCDI/JSF+Usage#JSFUsage-DependencyInjection
Re: Migrating to CDI: injecting stateless/facade in Converter via facescontext
you can also use CODI @Advanced and then inject anything in the converter, see [1]. i hope it helps. [1]:https://cwiki.apache.org/EXTCDI/jsf-usage.html#JSFUsage-DependencyInjection Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://conventionsframework.org http://rpestano.wordpress.com/ @realpestano De: Howard W. Smith, Jr. smithh032...@gmail.com Para: Mark Struberg strub...@yahoo.de; MyFaces Discussion users@myfaces.apache.org Cc: us...@openejb.apache.org us...@openejb.apache.org Enviadas: Terça-feira, 20 de Novembro de 2012 11:37 Assunto: Re: Migrating to CDI: injecting stateless/facade in Converter via facescontext Interesting and noted, thanks. Yes, I did hear JSF 2.2 will allow CDI in facesconverter. Thanks. On Nov 20, 2012 8:34 AM, Mark Struberg strub...@yahoo.de wrote: you could also have used CODI BeanManagerProvider#getReference to get access to the bean. The support you need out of the box will come in JSF-2.2. LieGrue, strub - Original Message - From: Howard W. Smith, Jr. smithh032...@gmail.com To: us...@openejb.apache.org; MyFaces Discussion users@myfaces.apache.org Cc: Sent: Tuesday, November 20, 2012 1:56 PM Subject: Re: Migrating to CDI: injecting stateless/facade in Converter via facescontext T he goal was to inject bean in facesconverter via CDI, but I don't have this need anymore, since faces converter is not an eligible injection point, so I opted to use request scoped JSF managed beans that have facesconverter defined within the bean. That's working fine. Thanks. Okay, I can cc myfaces user group as well, going forward. :-) On Nov 20, 2012 7:37 AM, Romain Manni-Bucau rmannibu...@gmail.com wrote: i'm still not clear about your goal and where you need injection maybe share a (runnable) sample to show us what you are talking about side note: myfaces list can help you a lot about it too *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2012/11/20 Howard W. Smith, Jr. smithh032...@gmail.com Interesting, that will allow you to get instance of beans, if already instantiated, and that could have helped in converter, only if beans already injected earlier? On Nov 20, 2012 7:11 AM, Romain Manni-Bucau rmannibu...@gmail.com wrote: was thinking to http://docs.oracle.com/javaee/6/api/javax/faces/context/FacesContext.html getAttributes() method (depend a bit on your real need) *Romain Manni-Bucau* *Twitter: @rmannibucau https://twitter.com/rmannibucau* *Blog: **http://rmannibucau.wordpress.com/* http://rmannibucau.wordpress.com/ *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2012/11/20 Howard W. Smith, Jr. smithh032...@gmail.com Faces context? Please explain. On Nov 20, 2012 1:56 AM, Romain Manni-Bucau rmannibu...@gmail.com wrote: You cant use faces context? Le 20 nov. 2012 03:01, Howard W. Smith, Jr. smithh032...@gmail.com a écrit : For minimal changes, I'm adding FacesConverter to JSF requestscoped managedBean's as per the Stackoverflow answer below: How can I inject in @FacesConverter? http://stackoverflow.com/a/13156834/933054 Yes, this means more classes in the project, but honestly, I have not had to spend much time 'maintaining' my Converter classes at all. I just tested this concept, and I'm not experiencing this exceptioin any more. While testing the above, I see more exceptions to resolve related to migrating to CDI. Will let you all know, if I have any more questions. Thanks for all the responses/help, so far. :) On Mon, Nov 19, 2012 at 7:20 PM, Romain Manni-Bucau rmannibu...@gmail.comwrote: If it is a nested class you need it otherwise (class foo in foo.java file) you dont need it Le 20 nov. 2012 01:16, Howard W. Smith, Jr. smithh032...@gmail.com a écrit : Good question. I removed 'static', because I didn't see it in the code at following URLs: https://cwiki.apache.org/confluence/display/EXTCDI/JSF+Usage#JSFUsage-DependencyInjection
Re: Passing method parameters to nested composite component
Hi Ludovic, i've had similar problem with closeListener of primefaces dialog inside composite components, my workaround was as follows: composite:interface componentType=yourpackage.ModalComposite composite:attribute name=closeListener method-signature=void method(org.primefaces.event.CloseEvent) shortDescription=action to call on close - signature: void method(org.primefaces.event.CloseEvent)/ ... other attributes... composite:implementation p:dialog header=#{cc.attrs.header} //some attrs p:ajax event=close listener=#{cc.closeListener} //here is the important part update=#{cc.attrs.onCloseUpdate} process=@this/ //other stuff and finally the java class which handles the component @FacesComponent(value=yourpackage.ModalComposite) public class ModalComposite extends UINamingContainer { @Override public String getFamily() { return javax.faces.NamingContainer; // Important! Required for composite components. } public void closeListener(CloseEvent event) { FacesContext context = FacesContext.getCurrentInstance(); MethodExpression ajaxEventListener = (MethodExpression) getAttributes().get(closeListener); if(ajaxEventListener != null){ ajaxEventListener.invoke(context.getELContext(), new Object[] { event }); } } and here is how to use it: tag:modalComposite... closeListener=#{myBean.clearSelection} public class MyBean { public void clearSelection(CloseEvent event){ this.selectedPeople = null; } } maybe it helps as workaround for you.. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://conventionsframework.org http://rpestano.wordpress.com/ @realpestano De: l.pe...@senat.fr l.pe...@senat.fr Para: users@myfaces.apache.org Enviadas: Segunda-feira, 23 de Julho de 2012 14:53 Assunto: Re: Passing method parameters to nested composite component On 23/07/2012 19:39, Leonardo Uribe wrote: Hi Thinking more about it, check if both composite components define the attribute with method-signature. In theory, if there is a bug, it should be possible to reproduce it excluding primefaces and using actionListener or valueChangeListener instead. But first try the syntax using targets instead the cc EL expression. I immediatly tried targets when you pointed it (on both declarations). It did not help. Both composite components declare the attribute with method-signature. The value is used by the inner control in an ajax declaration of a primefaces p:datatable : p:ajax event=rowEdit update=#{cc.attrs.onRowEdit} listener=#{cc.attrs.onRowEditListener} / I do not see how to use actionListener or valueChangeListener there. I tried (dirty) using cc.parent.attrs.onRowEditListener instead, and it did not help. h:outputText of cc.parent.attrs.onRowEditListener seems correct : org.apache.el.MethodExpressionImpl@358f0647 Thx, Ludovic | | AVANT D'IMPRIMER, PENSEZ A L'ENVIRONNEMENT. |
Re: Custom tag
you're welcome. Leonardo's approach is the solution, what i proposed was more like a workaround ;) Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://code.google.com/p/jsf-conventions-framework/ http://rpestano.wordpress.com http://twitter.com/realpestano De: José Luis Cetina maxtorz...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Sexta-feira, 29 de Junho de 2012 12:02 Assunto: Re: Custom tag Thanks Rafael and Leonardo. Its very easy with target, this solution is best in my opinion. Works. Thanks again 2012/6/29 Leonardo Uribe lu4...@gmail.com: Hi You can try the alternate syntax using targets. For example: composite:interface composite:attribute name=action targets=testComponent/ /composite:interface composite:implementation h:commandButton id=testComponent value=Press Me/ /composite:implementation Instead use EL, you can use the id hierarchy to locate the component. In this case, there will not be NullPointerException, because only if the property is set, the value is assigned. I have tested both syntax in MyFaces with tons of tests: http://svn.apache.org/repos/asf/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/ and it works without problem. regards, Leonardo Uribe 2012/6/29 Rafael Pestano rmpest...@yahoo.com.br: again, cc:implementation h:commandButton value=Ok rendered=#{not empty cc.attrs.action and empty cc.attrs.actionListener} action=#{cc.attrs.action} / h:commandButton value=Ok rendered=#{not empty cc.attrs.actionListener and empty cc.attrs.action} actionListener=#{cc.attrs.actionListener} / h:commandButton value=Ok rendered=#{not empty cc.attrs.actionListener and not empty cc.attrs.action} actionListener=#{cc.attrs.actionListener} action=#{cc.attrs.action} / /cc:implementation Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://code.google.com/p/jsf-conventions-framework/ http://rpestano.wordpress.com http://twitter.com/realpestano - Mensagem original - De: Rafael Pestano rmpest...@yahoo.com.br Para: MyFaces Discussion users@myfaces.apache.org Cc: Enviadas: Quinta-feira, 28 de Junho de 2012 23:12 Assunto: Re: Custom tag you can try: cc:implementation h:commandButton value=Ok rendered=#{not empty cc.attrs.action and empty cc.attrs.actionListener} action=#{cc.attrs.action} / h:commandButton value=Ok rendered=#{not empty cc.attrs.actionListener and empty cc.attrs.action} actionListener=#{cc.attrs.actionListener} action=#{cc.attrs.action} / h:commandButton value=Ok rendered=#{not empty cc.attrs.actionListener and not empty cc.attrs.action} actionListener=#{cc.attrs.actionListener} / /cc:implementation maybe it helps. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://code.google.com/p/jsf-conventions-framework/ http://rpestano.wordpress.com http://twitter.com/realpestano De: José Luis Cetina maxtorz...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Quinta-feira, 28 de Junho de 2012 18:28 Assunto: Custom tag Hi i have this: Simple custom tag: cc: interface componentType=my_button cc:attribute name=action method-signature=java.lang.String action()/ cc:attribute name=actionListener method-signature=void actionListener(javax.faces.event.ActionEvent event)/ / cc:interface cc:implementation h:commandButton value=Ok action=#{cc.attrs.action} actionListener=#{cc.attrs.actionListener} / /cc:implementation Then in my page i do: mytags:mybutton action=#{myBean.actionMethod}/ But i get a NullPointerException, this is because im not setting the actionListener attribute, but the thing is that sometimes i need or only action or actionlistener not both, but i have to provided both if not i get the nullpointer. I have to do this, but the listener method is empty in my managedbean, i only do this for avoid the nullpointer. mytags:mybutton action=#{myBean.actionMethod} actionListener=#{myBean.actionListenerMethod}/ how can i avoid this? Thanks --- SCJA. José Luis Cetina --- -- --- SCJA. José
Re: Custom tag
you can try: cc:implementation h:commandButton value=Ok rendered=#{not empty cc.attrs.action and empty cc.attrs.actionListener} action=#{cc.attrs.action} / h:commandButton value=Ok rendered=#{not empty cc.attrs.actionListener and empty cc.attrs.action} actionListener=#{cc.attrs.actionListener} action=#{cc.attrs.action} / h:commandButton value=Ok rendered=#{not empty cc.attrs.actionListener and not empty cc.attrs.action} actionListener=#{cc.attrs.actionListener} / /cc:implementation maybe it helps. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://code.google.com/p/jsf-conventions-framework/ http://rpestano.wordpress.com http://twitter.com/realpestano De: José Luis Cetina maxtorz...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Quinta-feira, 28 de Junho de 2012 18:28 Assunto: Custom tag Hi i have this: Simple custom tag: cc: interface componentType=my_button cc:attribute name=action method-signature=java.lang.String action()/ cc:attribute name=actionListener method-signature=void actionListener(javax.faces.event.ActionEvent event)/ / cc:interface cc:implementation h:commandButton value=Ok action=#{cc.attrs.action} actionListener=#{cc.attrs.actionListener} / /cc:implementation Then in my page i do: mytags:mybutton action=#{myBean.actionMethod}/ But i get a NullPointerException, this is because im not setting the actionListener attribute, but the thing is that sometimes i need or only action or actionlistener not both, but i have to provided both if not i get the nullpointer. I have to do this, but the listener method is empty in my managedbean, i only do this for avoid the nullpointer. mytags:mybutton action=#{myBean.actionMethod} actionListener=#{myBean.actionListenerMethod}/ how can i avoid this? Thanks --- SCJA. José Luis Cetina ---
Re: Custom tag
again, cc:implementation h:commandButton value=Ok rendered=#{not empty cc.attrs.action and empty cc.attrs.actionListener} action=#{cc.attrs.action} / h:commandButton value=Ok rendered=#{not empty cc.attrs.actionListener and empty cc.attrs.action} actionListener=#{cc.attrs.actionListener} / h:commandButton value=Ok rendered=#{not empty cc.attrs.actionListener and not empty cc.attrs.action} actionListener=#{cc.attrs.actionListener} action=#{cc.attrs.action} / /cc:implementation Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://code.google.com/p/jsf-conventions-framework/ http://rpestano.wordpress.com http://twitter.com/realpestano - Mensagem original - De: Rafael Pestano rmpest...@yahoo.com.br Para: MyFaces Discussion users@myfaces.apache.org Cc: Enviadas: Quinta-feira, 28 de Junho de 2012 23:12 Assunto: Re: Custom tag you can try: cc:implementation h:commandButton value=Ok rendered=#{not empty cc.attrs.action and empty cc.attrs.actionListener} action=#{cc.attrs.action} / h:commandButton value=Ok rendered=#{not empty cc.attrs.actionListener and empty cc.attrs.action} actionListener=#{cc.attrs.actionListener} action=#{cc.attrs.action} / h:commandButton value=Ok rendered=#{not empty cc.attrs.actionListener and not empty cc.attrs.action} actionListener=#{cc.attrs.actionListener} / /cc:implementation maybe it helps. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://code.google.com/p/jsf-conventions-framework/ http://rpestano.wordpress.com http://twitter.com/realpestano De: José Luis Cetina maxtorz...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Quinta-feira, 28 de Junho de 2012 18:28 Assunto: Custom tag Hi i have this: Simple custom tag: cc: interface componentType=my_button cc:attribute name=action method-signature=java.lang.String action()/ cc:attribute name=actionListener method-signature=void actionListener(javax.faces.event.ActionEvent event)/ / cc:interface cc:implementation h:commandButton value=Ok action=#{cc.attrs.action} actionListener=#{cc.attrs.actionListener} / /cc:implementation Then in my page i do: mytags:mybutton action=#{myBean.actionMethod}/ But i get a NullPointerException, this is because im not setting the actionListener attribute, but the thing is that sometimes i need or only action or actionlistener not both, but i have to provided both if not i get the nullpointer. I have to do this, but the listener method is empty in my managedbean, i only do this for avoid the nullpointer. mytags:mybutton action=#{myBean.actionMethod} actionListener=#{myBean.actionListenerMethod}/ how can i avoid this? Thanks --- SCJA. José Luis Cetina ---
Re: OWB + Hibernate + Tomcat 7
Hi Christian thanks for your reply, i have already tried that and the error is similar:http://pastebin.com/CdeC85KC if i remove the dao injection everything works fine, the problem is just the entitymanager injection with @PersistenceContext, so i think its not a OWB issue but a misconfiguration in Hibernate stuff. I toke a look at myfaces maven archetypes[1] but couldnt find one using JPA/PersistenceContext. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://code.google.com/p/jsf-conventions-framework/ http://rpestano.wordpress.com @realpestano De: Christian Kaltepoth christ...@kaltepoth.de Para: u...@openwebbeans.apache.org u...@openwebbeans.apache.org Enviadas: Sábado, 2 de Junho de 2012 4:52 Assunto: Re: OWB + Hibernate + Tomcat 7 I only had a quick look at the stacktrace, but it looks like Hibernate is trying to use the Bean Validation API and the bootstrapping process fails for some reason. Perhaps the implementation is missing? Do you have Hibernate Validator on the classpath? You could try to add this and see if it helps. Christian 2012/6/2 Rafael Pestano rmpest...@yahoo.com.br Hi everyone, im trying to migrante a simple Spring crud app to OWB running in tomcat 7.0.27, CDI container starts without problems but im facing some problems with Hibernate, here is the startup log + error when i access the login page: http://pastebin.com/UTpuk18p the application can be found here: https://github.com/rmpestano/jsf-issuetracker-project the libs i'm deploying within my war are here:https://github.com/rmpestano/jsf-issuetracker-project/tree/master/WebContent/WEB-INF/lib and the class which is referred in error log is this one: https://github.com/rmpestano/jsf-issuetracker-project/blob/master/src/br/com/triadworks/issuetracker/dao/impl/UsuarioDaoImpl.java which is failing to be injected in this bean: https://github.com/rmpestano/jsf-issuetracker-project/blob/master/src/br/com/triadworks/issuetracker/controller/LoginBean.java any help is appreciated, thanks in advance. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://code.google.com/p/jsf-conventions-framework/ http://rpestano.wordpress.com @realpestano -- Christian Kaltepoth Blog: http://chkal.blogspot.com/ Twitter: http://twitter.com/chkal
OWB + Hibernate + Tomcat 7
Hi everyone, im trying to migrante a simple Spring crud app to OWB running in tomcat 7.0.27, CDI container starts without problems but im facing some problems with Hibernate, here is the startup log + error when i access the login page: http://pastebin.com/UTpuk18p the application can be found here: https://github.com/rmpestano/jsf-issuetracker-project the libs i'm deploying within my war are here:https://github.com/rmpestano/jsf-issuetracker-project/tree/master/WebContent/WEB-INF/lib and the class which is referred in error log is this one: https://github.com/rmpestano/jsf-issuetracker-project/blob/master/src/br/com/triadworks/issuetracker/dao/impl/UsuarioDaoImpl.java which is failing to be injected in this bean: https://github.com/rmpestano/jsf-issuetracker-project/blob/master/src/br/com/triadworks/issuetracker/controller/LoginBean.java any help is appreciated, thanks in advance. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://code.google.com/p/jsf-conventions-framework/ http://rpestano.wordpress.com @realpestano
Re: [CODI] ViewAccessScoped beans without windowId in URL
Hi Pavel, WindowContextConfig#isUrlParameterSupported should be enough, does serverside demo work for you? http://people.apache.org/~gpetracek/myfaces/codi/demos/serverside_demo_jsf12.zip keep in mind that the bean will not survive to a redirect. I hope it helps. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS http://code.google.com/p/jsf-conventions-framework/ http://rpestano.wordpress.com @realpestano De: Pavel Arnošt pavel.arn...@loutka.cz Para: users@myfaces.apache.org Enviadas: Quinta-feira, 10 de Maio de 2012 9:41 Assunto: [CODI] ViewAccessScoped beans without windowId in URL Hi, I already read documentation in the wiki and several old posts, but I don't still get it - is it possible to use ViewAccessScoped beans without windowId in URL? When I disable WindowContextConfig#isUrlParameterSupported, windowId is gone but AJAX calls now creates new bean instances on requests. In javadoc, there is a note about server-side window-handler, how can I use it? Thanks, Regards, Pavel Arnost
Re: MyFaces and CODI
Hi gerhard , got CODI working on wls 11g \o/. We fixed the problem with our page layout(the frames) and are using the client side windowId solution(the default one), so no especial configuration was required, we only changed the webbeans listener listener listener-classorg.apache.myfaces.extensions.cdi.openwebbeans.startup.WebBeansAwareConfigurationListener/listener-class /listener other info is that we are using exploded ear, with war we could not deploy the app (i posted the error and the war is this thread). many thanks for all your help and time, i really apreciated it! Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Domingo, 18 de Março de 2012 18:33 Assunto: Re: MyFaces and CODI hi rafael, i just can say that i've used it already with wls 11g. regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/18 Rafael Pestano rmpest...@yahoo.com.br hi gerhard, tried that but got the same error, the generated war can be found here: http://bit.ly/xvbtu7 Mark, thanks for the reply, ill try that. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ - Mensagem original - De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Cc: Enviadas: Domingo, 18 de Março de 2012 17:32 Assunto: Re: MyFaces and CODI hi rafael, for a wls 11g deployment you have to follow [1]. regards, gerhard [1] https://cwiki.apache.org/confluence/display/EXTCDI/JavaEE5+Support http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/18 Rafael Pestano rmpest...@yahoo.com.br Hi guys, I think that what Mark stated can be happening in the environment at my company(weblogic 11g, mojarra 1.2, owb and CODI) cause a simple forward is also causing the bean to be instantiated(tested with ViewAccess and WindowScoped), How can i ensure that the whole Context is being initialized? About the server side solution Gerhard proposed i can confirm it is working here at home, the main problem is something with theconstalation that the application at my company is using, maybe the frame based layout, jspx extension or something else. i also tried to deploy Gerhard example here in weblogic here at home without success, the CDI container cannot start. i just changed from myfaces to mojarra, instaled the example via maven and deployed the war in weblogic 11g(10.3.2), to try simulate the enviroment at my company, here is the error: INFO: Initializing Sun's JavaServer Faces implementation (1.2_03-b04-FCS) for context '/playground-jsf12-1.0.4' 18/03/2012 17:10:46 org.apache.myfaces.extensions.cdi.core.api.provider.ServiceProvider clinit INFO: org.apache.myfaces.extensions.cdi.core.impl.provider.DefaultServiceProvider installed successfully. 18/03/2012 17:10:46 org.apache.myfaces.extensions.cdi.core.api.provider.ServiceProvider clinit INFO: org.apache.myfaces.extensions.cdi.core.impl.provider.DefaultServiceProviderContext installed successfully. java.lang.IllegalStateException: no org.apache.myfaces.extensions.cdi.core.api.provider.BeanManagerProvider in place! Please ensur e that you configured the CDI implementation of your choice properly. If your setup is correct, please clear all caches and compil ed artifacts. If there is still a problem, try one of the controlled bootstrapping add-ons for the CDI implementation you are usin g. at org.apache.myfaces.extensions.cdi.core.api.provider.BeanManagerProvider.getInstance(BeanManagerProvider.java:81) at org.apache.myfaces.extensions.cdi.core.impl.util.CodiUtils.getContextualReferenceByClass(CodiUtils.java:124) at org.apache.myfaces.extensions.cdi.jsf.impl.listener.phase.PhaseListenerExtension.consumePhaseListeners(PhaseListenerExt ension.java:110) at org.apache.myfaces.extensions.cdi.jsf.impl.listener.phase.CodiLifecycleFactoryWrapper.getLifecycle(CodiLifecycleFactory Wrapper.java:65) at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:1115) at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:766) at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:529
Re: MyFaces and CODI
:79) at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116) at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323) at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844) at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253) at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440) at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCa llbackDeliverer.java:181) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallback Deliverer.java:12) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliv erer.java:67) at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173) 18/03/2012 17:10:47 com.sun.faces.config.ConfigureListener contextInitialized thanks for your time. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ - Mensagem original - De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Cc: Enviadas: Domingo, 18 de Março de 2012 16:47 Assunto: Re: MyFaces and CODI hi mark, since rafael mentioned that it works without a4j and there is no issue with a4j in the demo, i don't think that it is such a basic issue. regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/18 Mark Struberg strub...@yahoo.de Gerhard pinged me that you are using @ViewAccessScoped. In that case I'd recomment to debug if the whole Context Extension gets properly registrated. If the CDI container doesn't know the @ViewAccessScoped annotation then all your beans will end up as @Dependent... LieGrue, strub - Original Message - From: Mark Struberg strub...@yahoo.de To: MyFaces Discussion users@myfaces.apache.org Cc: Sent: Sunday, March 18, 2012 7:42 PM Subject: Re: MyFaces and CODI when i find out what's causing my bean to be instantiated on every ajax call i'll come back here to report. That sounds familiar - good luck ;) Which scope does your bean have? You are sure that you are really using CDI javax.enterprise.context.* scopes and not javax.faces.bean.* scopes due to a wrong auto-import of your IDE? LieGrue, strub - Original Message - From: Rafael Pestano rmpest...@yahoo.com.br To: MyFaces Discussion users@myfaces.apache.org Cc: Sent: Saturday, March 17, 2012 4:34 PM Subject: Re: MyFaces and CODI yeap, i also deployed the server side demo in tomcat and it works as expected, when i find out what's causing my bean to be instantiated on every ajax call i'll come back here to report. many thanks for the assistance. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Sexta-feira, 16 de Março de 2012 22:46 Assunto: Re: MyFaces and CODI hi rafael, i can't reproduce it. i added richfaces to the previous demo as well as a4j support to the input component and everything works as expected. regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/15 Rafael Pestano rmpest...@yahoo.com.br Hi Gehard, i didnt got the ideia, do you have any example or a link showing this approach? what i have got til now is: 1 - WindowContextIdHolderComponent is a jsf component which is added dynamically to the view 2 - this component
Re: MyFaces and CODI
yeap, i also deployed the server side demo in tomcat and it works as expected, when i find out what's causing my bean to be instantiated on every ajax call i'll come back here to report. many thanks for the assistance. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Sexta-feira, 16 de Março de 2012 22:46 Assunto: Re: MyFaces and CODI hi rafael, i can't reproduce it. i added richfaces to the previous demo as well as a4j support to the input component and everything works as expected. regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/15 Rafael Pestano rmpest...@yahoo.com.br Hi Gehard, i didnt got the ideia, do you have any example or a link showing this approach? what i have got til now is: 1 - WindowContextIdHolderComponent is a jsf component which is added dynamically to the view 2 - this component holds the windowId 3 - i have,somehow , to keep the windowId the same between requests so my ViewAccessScoped bean is keeped alive - here is where im stuck Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ - Mensagem original - De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Cc: Enviadas: Quinta-feira, 15 de Março de 2012 11:28 Assunto: Re: MyFaces and CODI hi rafael, @ WindowContextIdHolderComponent: that's the name of the class. you have to resolve the component (by type) before the view gets rendered and add it to the ajax enabled a4j components via the corresponding java-api. @ custom approach: independent of the concrete approach you would like to use, you just have to ensure that the information is available on the server-side (for every jsf request which starts the jsf request-lifecycle). regards, gerhard Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/15 Rafael Pestano rmpest...@yahoo.com.br Hi again, it will work with a4j as soon as you ensure that it gets restored for requests triggered by a4j you mean i should send WindowContextIdHolderComponent within the ajax request? somethink like a4j:support process=WindowContextIdHolderComponent/ ? if so whats the id of the generated component? i also have another question, in the javadoc of WindowContextConfig isUrlParameterSuported() says Specifies if it is allowed to use URL params for forwarding the current window-id. (deactivate it e.g. for higher security - in this case it's required to use a window id provided by a component lib or a server-side window-handler how can i create a component to handle the window id? can i do that with an h:inputHidden for example? thanks for the help. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Quinta-feira, 15 de Março de 2012 10:37 Assunto: Re: MyFaces and CODI hi rafael, the fallback adds a component (WindowContextIdHolderComponent) dynamically (as a direct child of UiViewRoot) - it will work with a4j as soon as you ensure that it gets restored for requests triggered by a4j. regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/15 Rafael Pestano rmpest...@yahoo.com.br well its not 100% yet ;(...on every ajaxCall my ViewAccessScoped bean is being instantiated, im using a4j, there is any known issue with it? for example h:selectOneMenu . a4j:support event=onchange action=when the action is called the bean constructor gets called/ /h:selectOneMenu if i change from View to RequestScoped the bahavior is the same, any ideas? thanks in advance. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework
Re: MyFaces and CODI
if you don't need redirects, you could have a look at e.g. [1] which uses an internal fallback. yea, its our case and it just works! many thanks for your help, keep the great work! Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Quarta-feira, 14 de Março de 2012 23:19 Assunto: Re: MyFaces and CODI hi rafael, as you have seen it's easy to provide a custom WindowHandler (just implement the interface and provide your implementation as alternative cdi bean) - you can integrate every custom approach which is enough to solve you requirements. if you don't need redirects, you could have a look at e.g. [1] which uses an internal fallback. regards, gerhard [1] http://s.apache.org/SAs http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/15 Rafael Pestano rmpest...@yahoo.com.br Hi Gehard, its a stopper to us cause we are still dependent on JSF 1.2 Can i implement an alternative to org.apache.myfaces.extensions.cdi.jsf2.impl.scope.conversation.ServerSideWindowHandler based on JSF 1.2? i see you use flash scope to span the windowId through requests in the server side solution: if (windowId != null) 79 { 80 externalContext.getRequestMap().put(WINDOW_CONTEXT_ID_PARAMETER_KEY, windowId); 81 externalContext.getFlash().keep(WINDOW_CONTEXT_ID_PARAMETER_KEY); 82 } if i put the windownId in the sessionMap it would still work? i think ill find hard time trying to remove the windowId from the map when user leave the page. thanks for your help i really appreciated it. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ - Mensagem original - De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Cc: Enviadas: Quarta-feira, 14 de Março de 2012 20:55 Assunto: Re: MyFaces and CODI hi rafael, internally the ServerSideWindowHandler is based on the flash scope (that's one of the mentioned disadvantages) - it's bound to jsf 2+ - it is: org.apache.myfaces.extensions.cdi.jsf2.impl.scope.conversation.ServerSideWindowHandler (and you can't use the additional js.) with some constellations you just hit the restrictions of browsers - you have to choose what you really need. regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/15 Rafael Pestano rmpest...@yahoo.com.br i see, i have used the client side one alternatives classorg.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.ClientSideWindowHandler/class /alternatives i imagine the server side should be alternatives classorg.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.ServerSideWindowHandler/class /alternativesalright? i will test it tomorrow and give the feedback, thanks. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ - Mensagem original - De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Cc: Enviadas: Quarta-feira, 14 de Março de 2012 20:11 Assunto: Re: MyFaces and CODI hi rafael, the easiest approach to test an alternative for this constellation is the activation of the ServerSideWindowHandler (it's a std. cdi @Alternative implementation - you can activate it in the beans.xml file of your application). (however, please be aware that this alternative implementation has some disadvantages.) regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/14 Rafael Pestano rmpest...@yahoo.com.br Hi Gerhard, i successfuly added codi and openwebbeans to an application running on weblogic 11g however its a legacy application which uses frames, basicaly we have a menu on the left frame that targets the center frame, something like: h:commandLink value=menuLink action=#{myBean.init} target=frmDados / the problem is, when a add CODI to the application and mark myBean as ViewAccessScoped (and thus the windowId starts to be append to the url) the above menuLink
Re: MyFaces and CODI
well its not 100% yet ;(...on every ajaxCall my ViewAccessScoped bean is being instantiated, im using a4j, there is any known issue with it? for example h:selectOneMenu . a4j:support event=onchange action=when the action is called the bean constructor gets called/ /h:selectOneMenu if i change from View to RequestScoped the bahavior is the same, any ideas? thanks in advance. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ De: Rafael Pestano rmpest...@yahoo.com.br Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Quinta-feira, 15 de Março de 2012 8:45 Assunto: Re: MyFaces and CODI if you don't need redirects, you could have a look at e.g. [1] which uses an internal fallback. yea, its our case and it just works! many thanks for your help, keep the great work! Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Quarta-feira, 14 de Março de 2012 23:19 Assunto: Re: MyFaces and CODI hi rafael, as you have seen it's easy to provide a custom WindowHandler (just implement the interface and provide your implementation as alternative cdi bean) - you can integrate every custom approach which is enough to solve you requirements. if you don't need redirects, you could have a look at e.g. [1] which uses an internal fallback. regards, gerhard [1] http://s.apache.org/SAs http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/15 Rafael Pestano rmpest...@yahoo.com.br Hi Gehard, its a stopper to us cause we are still dependent on JSF 1.2 Can i implement an alternative to org.apache.myfaces.extensions.cdi.jsf2.impl.scope.conversation.ServerSideWindowHandler based on JSF 1.2? i see you use flash scope to span the windowId through requests in the server side solution: if (windowId != null) 79 { 80 externalContext.getRequestMap().put(WINDOW_CONTEXT_ID_PARAMETER_KEY, windowId); 81 externalContext.getFlash().keep(WINDOW_CONTEXT_ID_PARAMETER_KEY); 82 } if i put the windownId in the sessionMap it would still work? i think ill find hard time trying to remove the windowId from the map when user leave the page. thanks for your help i really appreciated it. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ - Mensagem original - De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Cc: Enviadas: Quarta-feira, 14 de Março de 2012 20:55 Assunto: Re: MyFaces and CODI hi rafael, internally the ServerSideWindowHandler is based on the flash scope (that's one of the mentioned disadvantages) - it's bound to jsf 2+ - it is: org.apache.myfaces.extensions.cdi.jsf2.impl.scope.conversation.ServerSideWindowHandler (and you can't use the additional js.) with some constellations you just hit the restrictions of browsers - you have to choose what you really need. regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/15 Rafael Pestano rmpest...@yahoo.com.br i see, i have used the client side one alternatives classorg.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.ClientSideWindowHandler/class /alternatives i imagine the server side should be alternatives classorg.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.ServerSideWindowHandler/class /alternativesalright? i will test it tomorrow and give the feedback, thanks. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ - Mensagem original - De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Cc: Enviadas: Quarta-feira, 14 de Março de 2012 20:11 Assunto: Re: MyFaces and CODI hi rafael, the easiest approach to test an alternative for this constellation is the activation of the ServerSideWindowHandler (it's a std. cdi @Alternative implementation - you can activate it in the beans.xml file of your application
Re: MyFaces and CODI
Hi again, it will work with a4j as soon as you ensure that it gets restored for requests triggered by a4j you mean i should send WindowContextIdHolderComponent within the ajax request? somethink like a4j:support process=WindowContextIdHolderComponent/ ? if so whats the id of the generated component? i also have another question, in the javadoc of WindowContextConfig isUrlParameterSuported() says Specifies if it is allowed to use URL params for forwarding the current window-id. (deactivate it e.g. for higher security - in this case it's required to use a window id provided by a component lib or a server-side window-handler how can i create a component to handle the window id? can i do that with an h:inputHidden for example? thanks for the help. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Quinta-feira, 15 de Março de 2012 10:37 Assunto: Re: MyFaces and CODI hi rafael, the fallback adds a component (WindowContextIdHolderComponent) dynamically (as a direct child of UiViewRoot) - it will work with a4j as soon as you ensure that it gets restored for requests triggered by a4j. regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/15 Rafael Pestano rmpest...@yahoo.com.br well its not 100% yet ;(...on every ajaxCall my ViewAccessScoped bean is being instantiated, im using a4j, there is any known issue with it? for example h:selectOneMenu . a4j:support event=onchange action=when the action is called the bean constructor gets called/ /h:selectOneMenu if i change from View to RequestScoped the bahavior is the same, any ideas? thanks in advance. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ De: Rafael Pestano rmpest...@yahoo.com.br Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Quinta-feira, 15 de Março de 2012 8:45 Assunto: Re: MyFaces and CODI if you don't need redirects, you could have a look at e.g. [1] which uses an internal fallback. yea, its our case and it just works! many thanks for your help, keep the great work! Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Quarta-feira, 14 de Março de 2012 23:19 Assunto: Re: MyFaces and CODI hi rafael, as you have seen it's easy to provide a custom WindowHandler (just implement the interface and provide your implementation as alternative cdi bean) - you can integrate every custom approach which is enough to solve you requirements. if you don't need redirects, you could have a look at e.g. [1] which uses an internal fallback. regards, gerhard [1] http://s.apache.org/SAs http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/15 Rafael Pestano rmpest...@yahoo.com.br Hi Gehard, its a stopper to us cause we are still dependent on JSF 1.2 Can i implement an alternative to org.apache.myfaces.extensions.cdi.jsf2.impl.scope.conversation.ServerSideWindowHandler based on JSF 1.2? i see you use flash scope to span the windowId through requests in the server side solution: if (windowId != null) 79 { 80 externalContext.getRequestMap().put(WINDOW_CONTEXT_ID_PARAMETER_KEY, windowId); 81 externalContext.getFlash().keep(WINDOW_CONTEXT_ID_PARAMETER_KEY); 82 } if i put the windownId in the sessionMap it would still work? i think ill find hard time trying to remove the windowId from the map when user leave the page. thanks for your help i really appreciated it. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ - Mensagem original - De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Cc: Enviadas: Quarta-feira, 14 de Março de 2012 20:55 Assunto: Re: MyFaces and CODI hi rafael, internally the ServerSideWindowHandler
Re: MyFaces and CODI
Hi Gehard, i didnt got the ideia, do you have any example or a link showing this approach? what i have got til now is: 1 - WindowContextIdHolderComponent is a jsf component which is added dynamically to the view 2 - this component holds the windowId 3 - i have,somehow , to keep the windowId the same between requests so my ViewAccessScoped bean is keeped alive - here is where im stuck Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ - Mensagem original - De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Cc: Enviadas: Quinta-feira, 15 de Março de 2012 11:28 Assunto: Re: MyFaces and CODI hi rafael, @ WindowContextIdHolderComponent: that's the name of the class. you have to resolve the component (by type) before the view gets rendered and add it to the ajax enabled a4j components via the corresponding java-api. @ custom approach: independent of the concrete approach you would like to use, you just have to ensure that the information is available on the server-side (for every jsf request which starts the jsf request-lifecycle). regards, gerhard Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/15 Rafael Pestano rmpest...@yahoo.com.br Hi again, it will work with a4j as soon as you ensure that it gets restored for requests triggered by a4j you mean i should send WindowContextIdHolderComponent within the ajax request? somethink like a4j:support process=WindowContextIdHolderComponent/ ? if so whats the id of the generated component? i also have another question, in the javadoc of WindowContextConfig isUrlParameterSuported() says Specifies if it is allowed to use URL params for forwarding the current window-id. (deactivate it e.g. for higher security - in this case it's required to use a window id provided by a component lib or a server-side window-handler how can i create a component to handle the window id? can i do that with an h:inputHidden for example? thanks for the help. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Quinta-feira, 15 de Março de 2012 10:37 Assunto: Re: MyFaces and CODI hi rafael, the fallback adds a component (WindowContextIdHolderComponent) dynamically (as a direct child of UiViewRoot) - it will work with a4j as soon as you ensure that it gets restored for requests triggered by a4j. regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/15 Rafael Pestano rmpest...@yahoo.com.br well its not 100% yet ;(...on every ajaxCall my ViewAccessScoped bean is being instantiated, im using a4j, there is any known issue with it? for example h:selectOneMenu . a4j:support event=onchange action=when the action is called the bean constructor gets called/ /h:selectOneMenu if i change from View to RequestScoped the bahavior is the same, any ideas? thanks in advance. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ De: Rafael Pestano rmpest...@yahoo.com.br Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Quinta-feira, 15 de Março de 2012 8:45 Assunto: Re: MyFaces and CODI if you don't need redirects, you could have a look at e.g. [1] which uses an internal fallback. yea, its our case and it just works! many thanks for your help, keep the great work! Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Quarta-feira, 14 de Março de 2012 23:19 Assunto: Re: MyFaces and CODI hi rafael, as you have seen it's easy to provide a custom WindowHandler (just implement the interface and provide your implementation as alternative cdi bean) - you can integrate every custom approach which is enough to solve you requirements. if you don't need redirects, you could have a look
Re: MyFaces and CODI
Hi Gerhard, i successfuly added codi and openwebbeans to an application running on weblogic 11g however its a legacy application which uses frames, basicaly we have a menu on the left frame that targets the center frame, something like: h:commandLink value=menuLink action=#{myBean.init} target=frmDados / the problem is, when a add CODI to the application and mark myBean as ViewAccessScoped (and thus the windowId starts to be append to the url) the above menuLink always open the center frame in a new browser tab. If i remove CODI and set myBean as RequestScoped(or any other CDI Scope) the application behaves as expected. So i think the windowId generated by CODI is causing this issue, i tried your solution without success, the windowId isnt removed from the url and a new tab opens when i click in the menuLink. Any thoughs? thanks for all your help. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Sexta-feira, 9 de Março de 2012 12:38 Assunto: Re: MyFaces and CODI hi stephen, that's right [1] doesn't support it. werner committed his improvement and you can try [2] and [3] as you see them right now. regards, gerhard [1] http://old.nabble.com/-CODI--lazy-windowId-drop-script-p31654496.html [2] http://s.apache.org/rr [3] http://s.apache.org/23p http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/9 Stephen More stephen.m...@gmail.com I was referring to [1] http://old.nabble.com/-CODI--lazy-windowId-drop-script-p31654496.html I guess I just need to wait until the correct way is tested and documented in the wiki using: [1] http://s.apache.org/rr [2] http://s.apache.org/23p On Fri, Mar 9, 2012 at 9:20 AM, Gerhard Petracek gerhard.petra...@gmail.com wrote: @ mark: i just tested it and it works with [1] in combination with ClientSideWindowHandler [2]. regards, gerhard [1] http://s.apache.org/rr [2] http://s.apache.org/23p http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/9 Mark Struberg strub...@yahoo.de Hi Stephen! Well, the current approach in CODI is currently under discussion in the JSF EG. The whole windowId stuff of CODI might end up in the JSF-2.2 or 2.3 spec. T hat seems to work fine when pasting into a new empty window, but it still allows you to copy-paste the url from one codi window to an existing codi window. Nope, because the windowhandler.js script will first check the window.name. And if this is empty/doesn't fit the windowId in the URL, then it will reload the page with a freshly requested windowId. LieGrue, strub - Original Message - From: Stephen More stephen.m...@gmail.com To: MyFaces Discussion users@myfaces.apache.org Cc: Sent: Friday, March 9, 2012 1:27 PM Subject: Re: MyFaces and CODI Included in the JSF jar is META-INF/resources/javax.faces/jsf.js which enables its use by h:outputScript name=jsf.js library=javax.faces target=head/ Should windowhandler.js be moved from the examples into a core library so that it can be utilized the same way ? On Fri, Mar 9, 2012 at 7:10 AM, Gerhard Petracek gerhard.petra...@gmail.com wrote: hi stephen, yes - you can add a small js (see e.g. [1]) to support this use-case. regards, gerhard [1] http://s.apache.org/YTq http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/9 Stephen More stephen.m...@gmail.com Great. I am mainly interested in WindowScoped i.e. every browser tab has its own mini-session. I see that CODI is adding a ?windowId=595 to keep these conversations separate. If a user simply copies the url and pastes in a new tab now two browser tabs are sharing the same conversation. How can I prevent this ? I want to enforce that EVERY browser tab has its own conversation. Perhaps a simple error to the user saying Sorry or start a new conversation. -Thanks On Fri, Mar 9, 2012 at 3:18 AM, Gerhard Petracek gerhard.petra...@gmail.com wrote: hi stephen, (that's an issue with the setup of weld and not related to myfaces codi.) however, myfaces codi doesn't need this support - if you also don't need cdi support for servlets, filters or listeners, you can run the application
Re: MyFaces and CODI
i see, i have used the client side one alternatives classorg.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.ClientSideWindowHandler/class /alternatives i imagine the server side should be alternatives classorg.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.ServerSideWindowHandler/class /alternativesalright? i will test it tomorrow and give the feedback, thanks. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ - Mensagem original - De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Cc: Enviadas: Quarta-feira, 14 de Março de 2012 20:11 Assunto: Re: MyFaces and CODI hi rafael, the easiest approach to test an alternative for this constellation is the activation of the ServerSideWindowHandler (it's a std. cdi @Alternative implementation - you can activate it in the beans.xml file of your application). (however, please be aware that this alternative implementation has some disadvantages.) regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/14 Rafael Pestano rmpest...@yahoo.com.br Hi Gerhard, i successfuly added codi and openwebbeans to an application running on weblogic 11g however its a legacy application which uses frames, basicaly we have a menu on the left frame that targets the center frame, something like: h:commandLink value=menuLink action=#{myBean.init} target=frmDados / the problem is, when a add CODI to the application and mark myBean as ViewAccessScoped (and thus the windowId starts to be append to the url) the above menuLink always open the center frame in a new browser tab. If i remove CODI and set myBean as RequestScoped(or any other CDI Scope) the application behaves as expected. So i think the windowId generated by CODI is causing this issue, i tried your solution without success, the windowId isnt removed from the url and a new tab opens when i click in the menuLink. Any thoughs? thanks for all your help. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Sexta-feira, 9 de Março de 2012 12:38 Assunto: Re: MyFaces and CODI hi stephen, that's right [1] doesn't support it. werner committed his improvement and you can try [2] and [3] as you see them right now. regards, gerhard [1] http://old.nabble.com/-CODI--lazy-windowId-drop-script-p31654496.html [2] http://s.apache.org/rr [3] http://s.apache.org/23p http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/9 Stephen More stephen.m...@gmail.com I was referring to [1] http://old.nabble.com/-CODI--lazy-windowId-drop-script-p31654496.html I guess I just need to wait until the correct way is tested and documented in the wiki using: [1] http://s.apache.org/rr [2] http://s.apache.org/23p On Fri, Mar 9, 2012 at 9:20 AM, Gerhard Petracek gerhard.petra...@gmail.com wrote: @ mark: i just tested it and it works with [1] in combination with ClientSideWindowHandler [2]. regards, gerhard [1] http://s.apache.org/rr [2] http://s.apache.org/23p http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/9 Mark Struberg strub...@yahoo.de Hi Stephen! Well, the current approach in CODI is currently under discussion in the JSF EG. The whole windowId stuff of CODI might end up in the JSF-2.2 or 2.3 spec. T hat seems to work fine when pasting into a new empty window, but it still allows you to copy-paste the url from one codi window to an existing codi window. Nope, because the windowhandler.js script will first check the window.name. And if this is empty/doesn't fit the windowId in the URL, then it will reload the page with a freshly requested windowId. LieGrue, strub - Original Message - From: Stephen More stephen.m...@gmail.com To: MyFaces Discussion users@myfaces.apache.org Cc: Sent: Friday, March 9, 2012 1:27 PM Subject: Re: MyFaces and CODI Included in the JSF jar is META-INF/resources/javax.faces/jsf.js which enables its use by h:outputScript name=jsf.js library=javax.faces target=head/ Should windowhandler.js
Re: MyFaces and CODI
Hi Gehard, its a stopper to us cause we are still dependent on JSF 1.2 Can i implement an alternative to org.apache.myfaces.extensions.cdi.jsf2.impl.scope.conversation.ServerSideWindowHandler based on JSF 1.2? i see you use flash scope to span the windowId through requests in the server side solution: if (windowId != null) 79 { 80 externalContext.getRequestMap().put(WINDOW_CONTEXT_ID_PARAMETER_KEY, windowId); 81 externalContext.getFlash().keep(WINDOW_CONTEXT_ID_PARAMETER_KEY); 82 } if i put the windownId in the sessionMap it would still work? i think ill find hard time trying to remove the windowId from the map when user leave the page. thanks for your help i really appreciated it. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ - Mensagem original - De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Cc: Enviadas: Quarta-feira, 14 de Março de 2012 20:55 Assunto: Re: MyFaces and CODI hi rafael, internally the ServerSideWindowHandler is based on the flash scope (that's one of the mentioned disadvantages) - it's bound to jsf 2+ - it is: org.apache.myfaces.extensions.cdi.jsf2.impl.scope.conversation.ServerSideWindowHandler (and you can't use the additional js.) with some constellations you just hit the restrictions of browsers - you have to choose what you really need. regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/15 Rafael Pestano rmpest...@yahoo.com.br i see, i have used the client side one alternatives classorg.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.ClientSideWindowHandler/class /alternatives i imagine the server side should be alternatives classorg.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.ServerSideWindowHandler/class /alternativesalright? i will test it tomorrow and give the feedback, thanks. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ - Mensagem original - De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Cc: Enviadas: Quarta-feira, 14 de Março de 2012 20:11 Assunto: Re: MyFaces and CODI hi rafael, the easiest approach to test an alternative for this constellation is the activation of the ServerSideWindowHandler (it's a std. cdi @Alternative implementation - you can activate it in the beans.xml file of your application). (however, please be aware that this alternative implementation has some disadvantages.) regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/3/14 Rafael Pestano rmpest...@yahoo.com.br Hi Gerhard, i successfuly added codi and openwebbeans to an application running on weblogic 11g however its a legacy application which uses frames, basicaly we have a menu on the left frame that targets the center frame, something like: h:commandLink value=menuLink action=#{myBean.init} target=frmDados / the problem is, when a add CODI to the application and mark myBean as ViewAccessScoped (and thus the windowId starts to be append to the url) the above menuLink always open the center frame in a new browser tab. If i remove CODI and set myBean as RequestScoped(or any other CDI Scope) the application behaves as expected. So i think the windowId generated by CODI is causing this issue, i tried your solution without success, the windowId isnt removed from the url and a new tab opens when i click in the menuLink. Any thoughs? thanks for all your help. Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ De: Gerhard Petracek gerhard.petra...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Sexta-feira, 9 de Março de 2012 12:38 Assunto: Re: MyFaces and CODI hi stephen, that's right [1] doesn't support it. werner committed his improvement and you can try [2] and [3] as you see them right now. regards, gerhard [1] http://old.nabble.com/-CODI--lazy-windowId-drop-script-p31654496.html [2] http://s.apache.org/rr [3] http://s.apache.org/23p http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional
Re: Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations.
just a question, why do you have @Model,@Named and @ViewAccessScoped in the same bean? i think you need @model OR @Named and @ViewAccessScoped or im wrong? Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ - Mensagem original - De: José Luis Cetina maxtorz...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Cc: Enviadas: Terça-feira, 13 de Março de 2012 12:28 Assunto: Re: Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations. I see now im using MyFaces instead of Mojarra, the ERROR Message still there, but the application can deploy. My second problem persist: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'myBean' resolved to null viewId=/index.xhtml location=C:\Users\user\Documents\NetBeansProjects\testweb\build\web\index.xhtml phaseId=INVOKE_APPLICATION(5) i have the my beans.xml under WEB-INF folder: beans.xml: ?xml version=1.0 encoding=UTF-8? beans xmlns=http://java.sun.com/xml/ns/javaee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd; /beans And my bean its ok: @Named @ViewAccessScoped @Model @View(Index.class) public class MyBean implements Serializable{ } If i change from MyFaces to Mojarra this work ok!!! :( Somebody know what can i do? *Im using: Netbeans 7.1, Glassfish 3.1.2.1, JDK 7u3, MyFaces 2.1.6, CODI 1.0.4, Windows 7. * * * *Thanks.* * * *-* 2012/3/13 Werner Punz werner.p...@gmail.com Mhh this looks like a bug in Glassfish to me, the entries in the glassfish-web.xml look correct to me. Problem is generally that glassfish is not to keen on overrides of its system libs in my experience. Even while myfaces runs, try to replace Weld for instance and you run into a mess. Glassfish as good as it is is an all or nothing pack in many cases. But it has been some time since I last touched Glassfish, things might have changed. Werner Am 12.03.12 17:40, schrieb José Luis Cetina: Im triying to start a new project for first time with myfaces, i always used Mojarra but know i want to change but im having problems at the start: My only requierement is use Glassfish 3.1.2.1. Hi i have this WARNING: *Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations.* Why this happend if im using only jars from myfaces?? maybe for glassfish i think, i have these in my *glassfish-web.xml* file, under WEB-INF folder: ?xml version=1.0 encoding=UTF-8? !DOCTYPE glassfish-web-app PUBLIC -//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN http://glassfish.org/dtds/**glassfish-web-app_3_0-1.dtdhttp://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd glassfish-web-app error-url= !--Para establecer el charset a utf8 y remover el mensaje de: PWC4011: Unable to set request character encoding to UTF-8 from context-- parameter-encoding default-charset=UTF-8/ *class-loader delegate=false/* *property name=useBundledJsf value=true/* !--class-loader delegate=true/-- jsp-config property name=keepgenerated value=true descriptionKeep a copy of the generated servlet class' java code./description /property /jsp-config /glassfish-web-app This is my web.xml ?xml version=1.0 encoding=UTF-8? web-app version=3.0 xmlns=http://java.sun.com/**xml/ns/javaeehttp://java.sun.com/xml/ns/javaee xmlns:xsi= http://www.w3.org/2001/**XMLSchema-instancehttp://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation= http://java.sun.com/xml/ns/**javaee http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/**javaee/web-app_3_0.xsdhttp://java.sun.com/xml/ns/javaee/web-app_3_0.xsd context-param param-namejavax.faces.**PROJECT_STAGE/param-name param-valueDevelopment/**param-value /context-param context-param param-namecom.ocpsoft.**pretty.DEVELOPMENT/param-**name param-valuetrue/param-**value /context-param context-param param-namejavax.faces.STATE_**SAVING_METHOD/param-name param-valueserver/param-**value /context-param context-param param-name javax.faces.DATETIMECONVERTER_**DEFAULT_TIMEZONE_IS_SYSTEM_** TIMEZONE/param-name param-valuetrue/param-**value /context-param context-param param-namejavax.faces.**FACELETS_SKIP_COMMENTS/param-**name param-valuetrue/param-**value /context-param context-param param-namecom.sun.faces.**enableMissingResourceLibraryDe** tection/param-name
Re: Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations.
You can try to remove jsf-api.jar and jsf-impl.jar from glassfish, if your app still running you are using myfaces ;). RI jars are under GLASSFISH_HOME\glassfish\modules, also make sure to delete cache folder in GLASSFISH_HOME\glassfish\domains\domain1\osgi-cache Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ De: Mike Kienenberger mkien...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Segunda-feira, 12 de Março de 2012 14:17 Assunto: Re: Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations. You are correct in that it is a serious error. Having both jars in your path will result in identically-named, but differently-operating classes to be present in your application. You need to configure Glassfish to disable the RI, or you need to remove the myfaces jars. 2012/3/12 José Luis Cetina maxtorz...@gmail.com: Well sorry, really this says: ERROR Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations. Grave: Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations. 2012/3/12 Shasi Mitra shasimi...@yahoo.com It's just a warning rite? You can go ahead with your development. It doesn't affect anything. Sent from my iPhone On Mar 12, 2012, at 10:10 PM, José Luis Cetina maxtorz...@gmail.com wrote: Im triying to start a new project for first time with myfaces, i always used Mojarra but know i want to change but im having problems at the start: My only requierement is use Glassfish 3.1.2.1. Hi i have this WARNING: *Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations.* Why this happend if im using only jars from myfaces?? maybe for glassfish i think, i have these in my *glassfish-web.xml* file, under WEB-INF folder: ?xml version=1.0 encoding=UTF-8? !DOCTYPE glassfish-web-app PUBLIC -//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd;; glassfish-web-app error-url= !--Para establecer el charset a utf8 y remover el mensaje de: PWC4011: Unable to set request character encoding to UTF-8 from context-- parameter-encoding default-charset=UTF-8/ *class-loader delegate=false/* * property name=useBundledJsf value=true/* !--class-loader delegate=true/-- jsp-config property name=keepgenerated value=true descriptionKeep a copy of the generated servlet class' java code./description /property /jsp-config /glassfish-web-app This is my web.xml ?xml version=1.0 encoding=UTF-8? web-app version=3.0 xmlns=http://java.sun.com/xml/ns/javaee;; xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance;; xsi:schemaLocation= http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd;; context-param param-namejavax.faces.PROJECT_STAGE/param-name param-valueDevelopment/param-value /context-param context-param param-namecom.ocpsoft.pretty.DEVELOPMENT/param-name param-valuetrue/param-value /context-param context-param param-namejavax.faces.STATE_SAVING_METHOD/param-name param-valueserver/param-value /context-param context-param param-name javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE/param-name param-valuetrue/param-value /context-param context-param param-namejavax.faces.FACELETS_SKIP_COMMENTS/param-name param-valuetrue/param-value /context-param context-param param-namecom.sun.faces.enableMissingResourceLibraryDetection/param-name param-valuetrue/param-value /context-param listener * listener-classorg.apache.myfaces.webapp.StartupServletContextListener/listener-class * /listener servlet servlet-nameFaces Servlet/servlet-name servlet-classjavax.faces.webapp.FacesServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern/faces/*/url-pattern /servlet-mapping session-config session-timeout 30 /session-timeout /session-config welcome-file-list welcome-filefaces/index.xhtml/welcome-file /welcome-file-list /web-app Here are my libraries: --MYFACES myfaces-api-2.1.6.jar myfaces-impl-2.1.6.jar commons-beanutils-1.8.3.jar commons-digester-1.8.jar
Re: Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations.
i see, if you are using CODI it should be printing(at startup time) all information about your enviroment like JSF, CDI implementations, is that the case? what it is printing? Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ - Mensagem original - De: José Luis Cetina maxtorz...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org; Rafael Pestano rmpest...@yahoo.com.br Cc: Enviadas: Segunda-feira, 12 de Março de 2012 14:24 Assunto: Re: Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations. I cant do that , in the server exist other app that use mojarra :( and what happend with this: class-loader delegate=false/ property name=useBundledJsf value=true/ 2012/3/12 Rafael Pestano rmpest...@yahoo.com.br You can try to remove jsf-api.jar and jsf-impl.jar from glassfish, if your app still running you are using myfaces ;). RI jars are under GLASSFISH_HOME\glassfish\modules, also make sure to delete cache folder in GLASSFISH_HOME\glassfish\domains\domain1\osgi-cache Att, Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em Ciência da Computação UFRGS @realpestano http://code.google.com/p/jsf-conventions-framework/ De: Mike Kienenberger mkien...@gmail.com Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Segunda-feira, 12 de Março de 2012 14:17 Assunto: Re: Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations. You are correct in that it is a serious error. Having both jars in your path will result in identically-named, but differently-operating classes to be present in your application. You need to configure Glassfish to disable the RI, or you need to remove the myfaces jars. 2012/3/12 José Luis Cetina maxtorz...@gmail.com: Well sorry, really this says: ERROR Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations. Grave: Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations. 2012/3/12 Shasi Mitra shasimi...@yahoo.com It's just a warning rite? You can go ahead with your development. It doesn't affect anything. Sent from my iPhone On Mar 12, 2012, at 10:10 PM, José Luis Cetina maxtorz...@gmail.com wrote: Im triying to start a new project for first time with myfaces, i always used Mojarra but know i want to change but im having problems at the start: My only requierement is use Glassfish 3.1.2.1. Hi i have this WARNING: *Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations.* Why this happend if im using only jars from myfaces?? maybe for glassfish i think, i have these in my *glassfish-web.xml* file, under WEB-INF folder: ?xml version=1.0 encoding=UTF-8? !DOCTYPE glassfish-web-app PUBLIC -//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd;; glassfish-web-app error-url= !--Para establecer el charset a utf8 y remover el mensaje de: PWC4011: Unable to set request character encoding to UTF-8 from context-- parameter-encoding default-charset=UTF-8/ *class-loader delegate=false/* * property name=useBundledJsf value=true/* !--class-loader delegate=true/-- jsp-config property name=keepgenerated value=true descriptionKeep a copy of the generated servlet class' java code./description /property /jsp-config /glassfish-web-app This is my web.xml ?xml version=1.0 encoding=UTF-8? web-app version=3.0 xmlns=http://java.sun.com/xml/ns/javaee;; xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance;; xsi:schemaLocation= http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd;; context-param param-namejavax.faces.PROJECT_STAGE/param-name param-valueDevelopment/param-value /context-param context-param param-namecom.ocpsoft.pretty.DEVELOPMENT/param-name param-valuetrue/param-value /context-param context-param param-namejavax.faces.STATE_SAVING_METHOD/param-name param-valueserver/param-value /context-param context-param param-name javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE/param-name param-valuetrue/param-value /context-param context-param param-namejavax.faces.FACELETS_SKIP_COMMENTS/param-name param-valuetrue
Open WebBeans + Glassfish
Hello everyone, i'm trying to run OWB on glassfish maybe you have some hints, here is the post from glassfish forum: www.java.net/forum/topic/glassfish/glassfish/glassfish-open-web-beans thanks in advance. Rafael M. Pestano
CDI + MyFaces + Hibernate on Glassfish 3.1.1
Here is someone else having my problem: http://stackoverflow.com/questions/6853625/glassfish-3-1-1-cdi-classloader-delegate-false/8050805#8050805 I think its a bit different than yours cause i use hibernate as the guy in the post above, im creating another topic to separate the issues. De: Rafael Pestano rmpest...@yahoo.com.br Para: MyFaces Discussion users@myfaces.apache.org Enviadas: Segunda-feira, 7 de Novembro de 2011 9:07 Assunto: Re: CDI issue with MyFaces on Glassfish 3.1.1 Hi there, I'm also trying to do that(same steps) but i got another error while deploing my app: Exception while loading the app : org.jboss.weldx.transaction.org$jboss$weld$bean-WEB-INF$lib$myfaces-extcdi-bundle-jsf20-1$0$1-Built-in-UserTransaction_$$_WeldProxy cannot be cast to javassist.util.proxy.ProxyObject java.lang.ClassCastException: org.jboss.weldx.transaction.org$jboss$weld$bean-WEB-INF$lib$myfaces-extcdi-bundle-jsf20-1$0$1-Built-in-UserTransaction_$$_WeldProxy cannot be cast to javassist.util.proxy.ProxyObject at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:250) at org.jboss.weld.bean.builtin.ee.AbstractEEBean.init(AbstractEEBean.java:46) at org.jboss.weld.bean.builtin.ee.UserTransactionBean.init(UserTransactionBean.java:60) at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:199) at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:364) at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:170) at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:128) at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:262) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370) im using myfaces 2.1.3, CODI 1.0.1 Primefaces 3.0M4 and Glassfish 3.1.1(also tried in 3.1 and 3.1.2) dependency groupIdorg.apache.myfaces.core/groupId artifactIdmyfaces-api/artifactId version2.1.3/version /dependency dependency groupIdorg.apache.myfaces.core/groupId artifactIdmyfaces-impl/artifactId version2.1.3/version /dependency De: Vytautas Mackonis vytautas.macko...@gmail.com Para: users@myfaces.apache.org Enviadas: Domingo, 6 de Novembro de 2011 20:21 Assunto: CDI issue with MyFaces on Glassfish 3.1.1 Hi everyone, Ive been trying to override Mojarra with Myfaces on a Glassfish server. I managed to do it by: - adding a maven dependency: dependency groupIdorg.apache.myfaces.core/groupId artifactIdmyfaces-impl/artifactId version2.1.3/version /dependency - modifying glassfish-web.xml: glassfish-web-app error-url= context-root/TestApp-1.0-SNAPSHOT/context-root jsp-config property name=keepgenerated value=true descriptionKeep a copy of the generated servlet class' java code./description /property /jsp-config class-loader delegate=false/ property name=useBundledJsf value=true/ /glassfish-web-app After these steps the application deployed fine and from server logs i can tell that MyFaces are indeed used instead of Mojarra. However, the backing beans are not injected into views. I get the following error on form submit: org.apache.myfaces.view.facelets.el.ContextAwarePropertyNotFoundException: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'calculatorBean' resolved to null If I do the backing bean configuration in faces-config.xml instead of just tossing @Named @RequestScoped on the bean class then the following error does not occur. So I assume my problem is CDI related. Have I missed something in the initial setup of my web application to enable CDI? By the way, here is a full stack trace of the error: org.apache.myfaces.view.facelets.el.ContextAwarePropertyNotFoundException: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'calculatorBean' resolved to null at org.apache.myfaces.view.facelets.el.ContextAwareTagValueExpression.getType(ContextAwareTagValueExpression.java:77) at org.apache.myfaces.shared.renderkit._SharedRendererUtils.findUIOutputConverter(_SharedRendererUtils.java:77) at org.apache.myfaces.shared.renderkit.RendererUtils.findUIOutputConverter(RendererUtils.java:411) at org.apache.myfaces.shared.renderkit.RendererUtils.getConvertedUIOutputValue(RendererUtils.java:804) at org.apache.myfaces.shared.renderkit.html.HtmlTextRendererBase.getConvertedValue(HtmlTextRendererBase.java:311) at javax.faces.component.UIInput.getConvertedValue(UIInput.java:623) at javax.faces.component.UIInput.validate(UIInput.java:555
Re: CDI issue with MyFaces on Glassfish 3.1.1
Hi there, I'm also trying to do that(same steps) but i got another error while deploing my app: Exception while loading the app : org.jboss.weldx.transaction.org$jboss$weld$bean-WEB-INF$lib$myfaces-extcdi-bundle-jsf20-1$0$1-Built-in-UserTransaction_$$_WeldProxy cannot be cast to javassist.util.proxy.ProxyObject java.lang.ClassCastException: org.jboss.weldx.transaction.org$jboss$weld$bean-WEB-INF$lib$myfaces-extcdi-bundle-jsf20-1$0$1-Built-in-UserTransaction_$$_WeldProxy cannot be cast to javassist.util.proxy.ProxyObject at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:250) at org.jboss.weld.bean.builtin.ee.AbstractEEBean.init(AbstractEEBean.java:46) at org.jboss.weld.bean.builtin.ee.UserTransactionBean.init(UserTransactionBean.java:60) at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:199) at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:364) at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:170) at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:128) at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:262) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370) im using myfaces 2.1.3, CODI 1.0.1 Primefaces 3.0M4 and Glassfish 3.1.1(also tried in 3.1 and 3.1.2) dependency groupIdorg.apache.myfaces.core/groupId artifactIdmyfaces-api/artifactId version2.1.3/version /dependency dependency groupIdorg.apache.myfaces.core/groupId artifactIdmyfaces-impl/artifactId version2.1.3/version /dependency De: Vytautas Mackonis vytautas.macko...@gmail.com Para: users@myfaces.apache.org Enviadas: Domingo, 6 de Novembro de 2011 20:21 Assunto: CDI issue with MyFaces on Glassfish 3.1.1 Hi everyone, Ive been trying to override Mojarra with Myfaces on a Glassfish server. I managed to do it by: - adding a maven dependency: dependency groupIdorg.apache.myfaces.core/groupId artifactIdmyfaces-impl/artifactId version2.1.3/version /dependency - modifying glassfish-web.xml: glassfish-web-app error-url= context-root/TestApp-1.0-SNAPSHOT/context-root jsp-config property name=keepgenerated value=true descriptionKeep a copy of the generated servlet class' java code./description /property /jsp-config class-loader delegate=false/ property name=useBundledJsf value=true/ /glassfish-web-app After these steps the application deployed fine and from server logs i can tell that MyFaces are indeed used instead of Mojarra. However, the backing beans are not injected into views. I get the following error on form submit: org.apache.myfaces.view.facelets.el.ContextAwarePropertyNotFoundException: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'calculatorBean' resolved to null If I do the backing bean configuration in faces-config.xml instead of just tossing @Named @RequestScoped on the bean class then the following error does not occur. So I assume my problem is CDI related. Have I missed something in the initial setup of my web application to enable CDI? By the way, here is a full stack trace of the error: org.apache.myfaces.view.facelets.el.ContextAwarePropertyNotFoundException: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'calculatorBean' resolved to null at org.apache.myfaces.view.facelets.el.ContextAwareTagValueExpression.getType(ContextAwareTagValueExpression.java:77) at org.apache.myfaces.shared.renderkit._SharedRendererUtils.findUIOutputConverter(_SharedRendererUtils.java:77) at org.apache.myfaces.shared.renderkit.RendererUtils.findUIOutputConverter(RendererUtils.java:411) at org.apache.myfaces.shared.renderkit.RendererUtils.getConvertedUIOutputValue(RendererUtils.java:804) at org.apache.myfaces.shared.renderkit.html.HtmlTextRendererBase.getConvertedValue(HtmlTextRendererBase.java:311) at javax.faces.component.UIInput.getConvertedValue(UIInput.java:623) at javax.faces.component.UIInput.validate(UIInput.java:555) at javax.faces.component.UIInput.processValidators(UIInput.java:246) at javax.faces.component.UIForm.processValidators(UIForm.java:168) at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1238) at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1238) at javax.faces.component.UIViewRoot._processValidatorsDefault(UIViewRoot.java:1330) at javax.faces.component.UIViewRoot.access$500(UIViewRoot.java:75) at