# Problems upgrading to ILiveStreamRecordManager

**URL:** https://community.wowza.com/t/problems-upgrading-to-ilivestreamrecordmanager/43497
**Category:** Wowza Developer Dojo
**Tags:** wowza-streaming-server-java-api
**Created:** [July 29, 2014, 1:57pm UTC](https://community.wowza.com/t/problems-upgrading-to-ilivestreamrecordmanager/43497 "2014-07-29T13:57:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![George\_Mathew](https://avatars.discourse-cdn.com/v4/letter/g/e95f7d/32.png) [@George\_Mathew](https://community.wowza.com/u/George_Mathew)
#### Post date: [July 29, 2014, 1:57pm UTC](https://community.wowza.com/t/problems-upgrading-to-ilivestreamrecordmanager/43497/1 "2014-07-29T13:57:30Z")

</div>

We had older version of wowza with application using ILiveStreamRecord . We are planning on upgrading to Wowza Streaming Engine 4.0 . Following is code for onPublish . As we have multiple stream recordings we maintain a list of recorders so that if exists we can stop on republish . Recording is fine but when reconnecting nothing happens , no log in wowza and Flash encoder just cant connect to wowza app . Is there anything I am doing wrong here ?

```auto
private HashMap<String, ILiveStreamRecordManager> recorders = new HashMap<String, ILiveStreamRecordManager>();
public void onPublish(final IMediaStream stream, String streamName, boolean isRecord, boolean isAppend) {
		        String streamName = stream.getName();
			IApplicationInstance appInstance = stream.getClient().getAppInstance();
			IVHost vhost = null;
			vhost = appInstance.getVHost();
			ILiveStreamRecordManager recorder = recorders.get(streamName);
			if (recorder != null) {
				getLogger().info("Recorder already existed");
				recorder.stopRecording(stream.getClient().getAppInstance());
			}
			recorder = vhost.getLiveStreamRecordManager();
			StreamRecorderParameters srp = new StreamRecorderParameters(stream.getClient().getAppInstance());
			srp.outputPath = outputPath;
			srp.outputFile = outputFile;
			srp.segmentationType = IStreamRecorderConstants.SEGMENT_NONE;
			srp.versioningOption = IStreamRecorderConstants.APPEND_FILE;
			getLogger().info("Befre Recording: " + srp.outputPath + ":" + srp.outputFile);
			recorder.startRecording(appInstance, srp);
			getLogger().info("Started Recording: ");
			synchronized (recorders) {
				recorders.put(streamName, recorder);
			}
}

```

---

<div class="post-metadata">

### Author: ![George\_Mathew](https://avatars.discourse-cdn.com/v4/letter/g/e95f7d/32.png) [@George\_Mathew](https://community.wowza.com/u/George_Mathew)
#### Post date: [July 29, 2014, 4:21pm UTC](https://community.wowza.com/t/problems-upgrading-to-ilivestreamrecordmanager/43497/2 "2014-07-29T16:21:51Z")

</div>

Is it possible to get some answer please ? Am I in wrong forum ? I have 7 wowza licenses and planning on upgrading . Please let me know if I should rather contact support directly .

---

<div class="post-metadata">

### Author: ![George\_Mathew](https://avatars.discourse-cdn.com/v4/letter/g/e95f7d/32.png) [@George\_Mathew](https://community.wowza.com/u/George_Mathew)
#### Post date: [July 30, 2014, 8:36am UTC](https://community.wowza.com/t/problems-upgrading-to-ilivestreamrecordmanager/43497/3 "2014-07-30T08:36:23Z")

</div>

So I was able to narrow it down to be this line causing the problem . On second time stream publish from Flash media encoder , when it tries to stop previous recorder it just crashed wowza application . Nothing happens on further publish .

recorder.stopRecording(stream.getClient().getAppInstance());

I have posted everything I could think of , will really appreciate some update on this thread . Thanks

---

<div class="post-metadata">

### Author: ![George\_Mathew](https://avatars.discourse-cdn.com/v4/letter/g/e95f7d/32.png) [@George\_Mathew](https://community.wowza.com/u/George_Mathew)
#### Post date: [July 30, 2014, 9:56am UTC](https://community.wowza.com/t/problems-upgrading-to-ilivestreamrecordmanager/43497/4 "2014-07-30T09:56:10Z")

</div>

To answer my own question I had to change it to use following method

recorder.stopRecording(stream.getClient().getAppInstance(),streamname);
