Hi all,

I've got some Filters running on JBoss-3.2.0/Tomcat-4.1.24 on Windows NT4,
JDK 1.4.0_01. Since  I there might be more than one occurence of a given
filter and I want to be able to alter certain settings of the filter, I've
cooked up the following code in the filter:

public void setAllowedContentTypes(String allowedContentTypes) {
    _allowedContentTypes = allowedContentTypes;
    Set allInstances = JmxUtil.getSiblings(this, _filterName);
    _log.info("["+ _filterName + "] allowed content types has been set to ["
+ allowedContentTypes + "].");
    Object[] parameters = {allowedContentTypes};
    String[] signature = {"java.lang.String"};
    for (Iterator i = allInstances.iterator(); i.hasNext();) {
      ObjectInstance objInstance = (ObjectInstance) i.next();
      JmxUtil.invokeOperation(objInstance.getObjectName(),
"setAllowedContentTypes", parameters, signature); // TODO solve error
    }
  }

This method is exposed in the MBean interface that is implemented by the
filter. I am able to call this method using the jmx-console just fine.
JmxUtil is a class that performs some simple JMX operations. getSiblings
returns a set of related objects. I can see in my log that the Filter
instance itself is found and returned. The call to JmxUtil.invokeOperation,
implemented as:

public static void invokeOperation(ObjectName objectName, String
operationName, Object[] params, String[] signature) {
    try {
      MBeanServer mBeanServer = getMBeanServer();
      mBeanServer.invoke(objectName, operationName, params, signature);
    } catch (Exception e) {
      _log.error("Could not perform operation [" + operationName + "] on ["
+ objectName.getCanonicalName() + "].", e);
    }
  }

throws an exception:

ReflectionException: null
Cause: java.lang.NoSuchMethodException: Unable to locate method for:
setAllowedContentTypes(,java.lang.String)
        at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispat
cher.java:288)
        at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
        at
nl.contrado.xmlbroker.filters.JmxUtil.invokeOperation(JmxUtil.java:121)
        at
nl.contrado.xmlbroker.filters.ContentTypeFilter.setAllowedContentTypes(Conte
ntTypeFilter.java:70)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.jboss.mx.capability.ReflectedMBeanDispatcher.setAttribute(ReflectedMBean
Dispatcher.java:186)
        at
org.jboss.mx.server.MBeanServerImpl.setAttribute(MBeanServerImpl.java:503)
        at
org.jboss.jmx.adaptor.control.Server.setAttributes(Server.java:192)
        at
org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.updateAttributes(HtmlAdaptorSe
rvlet.java:146)
        at
org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdaptorServ
let.java:76)
        at
org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doPost(HtmlAdaptorServlet.java
:60)
        [.......]

I'm especially puzzled by the , (comma) in front of the java.lang.String
parameter type. Any pointers?
        
TIA,
Jeroen


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to