You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Gerald Turner <gt...@unzane.com> on 2012/12/04 20:40:38 UTC

Bug EXTVAL-130?

Hello, I'm in the process of converting a JSF2/CDI application from
Seam3 to MyFaces ExtCDI/CODI.  The application had been using MyFaces
ExtVal-BV so that JSR-303 cross-field validation would work in the
front-end.  Simply replacing Seam3 with CODI evoked the following
stacktrace during the first page view (during MyFaces EXT* lazy init),
and ExtVal-BV doesn't seem to be working entirely (annotations like
@DateIs work, but my ConstraintValidators aren't being executed).
Things actually get worse than that, some injection points no longer
work, particularly on an abstract superclass - but I figure I should
solve this warning before exploring that issue.  Also injection in
FacesConverter and ConstraintValidators (when triggered by JPA) don't
work even after annotating with @Advanced - again, probably a secondary
effect.  Also yet another tangent - I've heard that CODI and Seam3 can
be deployed together, but under JBoss 7.1.1.Final the app doesn't deploy
due to Weld errors with ambiguous producers - I haven't found any
documentation that describes any Veto-esque configuration.

This looks exactly like JIRA issue EXTVAL-130, only I'm using JBoss
7.1.1.Final instead of Glassfish, but they both share Weld, and I am
using ExtVal 2.0.6, which is the fixed version.

Relevant parts of my pom.xml:

    <!-- CDI & MyFaces ExtCDI/CODI -->
    <dependency>
      <groupId>javax.enterprise</groupId>
      <artifactId>cdi-api</artifactId>
      <version>1.0-SP4</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.myfaces.extensions.cdi.bundles</groupId>
      <artifactId>myfaces-extcdi-bundle-jsf20</artifactId>
      <version>1.0.5</version>
    </dependency>

    <!-- MyFaces ExtVal -->
    <dependency>
      <groupId>org.apache.myfaces.extensions.validator.validation-modules</groupId>
      <artifactId>myfaces-extval-property-validation</artifactId>
      <version>2.0.6</version>
      <exclusions>
        <exclusion>
          <groupId>javax.persistence</groupId>
          <artifactId>persistence-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.myfaces.extensions.validator.validation-modules</groupId>
      <artifactId>myfaces-extval-bean-validation</artifactId>
      <version>2.0.6</version>
      <exclusions>
        <exclusion>
          <groupId>javax.validation</groupId>
          <artifactId>validation-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

Some bits of the CODI startup version output (need to see the booleans
too?):

  10:56:32,600 INFO [org.apache.myfaces.extensions.cdi.jsf2.impl.Jsf2ModuleStartupObserver] (http--0.0.0.0-8080-1) [Started] MyFaces CODI JSF-Module v1.0.5 for JSF 2.0 Used JSF implementation: Mojarra vnull

  10:56:32,611 INFO [org.apache.myfaces.extensions.cdi.jpa.impl.JpaModuleStartupObserver] (http--0.0.0.0-8080-1) [Started] MyFaces CODI JPA-Module v1.0.5

  10:56:32,620 INFO [org.apache.myfaces.extensions.cdi.core.impl.CoreStartupObserver] (http--0.0.0.0-8080-1) [Started] MyFaces CODI (Extensions CDI) Core v1.0.5 Used CDI implementation: Weld v2012-02-10 15:31

The stacktrace:

  10:56:33,838 WARNING [org.apache.myfaces.extensions.validator.beanval.ValidatorFactoryProxy] (http--0.0.0.0-8080-1) failed to lookup a bean with the name contextAwareValidatorFactory: java.lang.IllegalStateException: No CreationalContext registered for EL evaluation, it is likely that the the expression factory has not been wrapped by the CDI BeanManager, which must be done to use the ELResolver from CDI
    at org.jboss.weld.el.AbstractWeldELResolver.getELCreationalContext(AbstractWeldELResolver.java:148) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.el.AbstractWeldELResolver.lookup(AbstractWeldELResolver.java:123) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.el.AbstractWeldELResolver.getValue(AbstractWeldELResolver.java:96) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.as.weld.webtier.jsf.ForwardingELResolver.getValue(ForwardingELResolver.java:46) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]
    at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:175) [jboss-el-api_2.2_spec-1.0.0.Final.jar:1.0.0.Final]
    at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at org.apache.myfaces.extensions.validator.core.el.DefaultELHelper.getBean(DefaultELHelper.java:79) [myfaces-extval-core-2.0.6.jar:2.0.6]
    at org.apache.myfaces.extensions.validator.beanval.ValidatorFactoryProxy.getValidatorFactory(ValidatorFactoryProxy.java:58) [myfaces-extval-bean-validation-2.0.6.jar:2.0.6]
    at org.apache.myfaces.extensions.validator.beanval.ValidatorFactoryProxy.getValidator(ValidatorFactoryProxy.java:86) [myfaces-extval-bean-validation-2.0.6.jar:2.0.6]
    at org.apache.myfaces.extensions.validator.beanval.util.BeanValidationUtils.getElementDescriptor(BeanValidationUtils.java:108) [myfaces-extval-bean-validation-2.0.6.jar:2.0.6]
    at org.apache.myfaces.extensions.validator.beanval.BeanValidationModuleValidationInterceptorInternals.initComponentWithPropertyDetails(BeanValidationModuleValidationInterceptorInternals.java:104) [myfaces-extval-bean-validation-2.0.6.jar:2.0.6]
    at org.apache.myfaces.extensions.validator.beanval.BeanValidationModuleValidationInterceptor.initComponentWithPropertyDetails(BeanValidationModuleValidationInterceptor.java:70) [myfaces-extval-bean-validation-2.0.6.jar:2.0.6]
    at org.apache.myfaces.extensions.validator.beanval.BeanValidationModuleValidationInterceptor.initComponent(BeanValidationModuleValidationInterceptor.java:60) [myfaces-extval-bean-validation-2.0.6.jar:2.0.6]
    at org.apache.myfaces.extensions.validator.core.interceptor.AbstractValidationInterceptor.beforeEncodeBegin(AbstractValidationInterceptor.java:112) [myfaces-extval-core-2.0.6.jar:2.0.6]
    at org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeBegin(ExtValRendererWrapper.java:183) [myfaces-extval-core-2.0.6.jar:2.0.6]
    at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:820) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:302) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:185) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:129) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at org.apache.myfaces.extensions.validator.core.renderkit.ExtValLazyRendererProxy.encodeChildren(ExtValLazyRendererProxy.java:70) [myfaces-extval-core-2.0.6.jar:2.0.6]
    at org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeChildren(ExtValRendererWrapper.java:286) [myfaces-extval-core-2.0.6.jar:2.0.6]
    at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at javax.faces.rinal.jar:]
    at org.jboss.as.jpa.interceptor.WebNonTxEmCl

-- 
Gerald Turner   Email: gturner@unzane.com   JID: gturner@unzane.com
GPG: 0xFA8CD6D5  21D9 B2E8 7FE7 F19E 5F7D  4D0C 3FA0 810F FA8C D6D5

Re: Bug EXTVAL-130?

Posted by Gerhard Petracek <ge...@gmail.com>.
hi gerald,

@ veto:
ClassDeactivator is just for classes which are listed in config files of
cdi, jsf,... (and the specs. don't provide a possibility to disable them).
in your case you just need the std. ProcessAnnotatedType#veto provided by
cdi itself.

@ BeanValidation#modelValidation

i wrote both (the annotation as well as the add-on) -> i'm happy if you can
use one of both.
however, please note that they work differently.
the add-on triggers class-level validation (for special classes) at the end
of the validation-phase of the request-lifecycle and
BeanValidation#modelValidation is just the integration of class-level
validation which gets triggered at the end of the update-model-values
phase.

@ snapshot repository:
see [1]

regards,
gerhard

[1] https://repository.apache.org/content/groups/snapshots

http://www.irian.at

Your JSF/JavaEE powerhouse -
JavaEE Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces



2012/12/5 Gerald Turner <gt...@unzane.com>

> Hi Gerhard, thanks for the response!
>
>
> Gerhard Petracek <ge...@gmail.com> writes:
>
> > @codi + seam
> > yes - that's possible.
> > it depends on what you are using from both.
> > e.g. in case of the jsf-module of codi + seam-faces you have to veto
> > one of the producers for the FacesContext.
>
> Exactly, jsf/faces modules from both.  Is vetoing done with
> ClassDeactivator and writing a service-loader file?
>
> > @ "No CreationalContext registered for EL evaluation, it is likely
> > that the the expression factory has not been wrapped by the CDI
> > BeanManager, which must be done to use the ELResolver from CDI":
> >
> > ... sounds like an as7 issue. it occurs during the rendering process
> > (see e.g. UIComponentBase#encodeBegin) -> as7 has to ensure that all
> > parts of cdi and jsf are up and running.
>
> I spent some time digging around the issue going on a tip from JIRA
> issue EXTVAL-140 (thanks Igor Guimaraes) - looks like it's a Weld bug.
> Weld ELResolver#getValue implementation will fail unless it's nested in
> a stack evaluating a Weld ValueExpression or MethodExpression.  OTOH,
> ValueExpression#getValue works every time.  Even stranger is that when I
> revert the project from CODI to Seam3, Weld ELResolver#getValue will
> return nulls instead of throwing an exception.  Attached is a dummy
> RENDER_RESPONSE PhaseListener that exhibits the bug (all the
> "tryELResolver" tests fail while all the "tryValueExpression" tests
> succeed).  I'll work on reporting this to Weld.  Is there any chance a
> work-around could be added to ExtVal 2.0.7-SNAPSHOT? (i.e. using a
> ValueExpression instead of ELResolver for BV startup)
>
> > @enabling injection via @Advanced:
> > the only known (and already fixed) issue is [1].
>
> Is there a public maven repository where I can link 1.0.6-SNAPSHOT?
>
> > just fyi (since you wrote "JSR-303 cross-field validation").
> > annotations like @DateIs were introduced before the bv-spec. was
> > released and don't use the bv-api at all (that's the reason why they
> > are in a different validation module).
> > you would need e.g. [2] to use the bv-api with a thin layer to allow
> > bv based cross-field validation.
>
> I was wrong about my original statement that cross-field validation
> wasn't working (whereas @DateIs was working)… they're both working.
>
> I had this question on the mailing list in March and you pointed me at
> the extension then too.  I didn't have to use the extension you wrote.
> I'm using the following ExtVal-BV annotation on the fields of a CDI bean
> that I want cross-validation:
>   @BeanValidation(modelValidation=@ModelValidation(isActive=true))
> …this has been working great - am I missing something?
>
> --
> Gerald Turner   Email: gturner@unzane.com   JID: gturner@unzane.com
> GPG: 0xFA8CD6D5  21D9 B2E8 7FE7 F19E 5F7D  4D0C 3FA0 810F FA8C D6D5
>

Re: Bug EXTVAL-130?

Posted by Gerald Turner <gt...@unzane.com>.
Hi Gerhard, thanks for the response!


Gerhard Petracek <ge...@gmail.com> writes:

> @codi + seam
> yes - that's possible.
> it depends on what you are using from both.
> e.g. in case of the jsf-module of codi + seam-faces you have to veto
> one of the producers for the FacesContext.

Exactly, jsf/faces modules from both.  Is vetoing done with
ClassDeactivator and writing a service-loader file?

> @ "No CreationalContext registered for EL evaluation, it is likely
> that the the expression factory has not been wrapped by the CDI
> BeanManager, which must be done to use the ELResolver from CDI":
>
> ... sounds like an as7 issue. it occurs during the rendering process
> (see e.g. UIComponentBase#encodeBegin) -> as7 has to ensure that all
> parts of cdi and jsf are up and running.

I spent some time digging around the issue going on a tip from JIRA
issue EXTVAL-140 (thanks Igor Guimaraes) - looks like it's a Weld bug.
Weld ELResolver#getValue implementation will fail unless it's nested in
a stack evaluating a Weld ValueExpression or MethodExpression.  OTOH,
ValueExpression#getValue works every time.  Even stranger is that when I
revert the project from CODI to Seam3, Weld ELResolver#getValue will
return nulls instead of throwing an exception.  Attached is a dummy
RENDER_RESPONSE PhaseListener that exhibits the bug (all the
"tryELResolver" tests fail while all the "tryValueExpression" tests
succeed).  I'll work on reporting this to Weld.  Is there any chance a
work-around could be added to ExtVal 2.0.7-SNAPSHOT? (i.e. using a
ValueExpression instead of ELResolver for BV startup)

> @enabling injection via @Advanced:
> the only known (and already fixed) issue is [1].

Is there a public maven repository where I can link 1.0.6-SNAPSHOT?

> just fyi (since you wrote "JSR-303 cross-field validation").
> annotations like @DateIs were introduced before the bv-spec. was
> released and don't use the bv-api at all (that's the reason why they
> are in a different validation module).
> you would need e.g. [2] to use the bv-api with a thin layer to allow
> bv based cross-field validation.

I was wrong about my original statement that cross-field validation
wasn't working (whereas @DateIs was working)… they're both working.

I had this question on the mailing list in March and you pointed me at
the extension then too.  I didn't have to use the extension you wrote.
I'm using the following ExtVal-BV annotation on the fields of a CDI bean
that I want cross-validation:
  @BeanValidation(modelValidation=@ModelValidation(isActive=true))
…this has been working great - am I missing something?

--
Gerald Turner   Email: gturner@unzane.com   JID: gturner@unzane.com
GPG: 0xFA8CD6D5  21D9 B2E8 7FE7 F19E 5F7D  4D0C 3FA0 810F FA8C D6D5

Re: Bug EXTVAL-130?

Posted by Gerhard Petracek <ge...@gmail.com>.
hi gerald,

@codi + seam
yes - that's possible.
it depends on what you are using from both.
e.g. in case of the jsf-module of codi + seam-faces you have to veto one of
the producers for the FacesContext.

@ "No CreationalContext registered for EL evaluation, it is likely that the
the expression factory has not been wrapped by the CDI BeanManager, which
must be done to use the ELResolver from CDI":

... sounds like an as7 issue. it occurs during the rendering process (see
e.g. UIComponentBase#encodeBegin) -> as7 has to ensure that all parts of
cdi and jsf are up and running.

@enabling injection via @Advanced:
the only known (and already fixed) issue is [1].

just fyi (since you wrote "JSR-303 cross-field validation").
annotations like @DateIs were introduced before the bv-spec. was released
and don't use the bv-api at all (that's the reason why they are in a
different validation module).
you would need e.g. [2] to use the bv-api with a thin layer to allow bv
based cross-field validation.

regards,
gerhard

[1] https://issues.apache.org/jira/browse/EXTCDI-302
[2]
http://os890.blogspot.co.at/2010/06/multi-field-form-validation-with-jsr.html

http://www.irian.at

Your JSF/JavaEE powerhouse -
JavaEE Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces



2012/12/4 Gerald Turner <gt...@unzane.com>

> Hello, I'm in the process of converting a JSF2/CDI application from
> Seam3 to MyFaces ExtCDI/CODI.  The application had been using MyFaces
> ExtVal-BV so that JSR-303 cross-field validation would work in the
> front-end.  Simply replacing Seam3 with CODI evoked the following
> stacktrace during the first page view (during MyFaces EXT* lazy init),
> and ExtVal-BV doesn't seem to be working entirely (annotations like
> @DateIs work, but my ConstraintValidators aren't being executed).
> Things actually get worse than that, some injection points no longer
> work, particularly on an abstract superclass - but I figure I should
> solve this warning before exploring that issue.  Also injection in
> FacesConverter and ConstraintValidators (when triggered by JPA) don't
> work even after annotating with @Advanced - again, probably a secondary
> effect.  Also yet another tangent - I've heard that CODI and Seam3 can
> be deployed together, but under JBoss 7.1.1.Final the app doesn't deploy
> due to Weld errors with ambiguous producers - I haven't found any
> documentation that describes any Veto-esque configuration.
>
> This looks exactly like JIRA issue EXTVAL-130, only I'm using JBoss
> 7.1.1.Final instead of Glassfish, but they both share Weld, and I am
> using ExtVal 2.0.6, which is the fixed version.
>
> Relevant parts of my pom.xml:
>
>     <!-- CDI & MyFaces ExtCDI/CODI -->
>     <dependency>
>       <groupId>javax.enterprise</groupId>
>       <artifactId>cdi-api</artifactId>
>       <version>1.0-SP4</version>
>       <scope>provided</scope>
>     </dependency>
>     <dependency>
>       <groupId>org.apache.myfaces.extensions.cdi.bundles</groupId>
>       <artifactId>myfaces-extcdi-bundle-jsf20</artifactId>
>       <version>1.0.5</version>
>     </dependency>
>
>     <!-- MyFaces ExtVal -->
>     <dependency>
>
> <groupId>org.apache.myfaces.extensions.validator.validation-modules</groupId>
>       <artifactId>myfaces-extval-property-validation</artifactId>
>       <version>2.0.6</version>
>       <exclusions>
>         <exclusion>
>           <groupId>javax.persistence</groupId>
>           <artifactId>persistence-api</artifactId>
>         </exclusion>
>       </exclusions>
>     </dependency>
>     <dependency>
>
> <groupId>org.apache.myfaces.extensions.validator.validation-modules</groupId>
>       <artifactId>myfaces-extval-bean-validation</artifactId>
>       <version>2.0.6</version>
>       <exclusions>
>         <exclusion>
>           <groupId>javax.validation</groupId>
>           <artifactId>validation-api</artifactId>
>         </exclusion>
>       </exclusions>
>     </dependency>
>
> Some bits of the CODI startup version output (need to see the booleans
> too?):
>
>   10:56:32,600 INFO
> [org.apache.myfaces.extensions.cdi.jsf2.impl.Jsf2ModuleStartupObserver]
> (http--0.0.0.0-8080-1) [Started] MyFaces CODI JSF-Module v1.0.5 for JSF 2.0
> Used JSF implementation: Mojarra vnull
>
>   10:56:32,611 INFO
> [org.apache.myfaces.extensions.cdi.jpa.impl.JpaModuleStartupObserver]
> (http--0.0.0.0-8080-1) [Started] MyFaces CODI JPA-Module v1.0.5
>
>   10:56:32,620 INFO
> [org.apache.myfaces.extensions.cdi.core.impl.CoreStartupObserver]
> (http--0.0.0.0-8080-1) [Started] MyFaces CODI (Extensions CDI) Core v1.0.5
> Used CDI implementation: Weld v2012-02-10 15:31
>
> The stacktrace:
>
>   10:56:33,838 WARNING
> [org.apache.myfaces.extensions.validator.beanval.ValidatorFactoryProxy]
> (http--0.0.0.0-8080-1) failed to lookup a bean with the name
> contextAwareValidatorFactory: java.lang.IllegalStateException: No
> CreationalContext registered for EL evaluation, it is likely that the the
> expression factory has not been wrapped by the CDI BeanManager, which must
> be done to use the ELResolver from CDI
>     at
> org.jboss.weld.el.AbstractWeldELResolver.getELCreationalContext(AbstractWeldELResolver.java:148)
> [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
>     at
> org.jboss.weld.el.AbstractWeldELResolver.lookup(AbstractWeldELResolver.java:123)
> [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
>     at
> org.jboss.weld.el.AbstractWeldELResolver.getValue(AbstractWeldELResolver.java:96)
> [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
>     at
> org.jboss.as.weld.webtier.jsf.ForwardingELResolver.getValue(ForwardingELResolver.java:46)
> [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]
>     at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:175)
> [jboss-el-api_2.2_spec-1.0.0.Final.jar:1.0.0.Final]
>     at
> com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
> [jsf-impl-2.1.7-jbossorg-2.jar:]
>     at
> com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
> [jsf-impl-2.1.7-jbossorg-2.jar:]
>     at
> org.apache.myfaces.extensions.validator.core.el.DefaultELHelper.getBean(DefaultELHelper.java:79)
> [myfaces-extval-core-2.0.6.jar:2.0.6]
>     at
> org.apache.myfaces.extensions.validator.beanval.ValidatorFactoryProxy.getValidatorFactory(ValidatorFactoryProxy.java:58)
> [myfaces-extval-bean-validation-2.0.6.jar:2.0.6]
>     at
> org.apache.myfaces.extensions.validator.beanval.ValidatorFactoryProxy.getValidator(ValidatorFactoryProxy.java:86)
> [myfaces-extval-bean-validation-2.0.6.jar:2.0.6]
>     at
> org.apache.myfaces.extensions.validator.beanval.util.BeanValidationUtils.getElementDescriptor(BeanValidationUtils.java:108)
> [myfaces-extval-bean-validation-2.0.6.jar:2.0.6]
>     at
> org.apache.myfaces.extensions.validator.beanval.BeanValidationModuleValidationInterceptorInternals.initComponentWithPropertyDetails(BeanValidationModuleValidationInterceptorInternals.java:104)
> [myfaces-extval-bean-validation-2.0.6.jar:2.0.6]
>     at
> org.apache.myfaces.extensions.validator.beanval.BeanValidationModuleValidationInterceptor.initComponentWithPropertyDetails(BeanValidationModuleValidationInterceptor.java:70)
> [myfaces-extval-bean-validation-2.0.6.jar:2.0.6]
>     at
> org.apache.myfaces.extensions.validator.beanval.BeanValidationModuleValidationInterceptor.initComponent(BeanValidationModuleValidationInterceptor.java:60)
> [myfaces-extval-bean-validation-2.0.6.jar:2.0.6]
>     at
> org.apache.myfaces.extensions.validator.core.interceptor.AbstractValidationInterceptor.beforeEncodeBegin(AbstractValidationInterceptor.java:112)
> [myfaces-extval-core-2.0.6.jar:2.0.6]
>     at
> org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeBegin(ExtValRendererWrapper.java:183)
> [myfaces-extval-core-2.0.6.jar:2.0.6]
>     at
> javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:820)
> [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
>     at
> com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:302)
> [jsf-impl-2.1.7-jbossorg-2.jar:]
>     at
> com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:185)
> [jsf-impl-2.1.7-jbossorg-2.jar:]
>     at
> com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:129)
> [jsf-impl-2.1.7-jbossorg-2.jar:]
>     at
> org.apache.myfaces.extensions.validator.core.renderkit.ExtValLazyRendererProxy.encodeChildren(ExtValLazyRendererProxy.java:70)
> [myfaces-extval-core-2.0.6.jar:2.0.6]
>     at
> org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeChildren(ExtValRendererWrapper.java:286)
> [myfaces-extval-core-2.0.6.jar:2.0.6]
>     at
> javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
> [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
>     at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779)
> [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
>     at javax.faces.rinal.jar:]
>     at org.jboss.as.jpa.interceptor.WebNonTxEmCl
>
> --
> Gerald Turner   Email: gturner@unzane.com   JID: gturner@unzane.com
> GPG: 0xFA8CD6D5  21D9 B2E8 7FE7 F19E 5F7D  4D0C 3FA0 810F FA8C D6D5
>

Re: Bug EXTVAL-130?

Posted by Gerhard Petracek <ge...@gmail.com>.
hi howard,

please ensure that you are using the current snapshot from [1].

if you still have issues, please provide a link to a simple demo.
(maybe you are facing an issue which affects codi but which isn't an issue
of codi itself.)

regards,
gerhard

[1] https://repository.apache.org/content/groups/snapshots

http://www.irian.at

Your JSF/JavaEE powerhouse -
JavaEE Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces



2012/12/5 Howard W. Smith, Jr. <sm...@gmail.com>

> I love and use forClass="...". Please take a look at [1] below, when you
> get a chance to see all the chatter/discussion I had related to this topic.
> Sometime after  this topic, I tried 'again' to use @Advanced and still
> didn't work. That is why I went with JSF @RequestScopedBeans that contain
> 'only' @FacesConverter forClass=...
>
>
> [1] Migrating to CDI: injecting stateless/facade in Converter via
> facescontext<
> http://openejb.979440.n4.nabble.com/Migrating-to-CDI-injecting-stateless-facade-in-Converter-via-facescontext-td4658693.html
> >
>
>
>
> On Tue, Dec 4, 2012 at 10:51 PM, Gerald Turner <gt...@unzane.com> wrote:
>
> > "Howard W. Smith, Jr." <sm...@gmail.com> writes:
> >
> > > I can confirm the same about CODI @Advanced not working in/with JSF
> > > @FacesConverter. My workaround (in a TomEE/CDI/MyFaces-CODI project)
> > > was to only add the @FacesConverter to JSF @RequestScoped managed
> > > beans, and they are working great in/with TomEE 1.5.1 SNAPSHOT.
> >
> > Thanks Howard, I'll probably go with that approach after more time
> > experimenting with @Advanced.
> >
> > Do you get to use the 'forClass' annotation attribute of
> > @FacesConverter, or do you have to link them by name (I forget the
> > mechanism, been spoiled by 'forClass').
> >
> > --
> > Gerald Turner   Email: gturner@unzane.com   JID: gturner@unzane.com
> > GPG: 0xFA8CD6D5  21D9 B2E8 7FE7 F19E 5F7D  4D0C 3FA0 810F FA8C D6D5
> >
>

Re: Bug EXTVAL-130?

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
I love and use forClass="...". Please take a look at [1] below, when you
get a chance to see all the chatter/discussion I had related to this topic.
Sometime after  this topic, I tried 'again' to use @Advanced and still
didn't work. That is why I went with JSF @RequestScopedBeans that contain
'only' @FacesConverter forClass=...


[1] Migrating to CDI: injecting stateless/facade in Converter via
facescontext<http://openejb.979440.n4.nabble.com/Migrating-to-CDI-injecting-stateless-facade-in-Converter-via-facescontext-td4658693.html>



On Tue, Dec 4, 2012 at 10:51 PM, Gerald Turner <gt...@unzane.com> wrote:

> "Howard W. Smith, Jr." <sm...@gmail.com> writes:
>
> > I can confirm the same about CODI @Advanced not working in/with JSF
> > @FacesConverter. My workaround (in a TomEE/CDI/MyFaces-CODI project)
> > was to only add the @FacesConverter to JSF @RequestScoped managed
> > beans, and they are working great in/with TomEE 1.5.1 SNAPSHOT.
>
> Thanks Howard, I'll probably go with that approach after more time
> experimenting with @Advanced.
>
> Do you get to use the 'forClass' annotation attribute of
> @FacesConverter, or do you have to link them by name (I forget the
> mechanism, been spoiled by 'forClass').
>
> --
> Gerald Turner   Email: gturner@unzane.com   JID: gturner@unzane.com
> GPG: 0xFA8CD6D5  21D9 B2E8 7FE7 F19E 5F7D  4D0C 3FA0 810F FA8C D6D5
>

Re: Bug EXTVAL-130?

Posted by Gerald Turner <gt...@unzane.com>.
"Howard W. Smith, Jr." <sm...@gmail.com> writes:

> I can confirm the same about CODI @Advanced not working in/with JSF
> @FacesConverter. My workaround (in a TomEE/CDI/MyFaces-CODI project)
> was to only add the @FacesConverter to JSF @RequestScoped managed
> beans, and they are working great in/with TomEE 1.5.1 SNAPSHOT.

Thanks Howard, I'll probably go with that approach after more time
experimenting with @Advanced.

Do you get to use the 'forClass' annotation attribute of
@FacesConverter, or do you have to link them by name (I forget the
mechanism, been spoiled by 'forClass').

-- 
Gerald Turner   Email: gturner@unzane.com   JID: gturner@unzane.com
GPG: 0xFA8CD6D5  21D9 B2E8 7FE7 F19E 5F7D  4D0C 3FA0 810F FA8C D6D5

Re: Bug EXTVAL-130?

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
I can confirm the same about CODI @Advanced not working in/with JSF
@FacesConverter. My workaround (in a TomEE/CDI/MyFaces-CODI project) was to
only add the @FacesConverter to JSF @RequestScoped managed beans, and they
are working great in/with TomEE 1.5.1 SNAPSHOT.

I have been told that CODI @Advanced and converters have been tested
extensively, and there are code samples for CODI @Advanced for converters,
but still they don't work for me (at least in TomEE 1.5.1 SNAPSHOT).

I can't even get my TomEE/CDI app to work in Glassfish3.1.2.2/WELD, so what
I mentioned above is all I can speak on at the present.

Wait for some of the others to respond to your msg.

Howard

On Tue, Dec 4, 2012 at 2:40 PM, Gerald Turner <gt...@unzane.com> wrote:

> Hello, I'm in the process of converting a JSF2/CDI application from
> Seam3 to MyFaces ExtCDI/CODI.  The application had been using MyFaces
> ExtVal-BV so that JSR-303 cross-field validation would work in the
> front-end.  Simply replacing Seam3 with CODI evoked the following
> stacktrace during the first page view (during MyFaces EXT* lazy init),
> and ExtVal-BV doesn't seem to be working entirely (annotations like
> @DateIs work, but my ConstraintValidators aren't being executed).
> Things actually get worse than that, some injection points no longer
> work, particularly on an abstract superclass - but I figure I should
> solve this warning before exploring that issue.  Also injection in
> FacesConverter and ConstraintValidators (when triggered by JPA) don't
> work even after annotating with @Advanced - again, probably a secondary
> effect.  Also yet another tangent - I've heard that CODI and Seam3 can
> be deployed together, but under JBoss 7.1.1.Final the app doesn't deploy
> due to Weld errors with ambiguous producers - I haven't found any
> documentation that describes any Veto-esque configuration.
>
> This looks exactly like JIRA issue EXTVAL-130, only I'm using JBoss
> 7.1.1.Final instead of Glassfish, but they both share Weld, and I am
> using ExtVal 2.0.6, which is the fixed version.
>
> Relevant parts of my pom.xml:
>
>     <!-- CDI & MyFaces ExtCDI/CODI -->
>     <dependency>
>       <groupId>javax.enterprise</groupId>
>       <artifactId>cdi-api</artifactId>
>       <version>1.0-SP4</version>
>       <scope>provided</scope>
>     </dependency>
>     <dependency>
>       <groupId>org.apache.myfaces.extensions.cdi.bundles</groupId>
>       <artifactId>myfaces-extcdi-bundle-jsf20</artifactId>
>       <version>1.0.5</version>
>     </dependency>
>
>     <!-- MyFaces ExtVal -->
>     <dependency>
>
> <groupId>org.apache.myfaces.extensions.validator.validation-modules</groupId>
>       <artifactId>myfaces-extval-property-validation</artifactId>
>       <version>2.0.6</version>
>       <exclusions>
>         <exclusion>
>           <groupId>javax.persistence</groupId>
>           <artifactId>persistence-api</artifactId>
>         </exclusion>
>       </exclusions>
>     </dependency>
>     <dependency>
>
> <groupId>org.apache.myfaces.extensions.validator.validation-modules</groupId>
>       <artifactId>myfaces-extval-bean-validation</artifactId>
>       <version>2.0.6</version>
>       <exclusions>
>         <exclusion>
>           <groupId>javax.validation</groupId>
>           <artifactId>validation-api</artifactId>
>         </exclusion>
>       </exclusions>
>     </dependency>
>
> Some bits of the CODI startup version output (need to see the booleans
> too?):
>
>   10:56:32,600 INFO
> [org.apache.myfaces.extensions.cdi.jsf2.impl.Jsf2ModuleStartupObserver]
> (http--0.0.0.0-8080-1) [Started] MyFaces CODI JSF-Module v1.0.5 for JSF 2.0
> Used JSF implementation: Mojarra vnull
>
>   10:56:32,611 INFO
> [org.apache.myfaces.extensions.cdi.jpa.impl.JpaModuleStartupObserver]
> (http--0.0.0.0-8080-1) [Started] MyFaces CODI JPA-Module v1.0.5
>
>   10:56:32,620 INFO
> [org.apache.myfaces.extensions.cdi.core.impl.CoreStartupObserver]
> (http--0.0.0.0-8080-1) [Started] MyFaces CODI (Extensions CDI) Core v1.0.5
> Used CDI implementation: Weld v2012-02-10 15:31
>
> The stacktrace:
>
>   10:56:33,838 WARNING
> [org.apache.myfaces.extensions.validator.beanval.ValidatorFactoryProxy]
> (http--0.0.0.0-8080-1) failed to lookup a bean with the name
> contextAwareValidatorFactory: java.lang.IllegalStateException: No
> CreationalContext registered for EL evaluation, it is likely that the the
> expression factory has not been wrapped by the CDI BeanManager, which must
> be done to use the ELResolver from CDI
>     at
> org.jboss.weld.el.AbstractWeldELResolver.getELCreationalContext(AbstractWeldELResolver.java:148)
> [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
>     at
> org.jboss.weld.el.AbstractWeldELResolver.lookup(AbstractWeldELResolver.java:123)
> [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
>     at
> org.jboss.weld.el.AbstractWeldELResolver.getValue(AbstractWeldELResolver.java:96)
> [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
>     at
> org.jboss.as.weld.webtier.jsf.ForwardingELResolver.getValue(ForwardingELResolver.java:46)
> [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]
>     at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:175)
> [jboss-el-api_2.2_spec-1.0.0.Final.jar:1.0.0.Final]
>     at
> com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
> [jsf-impl-2.1.7-jbossorg-2.jar:]
>     at
> com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
> [jsf-impl-2.1.7-jbossorg-2.jar:]
>     at
> org.apache.myfaces.extensions.validator.core.el.DefaultELHelper.getBean(DefaultELHelper.java:79)
> [myfaces-extval-core-2.0.6.jar:2.0.6]
>     at
> org.apache.myfaces.extensions.validator.beanval.ValidatorFactoryProxy.getValidatorFactory(ValidatorFactoryProxy.java:58)
> [myfaces-extval-bean-validation-2.0.6.jar:2.0.6]
>     at
> org.apache.myfaces.extensions.validator.beanval.ValidatorFactoryProxy.getValidator(ValidatorFactoryProxy.java:86)
> [myfaces-extval-bean-validation-2.0.6.jar:2.0.6]
>     at
> org.apache.myfaces.extensions.validator.beanval.util.BeanValidationUtils.getElementDescriptor(BeanValidationUtils.java:108)
> [myfaces-extval-bean-validation-2.0.6.jar:2.0.6]
>     at
> org.apache.myfaces.extensions.validator.beanval.BeanValidationModuleValidationInterceptorInternals.initComponentWithPropertyDetails(BeanValidationModuleValidationInterceptorInternals.java:104)
> [myfaces-extval-bean-validation-2.0.6.jar:2.0.6]
>     at
> org.apache.myfaces.extensions.validator.beanval.BeanValidationModuleValidationInterceptor.initComponentWithPropertyDetails(BeanValidationModuleValidationInterceptor.java:70)
> [myfaces-extval-bean-validation-2.0.6.jar:2.0.6]
>     at
> org.apache.myfaces.extensions.validator.beanval.BeanValidationModuleValidationInterceptor.initComponent(BeanValidationModuleValidationInterceptor.java:60)
> [myfaces-extval-bean-validation-2.0.6.jar:2.0.6]
>     at
> org.apache.myfaces.extensions.validator.core.interceptor.AbstractValidationInterceptor.beforeEncodeBegin(AbstractValidationInterceptor.java:112)
> [myfaces-extval-core-2.0.6.jar:2.0.6]
>     at
> org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeBegin(ExtValRendererWrapper.java:183)
> [myfaces-extval-core-2.0.6.jar:2.0.6]
>     at
> javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:820)
> [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
>     at
> com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:302)
> [jsf-impl-2.1.7-jbossorg-2.jar:]
>     at
> com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:185)
> [jsf-impl-2.1.7-jbossorg-2.jar:]
>     at
> com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:129)
> [jsf-impl-2.1.7-jbossorg-2.jar:]
>     at
> org.apache.myfaces.extensions.validator.core.renderkit.ExtValLazyRendererProxy.encodeChildren(ExtValLazyRendererProxy.java:70)
> [myfaces-extval-core-2.0.6.jar:2.0.6]
>     at
> org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeChildren(ExtValRendererWrapper.java:286)
> [myfaces-extval-core-2.0.6.jar:2.0.6]
>     at
> javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
> [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
>     at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779)
> [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
>     at javax.faces.rinal.jar:]
>     at org.jboss.as.jpa.interceptor.WebNonTxEmCl
>
> --
> Gerald Turner   Email: gturner@unzane.com   JID: gturner@unzane.com
> GPG: 0xFA8CD6D5  21D9 B2E8 7FE7 F19E 5F7D  4D0C 3FA0 810F FA8C D6D5
>