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

nettosphere-2.0.0.RC3: SSL problems with static files? (server returns HTTP/1.1 500 Internal Server Error)) #41

Closed
jmarine opened this issue Jun 9, 2013 · 3 comments

Comments

@jmarine
Copy link

jmarine commented Jun 9, 2013

Hi,

I'm testing nettosphere-2.0.0RC3 as a web server for static files and an AtmosphereHandler for websockets communications. This is the NettoSphere's program configuration:

Config.Builder sslConfigBuilder = new Config.Builder();
sslConfigBuilder.host("0.0.0.0").port(Integer.parseInt(myConfig.getProperty("wss-port")));            
sslConfigBuilder.sslContext(createSSLContext(myConfig)).sslContextListener(new MySSLContextListener());
sslConfigBuilder.resource(myConfig.getProperty("docroot"));
sslConfigBuilder.resource("/websocket", new MyAtmosphereHandler());

Nettosphere sslServer = new Nettosphere.Builder().config(sslConfigBuilder.build()).build();
sslServer.start();

The websockets communications work fine over WSS, but I can't "GET" the expected static files over HTTPS, because I get instead a page with the following message:

HTTP/1.1 500 Internal Server Error
Content-Type: text/plain; charset=UTF-8
Content-Length: 0
Server: Atmosphere-1.1.0.RC3

I think it could be because of HttpStaticFileServerHandler uses ChunkedFile with SSL channels, but ChannelPipeline returned by AtmosphereChannelPipelineFactory.getPipeline doesn't have a org.jboss.netty.handler.stream.ChunkedWriteHandler.

This is the exception stack trace:

java.lang.IllegalArgumentException: unsupported message type: class org.jboss.netty.handler.stream.ChunkedFile
at org.jboss.netty.channel.socket.nio.SocketSendBufferPool.acquire(SocketSendBufferPool.java:52) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.write0(AbstractNioWorker.java:190) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.writeFromUserCode(AbstractNioWorker.java:145) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:99) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:36) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.handler.ssl.SslHandler.handleDownstream(SslHandler.java:602) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:60) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.Channels.write(Channels.java:704) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.Channels.write(Channels.java:671) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248) ~[netty-3.6.3.Final.jar:na]
at org.atmosphere.nettosphere.HttpStaticFileServerHandler.messageReceived(HttpStaticFileServerHandler.java:189) ~[nettosphere-2.0.0.RC3.jar:na]
at org.atmosphere.nettosphere.NettyAtmosphereHandler.handleHttp(NettyAtmosphereHandler.java:360) ~[nettosphere-2.0.0.RC3.jar:na]
at org.atmosphere.nettosphere.NettyAtmosphereHandler.messageReceived(NettyAtmosphereHandler.java:224) ~[nettosphere-2.0.0.RC3.jar:na]
at org.jboss.netty.handler.codec.http.HttpChunkAggregator.messageReceived(HttpChunkAggregator.java:148) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:459) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:536) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:435) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:107) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88) ~[netty-3.6.3.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) ~[netty-3.6.3.Final.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_15]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_15]
at java.lang.Thread.run(Thread.java:722) [na:1.7.0_15]

Thank you for the "atmosphere" and "nettosphere" projects.

@jfarcand
Copy link
Member

Thanks, I will looks ASAP. Stay tuned

@jfarcand
Copy link
Member

OK pushed a fix. Please test and report. Thanks!

@jmarine
Copy link
Author

jmarine commented Jun 11, 2013

Hi,
The fix works fine.

Thanks to 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

2 participants