java.lang.ClassCastException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Having: {code} public class ManagedObject { public String sayHello(@NotNull String name) { return "Hello," + name; } } {code} and a test class injecting an instance and calling the method produces the following error: {code} java.lang.ClassCastException: org.jboss.weld.proxies.Validator$-976505265$Proxy$_$$_WeldClientProxy cannot be cast to javax.validation.executable.ExecutableValidator at org.jboss.weld.proxies.Validator$-976505265$Proxy$_$$_WeldClientProxy.forExecutables(Unknown Source) at org.hibernate.validator.internal.cdi.interceptor.ValidationInterceptor.validateMethodInvocation(ValidationInterceptor.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.weld.interceptor.proxy.SimpleMethodInvocation.invoke(SimpleMethodInvocation.java:30) at org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNext(AbstractInterceptionChain.java:93) at org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNextInterceptor(AbstractInterceptionChain.java:78) at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:48) at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:41) at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:53) at org.jboss.forge.addon.validation.ManagedObject$Proxy$_$$_WeldSubclass.sayHello(Unknown Source) at org.jboss.forge.addon.validation.MethodValidatorTest.testValidationPass(MethodValidatorTest.java:65) {code} It is reproducible by pulling the sources from {{https://github.com/forge/core/}}, branch {{bean_addon_validation}} and running the {{org.jboss.forge.addon.validation.MethodValidatorTest}} test. This does not happen with 5.1.0.Beta1
    via by George Gastaldi,
  • Having: {code} public class ManagedObject { public String sayHello(@NotNull String name) { return "Hello," + name; } } {code} and a test class injecting an instance and calling the method produces the following error: {code} java.lang.ClassCastException: org.jboss.weld.proxies.Validator$-976505265$Proxy$_$$_WeldClientProxy cannot be cast to javax.validation.executable.ExecutableValidator at org.jboss.weld.proxies.Validator$-976505265$Proxy$_$$_WeldClientProxy.forExecutables(Unknown Source) at org.hibernate.validator.internal.cdi.interceptor.ValidationInterceptor.validateMethodInvocation(ValidationInterceptor.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.weld.interceptor.proxy.SimpleMethodInvocation.invoke(SimpleMethodInvocation.java:30) at org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNext(AbstractInterceptionChain.java:93) at org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNextInterceptor(AbstractInterceptionChain.java:78) at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:48) at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:41) at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:53) at org.jboss.forge.addon.validation.ManagedObject$Proxy$_$$_WeldSubclass.sayHello(Unknown Source) at org.jboss.forge.addon.validation.MethodValidatorTest.testValidationPass(MethodValidatorTest.java:65) {code} It is reproducible by pulling the sources from {{https://github.com/forge/core/}}, branch {{bean_addon_validation}} and running the {{org.jboss.forge.addon.validation.MethodValidatorTest}} test. This does not happen with 5.1.0.Beta1
    via by George Gastaldi,
    • java.lang.ClassCastException: org.jboss.weld.proxies.Validator$-976505265$Proxy$_$$_WeldClientProxy cannot be cast to javax.validation.executable.ExecutableValidator at org.jboss.weld.proxies.Validator$-976505265$Proxy$_$$_WeldClientProxy.forExecutables(Unknown Source) at org.hibernate.validator.internal.cdi.interceptor.ValidationInterceptor.validateMethodInvocation(ValidationInterceptor.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.weld.interceptor.proxy.SimpleMethodInvocation.invoke(SimpleMethodInvocation.java:30) at org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNext(AbstractInterceptionChain.java:93) at org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNextInterceptor(AbstractInterceptionChain.java:78) at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:48) at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:41) at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:53) at org.jboss.forge.addon.validation.ManagedObject$Proxy$_$$_WeldSubclass.sayHello(Unknown Source) at org.jboss.forge.addon.validation.MethodValidatorTest.testValidationPass(MethodValidatorTest.java:65)
    No Bugmate found.