[Resin-interest] CDI compatibility issues with Resin

arjan tijms arjan.tijms at gmail.com
Sun Sep 8 11:06:58 CDT 2013


I'm one of the developers of the OmniFaces JSF utility library. We're
trying to keep our library compatible with every Java EE implementation out
there, but for our next 1.6 release we've run into two issues concerning
Resin 4.0.36.

The first is that when using a generic producer method with e.g. the
following signature:

    public <V> ParamValue<V> produce(InjectionPoint injectionPoint)

Resin throws an exception with the following text:

 {resin-port-8080-43} classpath:META-INF/caucho/app-default.xml:55:
javax.enterprise.inject.InjectionException: 'public
is an invalid @Produces method because it returns a generic type class

                       53: default="true"/>
                       55: <resin:if test="${! quercus_disable}">
                       56: <servlet-mapping url-pattern="*.php"
                       57: servlet-name="resin-php"

Although the CDI 1.0 spec doesn't require this to work, it's not forbidden
either. Weld 1.x/2.x and OpenWebBeans 1.1.x/1.2.x do support this. A
snapshot of OpenWebBeans 1.2.1 didn't support this anymore (following CDI
1.1 discussions), but after some further discussion the team decided that
it should indeed be supported. See
https://issues.apache.org/jira/browse/OWB-893 for the OpenWebBeans stance
on this.

The OmniFaces issue about this is

Another issue is that OmniFaces 1.6 is using two extensions that act upon
JSF converters and validators. These observe the ProcessManagedBean event
for resp. the javax.faces.convert.Converter and
javax.faces.validator.Validator types (both are interfaces).


protected void processValidators(@Observes ProcessManagedBean<Validator>

The problem is that this method is never called on Resin, but it IS called
on every other Java EE 6 implementation I tried it with (JBoss EAP 6.1,
GlassFish 3.1.2, TomEE 1.5.3, Liberty 8.5.5, etc).

If I remove the generic parameter then Resin does call the method, e.g.

protected void processValidators(@Observes ProcessManagedBean validator)

And if the generic parameter is a class type instead of an interface type
it works as well, e.g.

public class MyClass { ...}

protected void processValidators(@Observes ProcessManagedBean<MyClass>

See https://code.google.com/p/omnifaces/issues/detail?id=183 for more
information about this particular issue.

The first problem is thus really blocking and will cause Resin users not to
able to use OmniFaces at all, while the second issue has a workaround but
it necessitates making the code less 'nice' for all other containers.
Especially for the first issue it would be great if some solution or
perhaps workaround could be found.

Kind regards,
Arjan Tijms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://maillist.caucho.com/pipermail/resin-interest/attachments/20130908/9ab47a97/attachment.html 

More information about the resin-interest mailing list