Results 1 to 3 of 3

Thread: JMX Problem

  1. #1
    Join Date
    Aug 2012
    Posts
    9

    Default JMX Problem

    I want to use JMXClient to get/set connectionLimit in my custom module JMXModule.

    JMXModule code:
    public class JMXModule extends ModuleBase
    {
    	private int connectionLimit  = 100;
    	
    	public int getConnectionLimit()
    	{
    		return this.connectionLimit;
    	}
    	
    	public void setConnectionLimit(int connectionLimit)
    	{
    		this.connectionLimit = connectionLimit;
    	}
    	
    	public void logSomething(String logStr)
    	{
    		getLogger().info("logSomething: "+logStr);
    	}
    }
    I've modified code ( http://www.wowza.com/forums/content.php?175 ), added functionality to handle jmxtest module:
    			else if (args[argOffset].equalsIgnoreCase(CMD_JMXTEST))
    			{
    				System.out.println("Record: #1) args[argOffset] " + args[argOffset] + " #2) args[argOffset+1] " + args[argOffset+1] + " #3) args[argOffset+2] " + args[argOffset+2] );
    				AppConextName context = new AppConextName(args[argOffset+1], true);
    				
    				//WowzaMediaServerPro:vHosts=VHosts,vHostName=_defaultVHost_,applications=Applications,applicationName=jmxtest,applicationInstances=ApplicationInstances,applicationInstanceName=_definst_,modules=Modules,module=JMXModule,name=Module
    				
    				String connectsName = MBEANNAME+":vHosts=VHosts,vHostName="+context.vhostName+",applications=Applications,applicationName="+context.appName+",applicationInstances=ApplicationInstances,applicationInstanceName="+context.appInstName+",modules=Modules,module=JMXModule,name=Module";
    				ObjectName connectsObjName = new ObjectName(connectsName);
    
    				// pass 0 and true as second and third arguments
    				Object[] arguments = {args[argOffset+2]};
    				String[] signature = {"int"}; //, "int", "boolean", "java.lang.String"
    				doInvoke(connection, connectsObjName, "setConnectionLimit", arguments, signature);
    			}
    Here is the command I am running:
    jmxtest jmxtest 120
    Here is the output I'm getting at the command line:
    Record: #1) args[argOffset] jmxtest #2) args[argOffset+1] jmxtest #3) args[argOffset+2] 120
    ERROR: doInvoke: javax.management.MBeanException: Cannot find operation setConnectionLimit
    Any ideas ?

  2. #2
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Is the Module loading correctly? Are your command line args correct for the application where it is installed? Are there any corresponding log messages in Wowza?

    Richard

  3. #3
    Join Date
    Aug 2012
    Posts
    9

    Default

    Quote Originally Posted by rrlanham View Post
    Is the Module loading correctly? Are your command line args correct for the application where it is installed? Are there any corresponding log messages in Wowza?
    Richard
    Before running the command
    jmxtest jmxtest 120.
    I started jmxtest application:
    startAppInstance jmxtest
    returnObj: true
    Wowza log says:
    app-start application INFO 200 _definst_ jmxtest/_definst_ - - - 106.096
    What do you mean loading correctly ?

Similar Threads

  1. JMX NotificationEmitter problem: addNotificationListener of the Module is not invoked
    By Maurok in forum Server-side Modules and Code Samples Discussion
    Replies: 3
    Last Post: 11-16-2011, 08:20 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
  •