Why CDI beans don't support final methods

Viewed 6229

I just incurred in the infamous JavaEE CDI error under GlassFish server:

org.glassfish.deployment.common.DeploymentException: CDI deployment failure:Exception List with 2 exceptions:
Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001437 Normal scoped bean class ASController is not proxyable because the type is final or it contains a final method public final void ASController.selectPath(org.primefaces.event.NodeSelectEvent) - Managed Bean [class ASController] with qualifiers [@Default @Any @Named].

the error is quite explicative in the fact that he doesn't like final methods inside a CDI bean, however I can't grasp why.

At this link

http://docs.jboss.org/weld/reference/1.1.0.Final/en-US/html_single/#d0e1429

they explain it is something to do with serialization but I can't see why serializing a class with a final method should be any harder than one with non final methods.

2 Answers
Related