Skip to content
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

[Wildfly 8.0.0.Final] Blocking request failed HttpServerExchange{ GET /primepush/message/qla/robert}: java.lang.NullPointerException #1728

Closed
ladrob opened this issue Sep 24, 2014 · 22 comments

Comments

@ladrob
Copy link

ladrob commented Sep 24, 2014

Hi,

I've got the error from the title on page load. I'm using Primefaces 5.0.

My PushEndpoint resource file is:

    @PushEndpoint("/message/{domain}/{user}")
    public class SckMessageResource {

      @PathParam("domain")
      private String domain;

      @PathParam("user")
      private String user;

      @OnMessage(encoders = {JSONEncoder.class})
      public String onMessage(String message) {
          return message;
      }
    }

Full trace of error:

    16:59:13,497 ERROR [io.undertow.request] (default task-3) Blocking request failed HttpServerExchange{ GET /primepush/message/qla/robert}: java.lang.NullPointerException
        at org.atmosphere.container.JSR356Endpoint.onClose(JSR356Endpoint.java:215)
        at io.undertow.websockets.jsr.UndertowSession.close(UndertowSession.java:170)
        at org.atmosphere.container.JSR356Endpoint.onOpen(JSR356Endpoint.java:187)
        at io.undertow.websockets.jsr.EndpointSessionHandler.onConnect(EndpointSessionHandler.java:81)
        at io.undertow.websockets.jsr.JsrWebSocketFilter$1.handleUpgrade(JsrWebSocketFilter.java:115)
        at io.undertow.server.protocol.http.HttpReadListener.exchangeComplete(HttpReadListener.java:244)
        at io.undertow.server.protocol.http.HttpServerConnection.exchangeComplete(HttpServerConnection.java:218)
        at io.undertow.server.HttpServerExchange.invokeExchangeCompleteListeners(HttpServerExchange.java:1090)
        at io.undertow.server.HttpServerExchange.terminateResponse(HttpServerExchange.java:1310)
        at io.undertow.server.Connectors.terminateResponse(Connectors.java:69)
        at io.undertow.server.protocol.http.ServerFixedLengthStreamSinkConduit.channelFinished(ServerFixedLengthStreamSinkConduit.java:33)
        at io.undertow.conduits.AbstractFixedLengthStreamSinkConduit.exitFlush(AbstractFixedLengthStreamSinkConduit.java:249)
        at io.undertow.conduits.AbstractFixedLengthStreamSinkConduit.flush(AbstractFixedLengthStreamSinkConduit.java:183)
        at org.xnio.conduits.ConduitStreamSinkChannel.flush(ConduitStreamSinkChannel.java:162) [xnio-api-3.2.0.Final.jar:3.2.0.Final]
        at io.undertow.channels.DetachableStreamSinkChannel.flush(DetachableStreamSinkChannel.java:100)
        at org.xnio.channels.Channels.flushBlocking(Channels.java:63) [xnio-api-3.2.0.Final.jar:3.2.0.Final]
        at io.undertow.servlet.spec.ServletOutputStreamImpl.close(ServletOutputStreamImpl.java:623)
        at io.undertow.servlet.spec.HttpServletResponseImpl.closeStreamAndWriter(HttpServletResponseImpl.java:451)
        at io.undertow.servlet.spec.HttpServletResponseImpl.responseDone(HttpServletResponseImpl.java:525)
        at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:287)
        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)
        at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73)
        at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146)
        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:168)
        at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:687)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]
        at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]

The error appears in Atmosphere 2.1.5 and above. Version 2.1.4 works fine.
Thanks for any hints.

@jfarcand
Copy link
Member

@ladrob You means 2.1.5? Can you try 2.1.9?

@ladrob
Copy link
Author

ladrob commented Sep 24, 2014

Oh, sorry, yes I mean 2.1.5. I've tried also 2.1.8 - the same problem. I'll try 2.1.9 and let you know. Thanks.

@jfarcand
Copy link
Member

@ladrob OK lines of the exception aren't matching with the current version. Please try 2.1.9 and paste the exception again. Thanks

@ladrob
Copy link
Author

ladrob commented Sep 24, 2014

Hmm.. 2.1.9 - no error, and doesn't work for me. Maybe I could try 2.2.1?

@jfarcand
Copy link
Member

Yes give it a try.

@ladrob
Copy link
Author

ladrob commented Sep 24, 2014

Now I have error:

15:54:29,014 ERROR [org.atmosphere.interceptor.JavaScriptProtocol] (default task-8) Invalid Atmosphere Version 2.2.0-javascript
15:54:29,014 WARN  [org.atmosphere.websocket.protocol.SimpleHttpProtocol] (default task-8) Status code higher or equal than 400. Unable to deliver the websocket messages to installed component. Status 501 Message OK

Still doesn't work. Why Invalid Atmosphere Version? In my pom.xml I have only atmosphere-runtime 2.2.1.

@jfarcand
Copy link
Member

Update atmosphere-javascript to 2.2.4

@ladrob
Copy link
Author

ladrob commented Sep 24, 2014

I cannot find in maven atmosphere-javascript. I've tried:
groupId: org.atmosphere
artifactId: atmosphere-javascript
version: 2.2.4

and

groupId: org.atmosphere.client
artifactId: javascript
version: 2.2.4

... missing artifact. :-(

@ladrob
Copy link
Author

ladrob commented Sep 24, 2014

Sorry, I don't know what is going on. I've copy/paste dependency from link you provided (that I've tried on the beginning) to my pom and only this one dependency says: Missing artifact org.atmosphere:javascript-project:jar:2.2.4

I must find the problem and then I'll come back.

@flowersinthesand
Copy link
Member

javascript-project is the parent project of atmosphere-javascript and atmosphere-jquery. You should use:

http://search.maven.org/#search%7Cga%7C1%7Corg.atmosphere.client

@ladrob
Copy link
Author

ladrob commented Sep 24, 2014

I used jquery and javascript, but the same problem. My maven client download all but war files. I downloaded them manually and changed war extension to jar (because of compilation problem) and unfortunaltely I have simmilar error:

    17:29:22,987 INFO  [org.atmosphere.cpr.AtmosphereFramework] (default task-15) Installed AtmosphereInterceptor @PushEndpoint Interceptor with priority AFTER_DEFAULT 
    17:29:23,022 ERROR [org.atmosphere.interceptor.JavaScriptProtocol] (default task-15) Invalid Atmosphere Version 2.2.0-javascript
    17:29:23,039 ERROR [org.atmosphere.interceptor.JavaScriptProtocol] (default task-5) Invalid Atmosphere Version 2.2.0-javascript
    17:29:23,049 ERROR [org.atmosphere.interceptor.JavaScriptProtocol] (default task-8) Invalid Atmosphere Version 2.2.0-javascript
    17:29:23,062 ERROR [org.atmosphere.interceptor.JavaScriptProtocol] (default task-2) Invalid Atmosphere Version 2.2.0-javascript
    17:29:23,070 ERROR [org.atmosphere.interceptor.JavaScriptProtocol] (default task-11) Invalid Atmosphere Version 2.2.0-javascript
    17:29:23,091 ERROR [org.atmosphere.interceptor.JavaScriptProtocol] (default task-14) Invalid Atmosphere Version 2.2.0-javascript
    17:29:23,105 ERROR [org.atmosphere.interceptor.JavaScriptProtocol] (default task-9) Invalid Atmosphere Version 2.2.0-javascript

Is everything alright with these artifacts? I haven't such problems with any yet.

@jfarcand
Copy link
Member

NOT 2.2.0, 2.2.4

@ladrob
Copy link
Author

ladrob commented Sep 24, 2014

Yes I know - I've installed 2.2.4 - I don't know why log says 2.2.0 still. It looks - it doesn't see new libraries.

@ladrob
Copy link
Author

ladrob commented Sep 24, 2014

Too many actions and changes with atmosphere repo from my side. I'll remove all libraries from local mvn, restart my PC, clean everything and try again.

@ladrob
Copy link
Author

ladrob commented Sep 24, 2014

I'll try with:

    <dependency>
        <groupId>org.atmosphere</groupId>
        <artifactId>atmosphere-runtime</artifactId>
        <version>2.2.1</version>
    </dependency>

    <dependency>
        <groupId>org.atmosphere</groupId>
        <artifactId>javascript-project</artifactId>
        <version>2.2.4</version>
        <type>pom</type>
    </dependency>

@ladrob
Copy link
Author

ladrob commented Sep 24, 2014

I've still the same error: Invalid Atmosphere Version 2.2.0-javascript.
I'll back to 2.1.4. Sorry and thank you for your efforts.

@jfarcand
Copy link
Member

You have javascript cached somewhere. Just tested on Wildfly and everything works for me. So try to come with a test case.

@ladrob
Copy link
Author

ladrob commented Sep 24, 2014

How should pom.xml look like? I mean atmosphere libraries.

@jfarcand
Copy link
Member

BTW for sure your error has been fixed

    @Override
    public void onClose(javax.websocket.Session session, javax.websocket.CloseReason closeCode) {
        logger.trace("{} closed {}", session, closeCode);
        if (request != null) {
            request.destroy();
            webSocketProcessor.close(webSocket, closeCode.getCloseCode().getCode());
        }
    }

The NPE was occuring because of request was null. This is fixed 2.1.5+ . You must update push.js if you want to use the latest atmosphere.js BTW by replace the atmosphere.js code inside that file. That's explain why 2.2.0 is still used.

@jfarcand
Copy link
Member

Closing this issue as fixed.

@ladrob
Copy link
Author

ladrob commented Sep 24, 2014

Ok, maybe this is primefaces push issue. PF doc suggests Atmosphere 2.1.3, so I'll back to 2.1.4 - as there were no errors for me. Thank you anyway and sorry for bothering you :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants