# Conflicting classes after upgrade to 4.0.1

**URL:** https://community.wowza.com/t/conflicting-classes-after-upgrade-to-4-0-1/39394
**Category:** Wowza Streaming Engine
**Created:** [March 11, 2014, 5:05am UTC](https://community.wowza.com/t/conflicting-classes-after-upgrade-to-4-0-1/39394 "2014-03-11T05:05:50Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Dmitry\_Zin](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@Dmitry\_Zin](https://community.wowza.com/u/Dmitry_Zin)
#### Post date: [March 11, 2014, 5:05am UTC](https://community.wowza.com/t/conflicting-classes-after-upgrade-to-4-0-1/39394/1 "2014-03-11T05:05:50Z")

</div>

I used org.apache.http.impl.client.HttpClients to upload file from wowza app to external server.

In WMS 3.6.4 all works fine.

In WSE 4.0.1 I get error:

```auto
ERROR	server	comment	2014-03-11	16:36:57	-	-	-	-	-	24.472	- invoke(createSnapshotLive): java.lang.NoSuchFieldError: INSTANCE: org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:52)

```

I found why this happens here [http://stackoverflow.com/questions/21864521/java-lang-nosuchfielderror-org-apache-http-message-basiclineformatter-instance](http://stackoverflow.com/questions/21864521/java-lang-nosuchfielderror-org-apache-http-message-basiclineformatter-instance)

The problem is that WSE 4.0.1 has conflicted class with apache http client library.

If I testing my upload file component. No error. Using class from original apache jar

```auto
jar:file:/C:/Program%20Files%20(x86)/Wowza%20Media%20Systems/Wowza%20Streaming%20Engine%204.0.1/lib/httpcore-4.3.2.jar!/org/apache/http/message/BasicLineFormatter.class

```

Then run component from wowza app. Error. Used class from wms-restlet-2.1.6.jar:

```auto
jar:file:/usr/local/WowzaStreamingEngine/lib/wms-restlet-2.1.6.jar!/org/apache/http/message/BasicLineFormatter.class

```

How should I use apache http client 4.3.3 lib in WSE 4.0.1?

---

<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: [March 11, 2014, 6:31pm UTC](https://community.wowza.com/t/conflicting-classes-after-upgrade-to-4-0-1/39394/2 "2014-03-11T18:31:45Z")

</div>

I think the only solution is to re-write your uploader to avoid this: rename, extend to other names, or use the conflicting API. The only work-around would be to run Wowza Engine but not the Manager, which I think is where the conflict is.

Richard

---

<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: [April 21, 2014, 2:06pm UTC](https://community.wowza.com/t/conflicting-classes-after-upgrade-to-4-0-1/39394/3 "2014-04-21T14:06:41Z")

</div>

Hi,

I forwarded your comments.

Thanks,

Richard

---

<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: [April 24, 2014, 1:34am UTC](https://community.wowza.com/t/conflicting-classes-after-upgrade-to-4-0-1/39394/4 "2014-04-24T01:34:09Z")

</div>

Thanks for the report, Denis.

Richard

---

<div class="post-metadata">

### Author: ![Denis\_Chetverikov](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@Denis\_Chetverikov](https://community.wowza.com/u/Denis_Chetverikov)
#### Post date: [April 16, 2014, 2:43pm UTC](https://community.wowza.com/t/conflicting-classes-after-upgrade-to-4-0-1/39394/5 "2014-04-16T14:43:21Z")

</div>

Yeah, it looks like a hot topic. Today I faced the same issue.

I have a number of custom modules using Apache HttpClient 4.3.x and all of them are not working with Wowza 4 because it is packaged with wms-restlet-2.1.6.jar which has HttpClient 4.1.1 incorporated.

The problem is that HttpClient 4.1.x is rare thing, it is really hard to find, on the original site [http://hc.apache.org/](http://hc.apache.org/) there is no information about this version. I even can’t find the documentation for that.

The last version of [restlet.org](http://restlet.org) is 2.2 and it uses httpclient 4.3.x.

Is it possible for Wowza Streaming Engine to migrate to restlet.org-2.2 ?

Thank you,

Denis

---

<div class="post-metadata">

### Author: ![Denis\_Chetverikov](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@Denis\_Chetverikov](https://community.wowza.com/u/Denis_Chetverikov)
#### Post date: [April 22, 2014, 9:07am UTC](https://community.wowza.com/t/conflicting-classes-after-upgrade-to-4-0-1/39394/6 "2014-04-22T09:07:50Z")

</div>

Also there is another reason to use HttpClient 4.3 - because of GA version of HttpAsyncClient depend on it. So, if using HttpClient 4.1 we are limited to use HttpAsyncClient.

By the way, I just tried to remove built-in HttpClient from wms-restlet-2.1.6.jar and replace it with external jar of HttpClient 4.3.2. Seems Wowza REST API works fine with it but more testing needed to be sure.

---

<div class="post-metadata">

### Author: ![Marcello\_M](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@Marcello\_M](https://community.wowza.com/u/Marcello_M)
#### Post date: [April 21, 2014, 8:38am UTC](https://community.wowza.com/t/conflicting-classes-after-upgrade-to-4-0-1/39394/7 "2014-04-21T08:38:01Z")

</div>

Hello Wowza,

Please upgrade the HTTP Client to the latest version 4.3 along with 2.2 of restlet. I now have to get plugins remade for this HTTP 4.1 stuff just when I was looking to deploy Wowza 4 across the server farm for a client.

Thanks.

---

<div class="post-metadata">

### Author: ![Rafael\_Sobral](https://avatars.discourse-cdn.com/v4/letter/r/87869e/32.png) [@Rafael\_Sobral](https://community.wowza.com/u/Rafael_Sobral)
#### Post date: [March 14, 2014, 8:11am UTC](https://community.wowza.com/t/conflicting-classes-after-upgrade-to-4-0-1/39394/8 "2014-03-14T08:11:59Z")

</div>

So you mean that it is not possible to use a popular library like http-client with Wowza anymore?

I am getting the same error when instancing PoolingHttpClientConnectionManager.

PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager();

java.lang.NoSuchFieldError: INSTANCE

at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.(DefaultHttpRequestWriterFactory.java:52)

at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.(DefaultHttpRequestWriterFactory.java:56)

at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.(DefaultHttpRequestWriterFactory.java:46)

at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.(ManagedHttpClientConnectionFactory.java:72)

at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.(ManagedHttpClientConnectionFactory.java:84)

---

<div class="post-metadata">

### Author: ![Rafael\_Sobral](https://avatars.discourse-cdn.com/v4/letter/r/87869e/32.png) [@Rafael\_Sobral](https://community.wowza.com/u/Rafael_Sobral)
#### Post date: [April 1, 2014, 7:29pm UTC](https://community.wowza.com/t/conflicting-classes-after-upgrade-to-4-0-1/39394/9 "2014-04-01T19:29:44Z")

</div>

I fixed the problem moving the HttpCient initialization out of Server init event it was attached too.

I found similar posts of issues with HttpClient when it running in another java framework not related to stream in the initializing events. In this framework the problem was that HTTpClient was not serializable and objects in the init should be.

But not sure if it is the same thing here.

---

<div class="post-metadata">

### Author: ![Rafael\_Sobral](https://avatars.discourse-cdn.com/v4/letter/r/87869e/32.png) [@Rafael\_Sobral](https://community.wowza.com/u/Rafael_Sobral)
#### Post date: [April 10, 2014, 8:16am UTC](https://community.wowza.com/t/conflicting-classes-after-upgrade-to-4-0-1/39394/10 "2014-04-10T08:16:32Z")

</div>

Now I got that the problem persist. I just was not throwing the error anymore.

---

<div class="post-metadata">

### Author: ![Dmitry\_Zin](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@Dmitry\_Zin](https://community.wowza.com/u/Dmitry_Zin)
#### Post date: [March 11, 2014, 11:36pm UTC](https://community.wowza.com/t/conflicting-classes-after-upgrade-to-4-0-1/39394/11 "2014-03-11T23:36:10Z")

</div>

Thanks, I rewrote this part using “curl” shell command
