Results 1 to 2 of 2

Thread: invoke(publish) and invoke(release) error for custom module

  1. #1
    Join Date
    Aug 2015
    Posts
    9

    Default invoke(publish) and invoke(release) error for custom module

    Created a custom module to match a streamName with a applicationProperty name
    Getting the following errors

    invoke(publish): java.lang.reflect.InvocationTargetException|at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)|at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)|at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)|at java.lang.reflect.Method.invoke(Method.java:483)|at com.wowza.wms.module.ModuleFunction.invoke(ModuleFunction.java:369)|
    
    invoke(releaseStream): java.lang.reflect.InvocationTargetException|at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)|at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)|at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)|at java.lang.reflect.Method.invoke(Method.java:483)|at com.wowza.wms.module.ModuleFunction.invoke(ModuleFunction.java:369)|
    The module is custom.jar (in WMSPATH/lib/ folder) and is as follows

    package custom;
    
    import com.wowza.wms.application.*;
    import com.wowza.wms.amf.*;
    import com.wowza.wms.client.*;
    import com.wowza.wms.module.*;
    import com.wowza.wms.request.*;
    import com.wowza.wms.stream.*;
    import com.wowza.wms.rtp.model.*;
    import com.wowza.wms.httpstreamer.model.*;
    import com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.*;
    import com.wowza.wms.httpstreamer.smoothstreaming.httpstreamer.*;
    
    public class ModuleOverride extends ModuleBase {
    
    		IApplicationInstance appInstance = null;
    		public void onAppStart(IApplicationInstance appInstance)
    	{
    		this.appInstance = appInstance;
    	}
    	
    		public void publish(IClient client, RequestFunction function,
    		        AMFDataList params) {
    			getLogger().info("Overriding Publish");
    			
    			String allowedStream = client.getProperties().getPropertyStr("allowedStream");
    			
    			String streamName = extractStreamName(client, function, params);
    			
    			if (allowedStream.equals(streamName))
    			{
    				invokePrevious(client, function, params);
    			} else {
    				sendClientOnStatusError(client, "NetStream.Publish.BadName", "Invalid Stream Name");
    				getLogger().info("Stream Name Rejected: " + streamName);
    			}
    		}
    
    	public void releaseStream(IClient client, RequestFunction function, AMFDataList params)
    		{
    			String streamName = extractStreamName(client, function, params);
    			
    			String allowedStream = client.getProperties().getPropertyStr("allowedStream");
    			if (allowedStream.equals(streamName))
    			{
    				invokePrevious(client, function, params);
    			}	else {
    				sendClientOnStatusError(client, "NetStream.Publish.BadName", "Invalid Stream Name");
    				getLogger().info("Stream Name Rejected: " + streamName);
    			}	
    		}
    		
    		public String extractStreamName(IClient client, RequestFunction function, AMFDataList params)
    	{
    		String streamName = params.getString(PARAM1);
    		if (streamName != null)
    		{
    			String streamExt = MediaStream.BASE_STREAM_EXT;
    			
    			String[] streamDecode = ModuleUtils.decodeStreamExtension(streamName, streamExt);
    			streamName = streamDecode[0];
    			streamExt = streamDecode[1];
    			
    			streamName = streamName.split("\\?")[0];
    		}
    
    		return streamName;
    	}
    }

    Application.xml (for live application) has the following added at their relevant place:

    <Module>
            <Name>CustomOverrides</Name>
            <Description>Override publish</Description>
            <Class>custom.ModuleOverride</Class>
    </Module>
    
    <Property>
            <Name>allowedStream</Name>
            <Value>live</Value>
    </Property>

  2. #2
    Join Date
    Aug 2015
    Posts
    9

    Default

    Just to add, I created the module using a Windows IDE and the actual WMS server (and the module) is on a linux server

Similar Threads

  1. ModuleBase methods invoke error
    By pirateMan in forum General Forum
    Replies: 4
    Last Post: 01-20-2015, 07:47 AM
  2. Weird Error invoke(onHTTPCupertinoEncryptionKeyLiveChunk)
    By f.hernandez.b in forum Wowza Streaming Server Java API
    Replies: 1
    Last Post: 07-08-2014, 08:06 PM
  3. Adding a custom log file and custom log fields.
    By arkroan in forum Server Administration Discussion
    Replies: 17
    Last Post: 01-28-2014, 05:59 AM
  4. Replies: 1
    Last Post: 04-17-2013, 05:58 AM
  5. Server Listener Stream Publish module (java error, should I be concerned?)
    By stefancaunter in forum Live Streaming and Encoder Discussion
    Replies: 3
    Last Post: 10-11-2011, 06:28 PM

Posting Permissions

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