Weird man. I swear I am doing the same thing. I know that there are n posts
on heree about how to do this, and they all suggest sort of the same thing. I
have been looking into this for a while now and I can't seem to get it. I have
the following in my jmx-invoker-service.xml (4.0.0):
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: jmx-invoker-service.xml,v 1.2 2004/11/22 23:54:46 muhr Exp $ -->
<!-- The JRMP invoker proxy configuration for the InvokerAdaptorService -->
<!-- Use the standard JRMPInvoker from conf/jboss-service.xxml -->
<depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp
<!-- The target MBean is the InvokerAdaptorService configured below -->
<depends
optional-attribute-name="TargetName">jboss.jmx:type=adaptor,name=Invoker
<!-- Where to bind the RMIAdaptor proxy -->
jmx/invoker/RMIAdaptor
<!-- The RMI compabitle MBeanServer interface -->
org.jboss.jmx.adaptor.rmi.RMIAdaptor,
org.jboss.jmx.adaptor.rmi.RMIAdaptorExt
org.jboss.proxy.ClientMethodInterceptor
org.jboss.proxy.SecurityInterceptor
org.jboss.jmx.connector.invoker.client.InvokerAdaptorClientInterceptor
org.jboss.invocation.InvokerInterceptor
<!-- ANOTHER ONE FOR SINGLETONS -->
<!-- Use the standard JRMPInvoker from conf/jboss-service.xxml -->
<depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp
<!-- The target MBean is the InvokerAdaptorService configured below -->
<depends
optional-attribute-name="TargetName">jboss.jmx:type=adaptor,name=Invoker
<!-- Where to bind the RMIAdaptor proxy -->
jmx/invoker/SingletonRMIAdaptor
<!-- The RMI compabitle MBeanServer interface -->
org.jboss.jmx.adaptor.rmi.RMIAdaptor,
org.jboss.jmx.adaptor.rmi.RMIAdaptorExt
org.jboss.proxy.ClientMethodInterceptor
org.jboss.proxy.SecurityInterceptor
org.jboss.jmx.connector.invoker.client.InvokerAdaptorClientInterceptor
org.jboss.invocation.InvokerInterceptor
<!-- Create a mapping from the legacy jmx-rmi-adaptor.sar binding to the
jmx-invoker-adaptor-server.sar JndiName specified above for backwards
portability.
jmx/rmi/RMIAdaptor
jmx/invoker/RMIAdaptor
-->
<!-- This is the service that handles the RMIAdaptor invocations by routing
them to the MBeanServer the service is deployed under. -->
<mbean code="org.jboss.jmx.connector.invoker.InvokerAdaptorService"
name="jboss.jmx:type=adaptor,name=Invoker"
xmbean-dd="">
The JMX Detached Invoker Service
org.jboss.jmx.connector.invoker.InvokerAdaptorService
<!-- Attributes -->
The class name of the MBean
Name
java.lang.String
The status of the MBean
State
int
The status of the MBean in text form
StateString
java.lang.String
The interfaces the invoker proxy supports
ExportedInterfaces
[Ljava.lang.Class;
Map(Long hash, Method) of the proxy interface methods
MethodMap
java.util.Map
<!-- Operations -->
The start lifecycle operation
start
The stop lifecycle operation
stop
The detyped lifecycle operation (for internal use only)
jbossInternalLifecycle
The lifecycle operation
method
java.lang.String
<return-type>void</return-type>
The detached invoker entry point
invoke
The method invocation context
invocation
org.jboss.invocation.Invocation
<return-type>java.lang.Object</return-type>
<!-- Uncomment to require authenticated users
-->
org.jboss.jmx.adaptor.rmi.RMIAdaptor,
org.jboss.jmx.adaptor.rmi.RMIAdaptorExt
<!-- MORE DUPLICATES FOR SINGLETONS -->
<mbean code="org.jboss.jmx.connector.invoker.InvokerAdaptorService"
name="jboss.jmx:type=adaptor,name=SingletonInvoker"
xmbean-dd="">
The JMX Detached Invoker Service
org.jboss.jmx.connector.invoker.InvokerAdaptorService
<!-- Attributes -->
The class name of the MBean
Name
java.lang.String
The status of the MBean
State
int
The status of the MBean in text form
StateString
java.lang.String
The interfaces the invoker proxy supports
ExportedInterfaces
[Ljava.lang.Class;
Map(Long hash, Method) of the proxy interface methods
MethodMap
java.util.Map
<!-- Operations -->
The start lifecycle operation
start
The stop lifecycle operation
stop
The detyped lifecycle operation (for internal use only)
jbossInternalLifecycle
The lifecycle operation
method
java.lang.String
<return-type>void</return-type>
The detached invoker entry point
invoke
The method invocation context
invocation
org.jboss.invocation.Invocation
<return-type>java.lang.Object</return-type>
<!-- Uncomment to require authenticated users
-->
org.jboss.jmx.adaptor.rmi.RMIAdaptor,
org.jboss.jmx.adaptor.rmi.RMIAdaptorExt
jboss:service=DefaultPartition
jboss.jmx:type=adaptor,name=SingletonInvoker
jboss.jmx:type=adaptor,name=SingletonInvoker
start
stop
Some suggest replacing the original configuration there, however doing this
makes the web-console die a horrible death on startup, so I merely added in the
deployment for my MBean. I have commented out the NamingAlias tags as has been
suggested elsewhere... seems to make no difference though. Seems to me
unreasonable that web-console and a HASingleton would not be allowed to run at
the same time. My current Servlet lookup code is as follows:
log.info("Attempting MBean lookup");
props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
props.put(Context.URL_PKG_PREFIXES,
"org.jboss.naming:org.jnp.interfaces");
InitialContext ctx = new InitialContext(props);
Object obj = ctx.lookup("jmx/invoker/SingletonRMIAdaptor");
if (!(obj instanceof RMIAdaptor))
{
throw new ClassCastException("Object not of type: RMIAdaptorImpl, but:
" + (obj == null ? "not found" : obj.getClass().getName()));
}
RMIAdaptor rmiAdaptor = (RMIAdaptor)obj;
log.info("DataManagerMBean deployed somewhere?
"+rmiAdaptor.isRegistered(new
ObjectName("ipdevco.common.mbean:service=DataManager")));
I have tried variants as well, using MBeanServer.
Every time the servlet runs from the box running the master server, the last
log statement indicates that the MBean is deployed and accessible. However
from every other machine in the cluster this check fails. I have left the
Provider URL out of the Properties in this example, though it seems to make no
differenct whether I specify localhost:1100, "", :1100, or a static string of
IPs representing each of the machines in the cluster (running in the default
partition). I simply cannot get acess to this MBean when it runs on another
server in the cluster.
Now, the servers are running instances of the same app .ear in the all/deploy
directory, and the SAR containing the MBean is in the deploy-hasingleton dir.
For measure, the entries in the SAR jboss-service.xml are:
<!-- HASingletonController to make DataManagerMBean run as a HASingleton -->
ipdevco.common.mbean:service=DataManager
start
stop
true
jboss:service=DefaultPartition
ipdevco.common.mbean:service=DataManager
I thought maybe there was a way to get a handle to each machine in the cluster
and force the thing to manually cycle through them and .... well, just seems
like that's too much, esp. since some of y'all have got this kicking.
I realize this to be something that should be relatively straightforward, and
undoubtedly the intention of the JBoss dev group was to make it so. I conclude
that I must have completely missed something, somewhere. Anyone know what it
is?
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3856013#3856013
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3856013
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user