Wowza Community

IApplicationInstance getModuleInstance(String name) does not work

This method does not work for me, it just returns null, I can see my module in the ApplicationInstance.modulelist debugger and it has the same name I am passing in.

I.e.

Object module = (Object)appInst.getModuleInstance(ModName);

Returns Null

FYI the below does work though

ModuleList ml = appInst.getModuleList();
Map<String, Object> mp = ml.getModuleItems();
Object module = mp.get(ModName);

Returns my Module object

Can you post your Application.xml and the module name you are using in the call to:

Object module = (Object)appInst.getModuleInstance(ModName);

Charlie

I just tried it and it is working for me. My server side code looks like this:

    public void getModuleInstance(IClient client, RequestFunction function, AMFDataList params)
    {
    	String moduleName = params.getString(PARAM1);
    	Object instance = client.getAppInstance().getModuleInstance(moduleName);
    	getLogger().info("getModuleInstance: "+instance);
    }

From the client I called:

nc.call("getModuleInstance", null, "base");

It returned this in the logs:

INFO server comment - getModuleInstance: com.wowza.wms.module.ModuleCore@e34726

Charlie

It’s a custom module, so this may not be much use.

<Module>
<Name>WowzaPlaylistPublisher</Name>
<Description>Playlist Publisher</Description>	<Class>com.mediaondemand.wowza.wms.plugin.integration.publish.WowzaPlaylistPublisher</Class>
</Module>

The ModName variable is got programmatically elsewhere, but is equal to “WowzaPlaylistPublisher”.

Just checked the Module code, seems to have reverted to an older version and is not actually running, so there’s no instance to grab:confused: Guess the getModuleList() does not actually return running instances of the module as the getModuleInstance() does. :frowning: