Results 1 to 6 of 6

Thread: Beginner - Errors following Wowza IDE Guide

  1. #1

    Default Beginner - Errors following Wowza IDE Guide

    Good morning,

    Before the Wowza Streaming Engine came out I followed the IDE Guide for Wowza Media Server. Do the same steps still apply? I have Eclipse installed and can go to New Project but it says "Wowza Media Server Project". Do I need to do any update for it to say "Wowza Streaming Engine"?

    Anywho I have been following the steps again since it has been a few months and I need a refreshed. I get to the point where it wants me to run the module from Eclipse so I shut down Wowza on my computer and hit run and get the following errors.
    Page 13 Server Startup as reference.

    Errors
    Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.SystemUtils
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 11 more

    All I have done so far is follow the instructions of creating the module and importing the ModuleServerSide.java so I don't think there is anything I could have really messed up yet.

    EnableDisable.java
    package com.mycompany.wms.module;
    
    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 EnableDisable extends ModuleBase {
    
    	public void doSomething(IClient client, RequestFunction function,
    			AMFDataList params) {
    		getLogger().info("doSomething");
    		sendResult(client, params, "Hello Wowza");
    	}
    
    	public void onAppStart(IApplicationInstance appInstance) {
    		String fullname = appInstance.getApplication().getName() + "/"
    				+ appInstance.getName();
    		getLogger().info("onAppStart: " + fullname);
    	}
    
    	public void onAppStop(IApplicationInstance appInstance) {
    		String fullname = appInstance.getApplication().getName() + "/"
    				+ appInstance.getName();
    		getLogger().info("onAppStop: " + fullname);
    	}
    
    	public void onConnect(IClient client, RequestFunction function,
    			AMFDataList params) {
    		getLogger().info("onConnect: " + client.getClientId());
    	}
    
    	public void onConnectAccept(IClient client) {
    		getLogger().info("onConnectAccept: " + client.getClientId());
    	}
    
    	public void onConnectReject(IClient client) {
    		getLogger().info("onConnectReject: " + client.getClientId());
    	}
    
    	public void onDisconnect(IClient client) {
    		getLogger().info("onDisconnect: " + client.getClientId());
    	}
    
    }
    ModuleServerSide.java
    package com.mycompany.wms.module;
    
    import java.util.*;
    
    import com.wowza.wms.module.*;
    import com.wowza.wms.client.*;
    import com.wowza.wms.amf.*;
    import com.wowza.wms.request.*;
    import com.wowza.wms.logging.*;
    
    public class ModuleServerSide extends ModuleBase
    {
    	// receiving simple parameters from the client
    	public void c2sParamsSimple(IClient client, RequestFunction function, AMFDataList params)
    	{
    		String res = "";
    		WMSLogger log = getLogger();
    
    		String param1 = getParamString(params, PARAM1);
    		int param2 = getParamInt(params, PARAM2);
    		boolean param3 = getParamBoolean(params, PARAM3);
    		Date param4 = getParamDate(params, PARAM4);
    
    		res += "param1: "+param1+"\n";
    		res += "param2: "+param2+"\n";
    		res += "param3: "+param3+"\n";
    		res += "param4: "+param4+"\n";
    
    		log.info(res);
    
    		sendResult(client, params, res);
    	}
    
    	// receiving an object from the client
    	public void c2sParamsObject(IClient client, RequestFunction function, AMFDataList params)
    	{
    		String res = "";
    		WMSLogger log = getLogger();
    
    		AMFDataObj param1 = (AMFDataObj)getParam(params, PARAM1);
    
    		// direct method for getting object properties
    		String val1 = param1.getString("val1");
    		int val2 = param1.getInt("val2");
    		boolean val3 = param1.getBoolean("val3");
    		Date val4 = param1.getDate("val4");
    
    
    		res += "\nDirect\n";
    		res += "param1: val1="+val1+"\n";
    		res += "param1: val2="+val2+"\n";
    		res += "param1: val3="+val3+"\n";
    		res += "param1: val4="+val4+"\n";
    
    		res += "\nInspect\n";
    
    		// method to inspect object to discover properties
    		List keys = param1.getKeys();
    		Iterator iter = keys.iterator();
    		while(iter.hasNext())
    		{
    			String key = (String)iter.next();
    			AMFDataItem value = (AMFDataItem)param1.get(key);
    			String typeStr = "unknown";
    
    			switch (value.getType())
    			{
    			default:
    			case AMFDataItem.DATA_TYPE_UNDEFINED:
    			case AMFDataItem.DATA_TYPE_UNKNOWN:
    			case AMFDataItem.DATA_TYPE_NULL:
    				typeStr = "null";
    				break;
    			case AMFDataItem.DATA_TYPE_NUMBER:
    				typeStr = "number";
    				// to extract value use intValue(), shortValue(), longValue(), doubleValue(), floatValue(), byteValue()
    				break;
    			case AMFDataItem.DATA_TYPE_BOOLEAN:
    				typeStr = "boolean";
    				// to extract value use booleanValue()
    				break;
    			case AMFDataItem.DATA_TYPE_STRING:
    				typeStr = "string";
    				break;
    			case AMFDataItem.DATA_TYPE_DATE:
    				typeStr = "date";
    				break;
    			}
    
    			res += "param1: "+key+"="+value.toString()+" ("+typeStr+")"+"\n";
    		}
    
    		log.info(res);
    
    		sendResult(client, params, res);
    	}
    
    	// receiving an array of strings from the client
    	public void c2sParamsArray(IClient client, RequestFunction function, AMFDataList params)
    	{
    		String res = "";
    		WMSLogger log = getLogger();
    
    		AMFDataMixedArray param1 = getParamMixedArray(params, PARAM1);
    
    		int len = param1.size();
    		for(int i=0;i<len;i++)
    		{
    			String value = param1.getString(i);
    			res += "param1: ["+i+":"+param1.getKey(i)+"]="+value+"\n";
    		}
    
    		log.info(res);
    
    		sendResult(client, params, res);
    	}
    
    	// receiving an array of objects from the client
    	public void c2sParamsArrayOfObjects(IClient client, RequestFunction function, AMFDataList params)
    	{
    		String res = "";
    		WMSLogger log = getLogger();
    
    		AMFDataMixedArray param1 = getParamMixedArray(params, PARAM1);
    
    		int len = param1.size();
    		for(int i=0;i<len;i++)
    		{
    			AMFDataObj valueObj = param1.getObject(i);
    			res += "param1: ["+i+":"+param1.getKey(i)+"]"+"\n";
    
    			String val1 = valueObj.getString("val1");
    			int val2 = valueObj.getInt("val2");
    			boolean val3 = valueObj.getBoolean("val3");
    			Date val4 = valueObj.getDate("val4");
    
    			res += "val1: "+val1+"\n";
    			res += "val2: "+val2+"\n";
    			res += "val3: "+val3+"\n";
    			res += "val4: "+val4+"\n";
    		}
    
    		log.info(res);
    
    		sendResult(client, params, res);
    	}
    
    	// returning a string to the client
    	public void c2sReturnString(IClient client, RequestFunction function, AMFDataList params)
    	{
    		String res = "";
    		WMSLogger log = getLogger();
    
    		res = "Hello Wowza";
    
    		log.info(res);
    
    		sendResult(client, params, res);
    	}
    
    	// returning an integer to the client
    	public void c2sReturnInt(IClient client, RequestFunction function, AMFDataList params)
    	{
    		String res = "";
    		WMSLogger log = getLogger();
    
    		int resInt = 4325;
    		res = "int="+resInt;
    
    		log.info(res);
    
    		sendResult(client, params, resInt);
    	}
    
    	// returning a boolean to the client
    	public void c2sReturnBoolean(IClient client, RequestFunction function, AMFDataList params)
    	{
    		String res = "";
    		WMSLogger log = getLogger();
    
    		boolean resBoolean = true;
    		res = "boolean="+resBoolean;
    
    		log.info(res);
    
    		sendResult(client, params, resBoolean);
    	}
    
    	// returning an array of strings
    	public void c2sReturnArray(IClient client, RequestFunction function, AMFDataList params)
    	{
    		String res = "";
    		WMSLogger log = getLogger();
    
    		AMFDataArray retArray = new AMFDataArray();
    
    		retArray.add(new AMFDataItem("Hello Wowza 1"));
    		retArray.add(new AMFDataItem("Hello Wowza 2"));
    		retArray.add(new AMFDataItem("Hello Wowza 3"));
    
    		res = retArray.toString();
    		log.info(res);
    
    		sendResult(client, params, retArray);
    	}
    
    	// returning an object to the client
    	public void c2sReturnObject(IClient client, RequestFunction function, AMFDataList params)
    	{
    		String res = "";
    		WMSLogger log = getLogger();
    
    		AMFDataObj retObj = new AMFDataObj();
    
    		retObj.put("val1", new AMFDataItem("Hello Wowza 1"));
    		retObj.put("val2", new AMFDataItem(3456));
    		retObj.put("val3", new AMFDataItem(true));
    
    		res = retObj.toString();
    		log.info(res);
    
    		sendResult(client, params, retObj);
    	}
    
    	// returning an array objects to the client
    	public void c2sReturnArrayOfObjects(IClient client, RequestFunction function, AMFDataList params)
    	{
    		String res = "";
    		WMSLogger log = getLogger();
    
    		AMFDataArray retArray = new AMFDataArray();
    		AMFDataObj retObj = null;
    
    		retObj = new AMFDataObj();
    		retObj.put("val1", new AMFDataItem("Hello Wowza 1"));
    		retObj.put("val2", new AMFDataItem(3456));
    		retObj.put("val3", new AMFDataItem(true));
    		retArray.add(retObj);
    
    		retObj = new AMFDataObj();
    		retObj.put("val1", new AMFDataItem("Hello Wowza 2"));
    		retObj.put("val2", new AMFDataItem(3457));
    		retObj.put("val3", new AMFDataItem(true));
    		retArray.add(retObj);
    
    		retObj = new AMFDataObj();
    		retObj.put("val1", new AMFDataItem("Hello Wowza 3"));
    		retObj.put("val2", new AMFDataItem(3458));
    		retObj.put("val3", new AMFDataItem(true));
    		retArray.add(retObj);
    
    		res = retArray.toString();
    		log.info(res);
    
    		sendResult(client, params, retArray);
    	}
    
    	// calling from the server to the client
    
    	public void s2cCallback(IClient client, RequestFunction function, AMFDataList params)
    	{
    		String handlerName = getParamString(params, PARAM1);
    
    		// calling the client and sending simple parameters
    		if (handlerName.equals("s2cParamsSimple"))
    		{
    			class s2cParamsSimpleResult extends ModuleBase implements IModuleCallResult
    			{
    				public void onResult(IClient client, RequestFunction function, AMFDataList params)
    				{
    					WMSLogger log = getLogger();
    					String param1 = getParamString(params, PARAM1);
    					log.info(param1);
    				}
    			}
    
    			client.call(handlerName, new s2cParamsSimpleResult(), "Hello Wowza", 1432, true, new Date());
    		}
    
    		// calling the client and sending an object
    		else if (handlerName.equals("s2cParamsObject"))
    		{
    			class s2cParamsObjectResult extends ModuleBase implements IModuleCallResult
    			{
    				public void onResult(IClient client, RequestFunction function, AMFDataList params)
    				{
    					WMSLogger log = getLogger();
    					AMFDataObj param1 = getParamObj(params, PARAM1);
    					log.info(param1.toString());
    				}
    			}
    
    			AMFDataObj retObj = new AMFDataObj();
    			retObj.put("val1", new AMFDataItem("Hello Wowza"));
    			retObj.put("val2", new AMFDataItem(3456));
    			retObj.put("val3", new AMFDataItem(true));
    
    			client.call(handlerName, new s2cParamsObjectResult(), retObj);
    		}
    
    		// calling the client and sending an array of strings
    		else if (handlerName.equals("s2cParamsArray"))
    		{
    			class s2cParamsArrayResult extends ModuleBase implements IModuleCallResult
    			{
    				public void onResult(IClient client, RequestFunction function, AMFDataList params)
    				{
    					WMSLogger log = getLogger();
    					AMFDataMixedArray param1 = getParamMixedArray(params, PARAM1);
    					log.info(param1.toString());
    				}
    			}
    
    			AMFDataArray retArray = new AMFDataArray();
    
    			retArray.add(new AMFDataItem("Hello Wowza 1"));
    			retArray.add(new AMFDataItem("Hello Wowza 2"));
    			retArray.add(new AMFDataItem("Hello Wowza 3"));
    
    			client.call(handlerName, new s2cParamsArrayResult(), retArray);
    		}
    
    		// calling the client and sending an array of objects
    		else if (handlerName.equals("s2cParamsArrayOfObjects"))
    		{
    			class s2cParamsArrayOfObjectsResult extends ModuleBase implements IModuleCallResult
    			{
    				public void onResult(IClient client, RequestFunction function, AMFDataList params)
    				{
    					WMSLogger log = getLogger();
    					AMFDataMixedArray param1 = getParamMixedArray(params, PARAM1);
    					log.info(param1.toString());
    				}
    			}
    
    			AMFDataArray retArray = new AMFDataArray();
    			AMFDataObj retObj = null;
    
    			retObj = new AMFDataObj();
    			retObj.put("val1", new AMFDataItem("Hello Wowza 1"));
    			retObj.put("val2", new AMFDataItem(3456));
    			retObj.put("val3", new AMFDataItem(true));
    			retArray.add(retObj);
    
    			retObj = new AMFDataObj();
    			retObj.put("val1", new AMFDataItem("Hello Wowza 2"));
    			retObj.put("val2", new AMFDataItem(3457));
    			retObj.put("val3", new AMFDataItem(true));
    			retArray.add(retObj);
    
    			retObj = new AMFDataObj();
    			retObj.put("val1", new AMFDataItem("Hello Wowza 3"));
    			retObj.put("val2", new AMFDataItem(3458));
    			retObj.put("val3", new AMFDataItem(true));
    			retArray.add(retObj);
    
    			client.call(handlerName, new s2cParamsArrayOfObjectsResult(), retArray);
    		}
    	}
    }

  2. #2

    Default

    You probably have the Wowza Transcoder enabled. Take a look at this article:
    How to use Wowza IDE with Wowza Transcoder AddOn

    Salvadore

  3. #3

    Default

    Thanks a ton Salvador! Though I now get this error in the console.

    INFO server comment - RESTServer: Bind attempt ([any]:8087)
    WARN server comment - RESTServer: Bind failed, try again ([any]:8087): java.net.BindException: Address already in use: bind|at sun.nio.ch.Net.bind0(Native Method)|at sun.nio.ch.Net.bind(Unknown Source)|at sun.nio.ch.Net.bind(Unknown Source)|at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)|at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)|

  4. #4

    Default

    Make sure Wowza is not already running before you start through Eclipse.

    Salvadore

  5. #5

    Default

    Oh duh! *facepalm* Thanks Salvadore.

  6. #6

    Default

    Great, sounds like you got it working. Glad I could help.

    Salvadore

Similar Threads

  1. Wowza Origin and Edge servers using Amazon CloudFront - Beginner
    By sajeenath in forum Wowza Media Server 3 for Amazon EC2 Discussion
    Replies: 1
    Last Post: 07-13-2013, 03:49 AM
  2. Replies: 1
    Last Post: 07-13-2013, 03:49 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
  •