IOException : Stream is closed.

Hello.

I try to execute this follow link.

https://www.wowza.com/docs/how-to-make-an-html-page-with-graphics-and-scripts-using-an-http-provider

but I get a one exception. I just closely copy & paste that source code.

http://pastebin.com/5VamjKEX

Java.io.IOException: Stream closed
	at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:151)
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
	at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
	at java.io.FilterInputStream.read(FilterInputStream.java:107)
	at com.mycompany.wms.httpprovider.Monitor$FileResponder.<init>(Monitor.java:48)
	at com.mycompany.wms.httpprovider.Monitor.onHTTPRequest(Monitor.java:29)
	at com.wowza.wms.http.HTTPRequestAdapter.service(Unknown Source)
	at com.wowza.wms.server.ServerHandler.a(Unknown Source)
	at com.wowza.wms.server.ServerHandler.a(Unknown Source)
	at com.wowza.wms.server.ServerHandler.messageReceived(Unknown Source)
	at com.wowza.wms.server.ServerHandlerThreaded.messageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain$2.messageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$900(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(Unknown Source)
	at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(Unknown Source)
	at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$900(Unknown Source)
	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(Unknown Source)
	at org.apache.mina.filter.executor.ExecutorFilter.processEvent(Unknown Source)
	at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:722)

:confused:

of course, I made ‘assets’ package…

Hi,

The error suggests that the file is not present, perhaps /assets/ folder is not accessable.

If you do not provide a ‘file’ parameter is the error different ? or does it work correctly ?

Andrew.

Following the guide, you should create a package named “assets”. You created a package named “com.bnspro.wms.httpprovider.assets”. You will have to reference the files there or create the “assets” package to reference as you are doing in the html container.

Richard

Originally, I don’t type ‘file’ parameter in html.

So, I typed file parameter.

http://i.imgur.com/d35kRwu.png

i got a same error.

i comment code relative ‘file’.

http://pastebin.com/Spwdbtk0

i got a same error.


InputStream is null.

I think class do not get resources.

however, look at the imgur url. i made a folder, resource… i don’t know i made any mistake. :frowning:

Hi,

The error suggests that the file is not present, perhaps /assets/ folder is not accessable.

If you do not provide a ‘file’ parameter is the error different ? or does it work correctly ?

Andrew.

Clear…

before

 getResourceAsStream("/~~/~~") 

after

 getResourceAsStream("~~/~~") 

…hmm… thank you…