Results 1 to 2 of 2

Thread: can't connect to app after referencing new module

  1. #1

    Default can't connect to app after referencing new module

    Hello, i've created a (simple) new module on the ide. it works fine locally, but after uploading the new jar to the lib folder and editing my application.xml file to reference the new module, i can't connect any more to my new app. there is nothing in the logs, no errors, no messages. and i can still connect to other apps.

    here is my module code:

    package com.xxx.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.sharedobject.ISharedObject;
    import com.wowza.wms.sharedobject.ISharedObjects;
    import com.wowza.wms.sharedobject.SharedObject;
    
    public class XXXLiveAgent extends ModuleBase {
    
    	static public final String CONNECTEDUSERS_SONAME = "connectedUsersSO";
    	
    //	public void doSomething(IClient client, RequestFunction function,
    //			AMFDataList params) {
    //		getLogger().info("doSomething");
    //		sendResult(client, params, "Hello Wowza");
    //	}
    
    	public void onAppStart(IApplicationInstance appInstance) {
    		// Create a shared object to keep track of the connected users
    				ISharedObjects sharedObjects = appInstance.getSharedObjects(false);
    				ISharedObject connectedUsersSO = new SharedObject(CONNECTEDUSERS_SONAME);
    				sharedObjects.put(CONNECTEDUSERS_SONAME, connectedUsersSO);
    				
    				connectedUsersSO.lock();
    				try
    				{
    					connectedUsersSO.acquire();
    				}
    				catch (Exception e)
    				{
    					
    				}
    				finally
    				{
    					connectedUsersSO.unlock();
    				}
    				//getLogger().info("onAppStart: create shared object: "+CONNECTEDUSERS_SONAME);
    	}
    
    	public void onAppStop(IApplicationInstance appInstance) {
    ISharedObjects sharedObjects = appInstance.getSharedObjects(false);
    		
    		// release the shared object when the application stops
    		ISharedObject connectedUsersSO = sharedObjects.get(CONNECTEDUSERS_SONAME);
    		if (connectedUsersSO != null)
    		{
    			//getLogger().info("onAppStop: release shared object: "+CONNECTEDUSERS_SONAME);
    			connectedUsersSO.lock();
    			try
    			{
    				connectedUsersSO.release();
    			}
    			catch (Exception e)
    			{
    				
    			}
    			finally
    			{
    				connectedUsersSO.unlock();
    			}
    		}
    	}
    
    	public void onConnect(IClient client, RequestFunction function,
    			AMFDataList params) {
    		//getLogger().info("onConnect: " + client.getClientId());
    	}
    
    	public void onConnectAccept(IClient client) {
    		ISharedObjects sharedObjects = getAppInstance(client).getSharedObjects(false);
    		ISharedObject connectedUsersSO = sharedObjects.get(CONNECTEDUSERS_SONAME);
    		if (connectedUsersSO != null)
    		{
    			connectedUsersSO.lock();
    			try
    			{
    				//getLogger().info("onConnectAccept: add property: "+client.getClientId());
    				String propName = "c"+client.getClientId();
    				connectedUsersSO.setProperty(propName, "connected");
    				
    			}
    			catch (Exception e)
    			{
    				
    			}
    			finally
    			{
    				connectedUsersSO.unlock();
    			}
    			
    		}
    	}
    
    	public void onConnectReject(IClient client) {
    		//getLogger().info("onConnectReject: " + client.getClientId());
    	}
    
    	public void onDisconnect(IClient client) {
    		// When the client is disconnected remove the property from the shared object
    				getLogger().info("onDisconnect: "+client.getClientId());
    				ISharedObjects sharedObjects = getAppInstance(client).getSharedObjects(false);
    				ISharedObject connectedUsersSO = sharedObjects.get(CONNECTEDUSERS_SONAME);
    				
    				String fullID = getAppInstance(client).getName();
    				String fullname = getAppInstance(client).getApplication().getName();
    				
    				//getLogger().info("Datas: "+fullname+"-"+fullID);
    				
    				if (connectedUsersSO != null)
    				{
    					synchronized(connectedUsersSO)
    					{
    						connectedUsersSO.lock();
    						try
    						{
    							//getLogger().info("onDisconnect: remove property: "+client.getClientId());
    							String propName = "c"+client.getClientId();
    							connectedUsersSO.deleteSlot(propName);
    							connectedUsersSO.purge(connectedUsersSO.getVersion()-200);
    							//updateStats(client,updateStats(),propName);
    						}
    						catch (Exception e)
    						{
    							
    						}
    						finally
    						{
    							connectedUsersSO.unlock();
    						}
    					}
    				}
    	}
    
    	public void onCall(String handlerName, IClient client, RequestFunction function, AMFDataList params) {
    		//getLogger().info("onCall: " + handlerName);
    		
    	}
    	
    	// returning a string to the client
    //		public void c2sReturnString(IClient client, RequestFunction function, AMFDataList params)
    //		{
    //			String res = "";
    //			getLogger().info("onCall Return: " + client+"/"+function+"/"+params);
    //			res = "Hello Wowza";
    //			sendResult(client, params, res);
    //		}
    		
    		public void sendToClient(IClient client, RequestFunction function, AMFDataList params)
    		{
    			AMFDataObj Params = (AMFDataObj)getParam(params,PARAM1);
    			String action = Params.getString("action");
    			String pID = Params.getString("pID");
    			String message = Params.getString("message");
    			String senderID = Params.getString("senderID");
    			int whichClient = Params.getInt("destID");
    			IClient destID = client.getAppInstance().getVHost().getClient(whichClient);
    			
    			getLogger().info("onCall Return: " + client+"/"+function+"/"+params+"/"+pID+"/"+destID+"/"+message+"adminID: "+whichClient);
    			
    			AMFDataObj obj = new AMFDataObj();
    			obj.put("action", new AMFDataItem(action));
    			obj.put("pID", new AMFDataItem(pID));
    			obj.put("message", new AMFDataItem(message));
    			obj.put("destID", new AMFDataItem(whichClient));
    			obj.put("senderID", new AMFDataItem(senderID));
    
    			destID.call("serverMethod", null, obj);			
    		}
    
    }
    and i added in my application.xml:

    <Module>
    				<Name>XXXLiveAgent</Name>
    				<Description>XXXLiveAgent</Description>
    				<Class>com.xxx.wms.module.XXXLiveAgent</Class>
    			</Module>
    i've upgraded to 3.5.2

    any idea welcome
    Last edited by gabole29; 03-04-2013 at 10:45 PM.

  2. #2

    Default

    update: upgrading my java version solved the problem. i believe this is because on my dev machine i have java 7 installed as dev environement, and my server was still running java 6...bouuuuu

Similar Threads

  1. How to start custom module app before initial access
    By jachai in forum General Forum
    Replies: 4
    Last Post: 02-20-2014, 09:10 AM
  2. app instance hangs on mysql connect error
    By gabole29 in forum General Forum
    Replies: 6
    Last Post: 03-24-2012, 09:34 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
  •