Results 1 to 6 of 6

Thread: How to use newer external libraries in Wowza project

  1. #1

    Default How to use newer external libraries in Wowza project

    I want to use HttpComponents/Client 4.3 a newer version (I think) to what Wowza uses. I have tried adding the necessary external jars (httpclient-4.3.3.jar, httpcore-4.3.2.jar) to wowza/lib and restarted wowza but it still throws errors in the ide e.g.
    Description	Resource	Path	Location	Type
    The constructor UrlEncodedFormEntity(List<NameValuePair>, Charset) is undefined	MediaWriteListener.java	/MediaWriteListener/src/com/newtriks	line 53	Java Problem
    
    Description	Resource	Path	Location	Type
    The method consumeQuietly(HttpEntity) is undefined for the type EntityUtils	MediaWriteListener.java	/MediaWriteListener/src/com/newtriks	line 57	Java Problem
    Please could someone highlight the exact steps to override older wowza related classes with my external libs?

    Update:

    This seems to be related to this thread which has an unanswered question posed at the end of the thread. They raise a point which enforces my question. How to manage conflicting (popular) classes with the older dated versions WSE bundles.

    I can fix the warnings in the IDE using:

    1. Right click Referenced Libraries > Build Path > Configure Build Path...
    2. Select Order and Export tab.
    3. Select external classes and move them to the top.

    On the remote wowza EC2 instance it still is not working and throws the below error. Bizarrely locally it works...

    ERROR 500 - invoke(onAppStart): 
    java.lang.NoSuchFieldError: INSTANCE: org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:52)
    Last edited by newtriks; 03-17-2014 at 09:13 AM.

  2. #2
    Join Date
    Dec 2007
    Posts
    22,013

    Default

    Reference ticket #85046

  3. #3

    Default

    I am yet to find the true cause of this issue, however, https://code.google.com/p/jarjar/ was the ultimate solution I resorted to...

  4. #4
    Join Date
    Mar 2011
    Posts
    18

    Default

    Hi,

    What does "Reference ticket #85046" ticket means?

  5. #5
    Join Date
    Mar 2011
    Posts
    18

    Default

    For me it works locally too. Just in production server it do not.

    Another strange think is that if the code is added in the init server listener it throws an exception, but if it is in another place it just kill the thread silently.

    It makes it very hard to debug.

  6. #6
    Join Date
    Mar 2011
    Posts
    18

    Default

    hi newtriks,

    your tip was great. Thanks.

    I fixed using maven shade plugin

    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>1.4</version>
    <executions>
    <execution>
    <phase>package</phase>
    <goals>
    <goal>shade</goal>
    </goals>
    <configuration>
    <shadedArtifactAttached>false</shadedArtifactAttached>
    <createDependencyReducedPom>true</createDependencyReducedPom>
    <artifactSet>
    <includes>
    <include>org.apache.httpcomponents:httpclient</include>
    <include>org.apache.httpcomponents:httpcore</include>
    </includes>
    </artifactSet>
    <relocations>
    <relocation>
    <pattern>org.apache.http</pattern>
    <shadedPattern>wowza.org.apache.http</shadedPattern>
    </relocation>
    </relocations>
    </configuration>
    </execution>
    </executions>
    </plugin>

Similar Threads

  1. How to update your plugin to newer versions of Wowza
    By nokturnal in forum Server-side Modules and Code Samples Discussion
    Replies: 4
    Last Post: 06-18-2013, 06:01 AM
  2. How to add external libraries in wowza app that work on standalone wowza server ?
    By rabelle.donovon in forum Server-side Modules and Code Samples Discussion
    Replies: 2
    Last Post: 07-13-2012, 07:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •