-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AbstractMethodError when <f:websocket> is used #265
Comments
Hey! Thanks for reporting this. Does the same error occur if you are not including OmniFaces? |
Good idea, you made me try different combinations with Omnifaces + Rewrite and there could be a connection between the two. Interestingly, on a clean slate project the WAR deploys and doesn't throw any error if either only Omnifaces 3.0 alone or only Rewrite 3.4.2.Final are integrated. For some reason I can't replicate that throw error there... but instead as soon as both are being added and ENABLE_WEBSOCKET_TRUE is set to true, you end up with a NullPointerException: Error invoking ServletContainerInitializer org.glassfish.tyrus.servlet.TyrusServletContainerInitializer
java.lang.NullPointerException
at org.glassfish.tyrus.servlet.TyrusServletContainerInitializer.onStartup(TyrusServletContainerInitializer.java:153)
at org.apache.catalina.core.StandardContext.callServletContainerInitializers(StandardContext.java:5825)
at com.sun.enterprise.web.WebModule.callServletContainerInitializers(WebModule.java:695)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5722)
at com.sun.enterprise.web.WebModule.start(WebModule.java:609)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:956)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:939)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:684)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2099)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1745)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:107)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:123) On another note, on my running project everything works fine if you use <o:socket> instead of <f:websocket> |
Looks like the NPE is thrown here:
So maybe the initialization is triggered twice for some reason? |
A new day, a fresh mind. After tweaking the application to not throw random errors (faces-config.xml issues), I've been able to test that out a bit more. When both Omnifaces and Rewrite run, I get the same error as on the original post. Now I've been thinking a bit and noticed that there could be an issue with the FakeEndpoint you have to add in to make Interestingly, it's possible that Omnifaces is not the culprit of this seeing as Error Rendering View[/index.xhtml]
java.lang.NullPointerException
at com.sun.faces.cdi.CdiUtils.getBeanReferenceByType(CdiUtils.java:223)
at com.sun.faces.cdi.CdiUtils.getBeanReference(CdiUtils.java:206)
at com.sun.faces.renderkit.html_basic.WebsocketRenderer.encodeEnd(WebsocketRenderer.java:111)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:619)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1677)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1673)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:492)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:194)
at org.ocpsoft.rewrite.faces.RewriteViewHandler.renderView(RewriteViewHandler.java:196)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:126)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:223)
at javax.faces.webapp.FacesServlet.executeLifecyle(FacesServlet.java:732)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:475)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1622)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:339)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:209)
at org.glassfish.tyrus.servlet.TyrusServletFilter.doFilter(TyrusServletFilter.java:305)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:251)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:209)
at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:226)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:251)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:209)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:654)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:593)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:371)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:516)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:213)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:242)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:539)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:593)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:573)
at java.lang.Thread.run(Thread.java:748)` ...which makes completely sense as public class FakeEndpoint extends Endpoint {
@Override
public void onOpen(Session session, EndpointConfig config) {
// https://java.net/jira/browse/WEBSOCKET_SPEC-240
}
} you get the NullPointerException error from my comment before! So what it seems like is that Rewrite clashes with the endpoint that gets manually added to conform with the WEBSOCKET SEC-240 |
Same problem =( |
There's currently a compatibility issue with JSF 2.3 new websocket implementation.
As soon as a <f:websocket> block is being used in an XHTML, the facesServlet throws an exception:
This can be reproduced only by having the library integrated and letting it load. Setting nothing up except an XHTML with <f:websocket> and a param with ENABLE_WEBSOCKET_ENDPOINT at true in web.xml is enough to make this appear.
ryoung seems to have a similar issue as seen on the support page of Rewrite
bmlikota is on a similar boat where they fixed that by removing the dependency for rewrite as seen in StackExchange
Running:
Payara Server 5.0.181
JSF 2.3
The text was updated successfully, but these errors were encountered: