[
https://issues.jboss.org/browse/WELD-996?page=com.atlassian.jira.plugin.s...
]
Jozef Hartinger commented on WELD-996:
--------------------------------------
My understanding is that if an extension-provided Interceptor implementation (e.g.
CustomInterceptorImpl) is registered, Weld should recognize it to be passivation capable
if and only if CustomInterceptorImpl implements the PassivationCapable interface. That
should be the only indicator and we should not check the underlying class
CustomInterceptorImpl may be using. Otherwise, that would go against the abstraction the
SPI provides.
ClassCastException validating custom Interceptor implementation
---------------------------------------------------------------
Key: WELD-996
URL:
https://issues.jboss.org/browse/WELD-996
Project: Weld
Issue Type: Bug
Affects Versions: 1.1.2.Final
Reporter: Jozef Hartinger
Assignee: Jozef Hartinger
Priority: Critical
Fix For: 1.2.0.Beta1
Having a custom implementation of the Interceptor interface registered with Weld, the
validation always fails if the interceptor happens to intercept a passivation capable
bean. Weld incorrectly casts the interceptor to InterceptorImpl which is not valid for
extension-provided interceptors.
{noformat}
java.lang.ClassCastException: org.jboss.seam.classic.intercept.ClassicInterceptor cannot
be cast to org.jboss.weld.bean.InterceptorImpl
at org.jboss.as.weld.services.WeldService.start(WeldService.java:96)
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
[jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
[jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[:1.6.0_24]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[:1.6.0_24]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]
Caused by: java.lang.ClassCastException:
org.jboss.seam.classic.intercept.ClassicInterceptor cannot be cast to
org.jboss.weld.bean.InterceptorImpl
at org.jboss.weld.bootstrap.Validator.validateInterceptors(Validator.java:171)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:151)
at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:351)
at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:336)
at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:404)
at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:82)
at org.jboss.as.weld.services.WeldService.start(WeldService.java:89)
... 5 more
{noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira