java.lang.ClassCastException: com.vaadin.cdi.internal.UIBean incompatible w

Hi,

After upgrading to the version 7.3.1 of Vaadin and the 1.0.0.beta2 version of the vaadin-cdi component (as advised by the Vaadin team) I’m getting the following ClassCastException in WebSphere (although it’s working fine in TomEE) :

[7-10-14 7:46:27:980 UTC]
000000a6 SystemErr R okt 07, 2014 7:46:27 AM com.ibm.ws.webcontainer.webapp.WebApp logServletError
SEVERE: SRVE0293E: [Servlet Error]
-[VaadinServlet]
: com.vaadin.server.ServiceException: java.lang.ClassCastException: com.vaadin.cdi.internal.UIBean incompatible with org.apache.webbeans.component.AbstractOwbBean
at com.vaadin.server.VaadinService.handleExceptionDuringRequest(VaadinService.java:1460)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1414)
at com.vaadin.cdi.internal.VaadinCDIServletService.handleRequest(VaadinCDIServletService.java:82)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:305)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1227)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:776)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:458)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1032)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:909)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:459)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:526)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:312)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:283)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:816)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1862)
Caused by: java.lang.ClassCastException: com.vaadin.cdi.internal.UIBean incompatible with org.apache.webbeans.component.AbstractOwbBean
at org.apache.webbeans.container.BeanManagerImpl.getReference(BeanManagerImpl.java:870)
at com.ibm.ws.webbeans.services.IBMBeanManagerImpl.getReference(IBMBeanManagerImpl.java:204)
at com.vaadin.cdi.CDIUIProvider.createInstance(CDIUIProvider.java:91)
at com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:199)
at com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:74)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1402)
… 26 more

I’ve tried to change the classloading policy to PARENT_LAST without any luck.

Can someone acknowledge that the vaadin-cdi add-on was tested on WebSphere 8.5 ?
Besides that does someone know what could cause the error and how to resolve it ?

Thank you in advance.

Kind regards,
Richard Aalten

Hi,
the CDI addon wasn’t tested with WebSphere in particular, but it was tested with other server implementations that use OWB.
Judging by the stacktrace I suspect this is an issue with that specific version of OWB. What exact version are you using?
-Juuso valli

I had the same issue, but is seems to have been fixed by moving to the beta4 of vaadin-cid