# IOException : Stream is closed.

**URL:** <https://community.wowza.com/t/ioexception-stream-is-closed/40604>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [June 12, 2013, 4:30pm UTC](https://community.wowza.com/t/ioexception-stream-is-closed/40604 "2013-06-12T16:30:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jin-Soo\_Han](https://avatars.discourse-cdn.com/v4/letter/j/ce73a5/32.png) [@Jin-Soo\_Han](https://community.wowza.com/u/Jin-Soo_Han)\
**Post date:** [June 12, 2013, 4:30pm UTC](https://community.wowza.com/t/ioexception-stream-is-closed/40604/1 "2013-06-12T16:30:01Z")

</div>

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](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](http://pastebin.com/5VamjKEX)

```auto
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)

```

😕

of course, I made ‘assets’ package…

---

<div class="post-metadata">

**Author:** ![Andrew\_Kennedy1](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@Andrew\_Kennedy1](https://community.wowza.com/u/Andrew_Kennedy1)\
**Post date:** [June 12, 2013, 2:56am UTC](https://community.wowza.com/t/ioexception-stream-is-closed/40604/2 "2013-06-12T02:56:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [June 13, 2013, 12:40pm UTC](https://community.wowza.com/t/ioexception-stream-is-closed/40604/3 "2013-06-13T12:40:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jin-Soo\_Han](https://avatars.discourse-cdn.com/v4/letter/j/ce73a5/32.png) [@Jin-Soo\_Han](https://community.wowza.com/u/Jin-Soo_Han)\
**Post date:** [June 13, 2013, 11:16am UTC](https://community.wowza.com/t/ioexception-stream-is-closed/40604/4 "2013-06-13T11:16:38Z")

</div>

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

So, I typed file parameter.

[http://i.imgur.com/d35kRwu.png](http://i.imgur.com/d35kRwu.png)

i got a same error.

i comment code relative ‘file’.

[http://pastebin.com/Spwdbtk0](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. ☹

---

<div class="post-metadata">

**Author:** ![Jin-Soo\_Han](https://avatars.discourse-cdn.com/v4/letter/j/ce73a5/32.png) [@Jin-Soo\_Han](https://community.wowza.com/u/Jin-Soo_Han)\
**Post date:** [June 13, 2013, 3:43pm UTC](https://community.wowza.com/t/ioexception-stream-is-closed/40604/5 "2013-06-13T15:43:39Z")

</div>

> 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

```auto
 getResourceAsStream("/ ~~/~~") 

```

after

```auto
 getResourceAsStream(" ~~/~~") 

```

…hmm… thank you…
