Re: MyFaces and CODI

2012-03-18 Thread Mark Struberg
 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 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
  

Re: MyFaces and CODI

2012-03-18 Thread Mark Struberg


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 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
    

Re: MyFaces and CODI

2012-03-18 Thread Gerhard Petracek
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 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 

Re: MyFaces and CODI

2012-03-18 Thread Rafael Pestano
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)
        at 
com.sun.faces.config.GlassFishConfigureListener.contextInitialized(GlassFishConfigureListener.java:47)
        at 
weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
        at 
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at 
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
        at 
weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
        at 
weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1801)
        at 
weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3045)
        at 
weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1397)
        at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:460)
        at 
weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
        at 
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
        at 
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
        at 
weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
        at 
weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
        at 
weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
        at 
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
        at 
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
        at 
weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
        at 
weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:1267)
        at 
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
        at 
weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:409)
        at 
weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:39)
        at 
weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
        at 

Re: MyFaces and CODI

2012-03-18 Thread Mark Struberg
Oops, overlooked that.

In that case I'd say the following things might get checked.

a.) If you get an AJAX request, does the windowId get propagated properly?
Does a CODI @WindowScoped bean show the correct context, or do you loose it 
with each request?

 - windowId gets lost somewhere

b.) If the WindowScoped bean works, then I'd look if the view might gets 
ditched or wrongly touched due to the additional handling in a4j.
You could set a breakpoint in 
ViewAccessConversationExpirationEvaluator#isExpored() to see whether/when the 
bean gets ditched.

LieGrue,
strub


- Original Message -
 From: Gerhard Petracek gerhard.petra...@gmail.com
 To: MyFaces Discussion users@myfaces.apache.org
 Cc: 
 Sent: Sunday, March 18, 2012 8:47 PM
 Subject: 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 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
 

Re: MyFaces and CODI

2012-03-18 Thread Mark Struberg
Hi Rafael!

Please try to set a breakpoint in 


GroupedConversationContextExtension#afterBeanDiscovery()

The new contexts get added via the AfterBeanDiscovery events addContext() 
method.

If this doesn't get invoked, then the Extension detection probably doesn't work.


LieGrue,
strub



- Original Message -
 From: Rafael Pestano rmpest...@yahoo.com.br
 To: MyFaces Discussion users@myfaces.apache.org
 Cc: 
 Sent: Sunday, March 18, 2012 9:20 PM
 Subject: Re: MyFaces and CODI
 
 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)
         at 
 com.sun.faces.config.GlassFishConfigureListener.contextInitialized(GlassFishConfigureListener.java:47)
         at 
 weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
         at 
 weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at 
 weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at 
 weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
         at 
 weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1801)
         at 
 weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3045)
         at 
 weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1397)
         at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:460)
         at 
 weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
         at 
 weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
         at 
 weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
         at 
 weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
         at 
 weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
         at 
 weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
         at 
 weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
         at 
 weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
         at 
 

Re: MyFaces and CODI

2012-03-18 Thread Gerhard Petracek
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)
 at
 com.sun.faces.config.GlassFishConfigureListener.contextInitialized(GlassFishConfigureListener.java:47)
 at
 weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
 at
 weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
 at
 weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
 at
 weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
 at
 weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1801)
 at
 weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3045)
 at
 weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1397)
 at
 weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:460)
 at
 weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
 at
 weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
 at
 weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
 at
 weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
 at
 weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
 at
 weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
 at
 weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
 at
 weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
 at
 weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
 at
 weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:1267)
 at
 weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)