Hi,

You will find an example for load balancing an MBean
in the jmx tests in the testsuite of 3.2.2
There is now a generic HA proxy factory extending the
one described in Chapter 2 of the admin docs.

To avoid your particular problem, you'll need
something similar to the clean shutdown interceptor
that is available for ejbs, except as an XMBean interceptor.

Regards,
Adrian

On Wed, 2003-11-12 at 21:01, Nicholas wrote:
> I figured out what I was doing wrong after some
> drifting through the source code. Anyways, now it load
> balances fine.
> 
> (Instead of sourceObject.getClass(), I used
> org.jboss.jmx.adaptor.rmi.RMIAdaptor.class.)
> 
> However, I observed that when I tried to test the
> failover by stopping one of my servers, the call to
> the **stopping** server failed saying
> 
> Cause: javax.management.InstanceNotFoundException:
> myDomain:name=SyncProcess is not registered.
> 
> Obviously the call went in after my MBean had been
> unregistered, but before the RMI service had stopped.
> 
> Other than implementing a retry loop in the client,
> can anyone recommend a solution to this ?
> 
> Thanks.
> 
> //Nicholas
> 
> --- Nicholas <[EMAIL PROTECTED]> wrote:
> > I am trying to set up a cluster of MBean services
> > where we have a set of custom MBeans. I would like
> > to
> > use load balancing and failover for the MBean
> > clients,
> > but it I realize that jmx/rmi/RMIAdaptor is not "HA
> > ready".  (Using 3.2.1, 3.2.2 and 3.2.3RC1)
> > 
> > Reviewing the docs, I tried to implement this
> > example:
> > 
> > HAPartition myPartition =
> > (HAPartition)ctx.lookup(Â/HAPartition/Â +
> > partitionName); 
> > HARMIServer rmiserver = new
> > HARMIServerImpl(myPartition, "MyService",
> > MyService.class, myService); 
> > MyService stub =
> > (MyService)rmiserver.createHAStub(new
> > RoundRobin());
> > 
> > I am not sure if this is the right way to go, but
> > screw the torpedoes....
> > 
> > The first thing I ran into is that although
> > HARMIServerImpl implements createHAStub(), the
> > interface HARMIServer does not. 
> > 
> > So I did this:
> > 
> > Object sourceObject =
> > ctx.lookup("jmx/rmi/RMIAdaptor");
> > HAPartition myPartition =
> > (HAPartition)ctx.lookup("/HAPartition/" +
> > partitionName);
> > HARMIServer rmiserver = new
> > HARMIServerImpl(myPartition, "HARMIAdaptor",
> > sourceObject.getClass(), sourceObject);
> > // Here I cast the HARMIServer to a HARMIServerImpl 
> > org.jboss.jmx.adaptor.rmi.RMIAdaptor stub =
> >
> (org.jboss.jmx.adaptor.rmi.RMIAdaptor)((HARMIServerImpl)rmiserver).createHAStub(new
> > RoundRobin());
> > 
> > Then I take the stub and bind it back into JNDI
> > where
> > I can retrieve it later.
> > 
> > Well it compiled fine......(famous last words), but
> > at
> > runtine I get this error:
> > 
> > java.lang.IllegalArgumentException: $Proxy25 is not
> > an
> > interface
> >         at
> >
> java.lang.reflect.Proxy.getProxyClass(Proxy.java:340)
> >         at
> >
> java.lang.reflect.Proxy.newProxyInstance(Proxy.java:552)
> >         at
> >
> org.jboss.ha.framework.server.HARMIServerImpl.createHAStub(HARMIServerImpl.java:184)
> >         at
> >
> com.adp.sbs.jboss.ha.HAExporter.start(HAExporter.java:58)
> > 
> > Am I going in the right direction ?
> > 
> > Thanks.
> > 
> > //Nicholas
> > 
> > 
> >
> -------------------------------------------------------
> > This SF.Net email sponsored by: ApacheCon 2003,
> > 16-19 November in Las Vegas. Learn firsthand the
> > latest
> > developments in Apache, PHP, Perl, XML, Java, MySQL,
> > WebDAV, and more! http://www.apachecon.com/
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> >
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 
> 
> =====
> Nicholas Whitehead
> Home: (973) 377 9335
> Cell: (201) 615 2716
> [EMAIL PROTECTED]
> Get Your News From The Crowbar: http://crowbar.dnsalias.com:443/crowbar/
> 
> 
> -------------------------------------------------------
> This SF.Net email sponsored by: ApacheCon 2003,
> 16-19 November in Las Vegas. Learn firsthand the latest
> developments in Apache, PHP, Perl, XML, Java, MySQL,
> WebDAV, and more! http://www.apachecon.com/
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
-- 
xxxxxxxxxxxxxxxxxxxxxxxx 
Adrian Brock
Director of Support
Back Office
JBoss Group, LLC 
xxxxxxxxxxxxxxxxxxxxxxxx 



-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to