Thanks for your reply. In the meantime I have tried to implement a clustered
MBean with Round Robin scheduling (I found the a message where the poster
claims he has done this at
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3834455#3834455).
I have created an MBean (WorkflowControllerService) which extends the
HAServiceMBeanSupport class, and exposes a test() method. The
jboss-service.xml of the MBean looks as follows
| <?xml version="1.0" encoding="UTF-8"?>
|
| <server>
|
| <!-- Create JRMPHA proxy for our service -->
| <mbean code="org.jboss.proxy.generic.ProxyFactoryHA"
name="jboss.test:service=ProxyFactory,name=HAService,protocol=jrmpha">
|
| <!-- Use the default partition -->
| <depends
optional-attribute-name="PartitionObjectName">jboss:service=DefaultPartition</depends>
|
| <!-- Use the standard JRMPInvoker from conf/jboss-service.xml -->
| <depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmpha</depends>
|
| <!-- The load balancing policy -->
| <attribute
name="LoadBalancePolicy">org.jboss.ha.framework.interfaces.RoundRobin</attribute>
|
| <!-- The target MBean -->
| <depends
optional-attribute-name="TargetName">arsenal.at:service=WorkflowController</depends>
|
| <!-- Where to bind the proxy -->
| <attribute name="JndiName">MUH</attribute>
|
| <!-- The interface exposed to the client -->
| <attribute
name="ExportedInterface">at.arsenal.spirit.services.workflow.WorkflowControllerServiceMBean</attribute>
|
| <!-- Client side behaviour -->
| <attribute name="ClientInterceptors">
| <interceptors>
|
<interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
|
<interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
| </interceptors>
| </attribute>
| </mbean>
|
|
| <mbean
code="at.arsenal.spirit.services.workflow.WorkflowControllerService"
name="arsenal.at:service=WorkflowController">
|
| <depends>
| jboss:service=HAJNDI
| </depends>
| </mbean>
| </server>
|
The service can be deployed just fine, and when I do a lookup I get a valid
reference to a JRMPInvokerProxyHA class. But if I try to invoke the test()
method on the Proxy I get an exception. Example code and exception follow:
| WorkflowControllerServiceMBean controller =
(WorkflowControllerServiceMBean)ctx.lookup("MUH"); //lookup proxy
| log.debug("Calling Test Method on Controller");
| controller.test(); //exception here
|
The exception which is thrown is:
|
| 08:48:01,000 INFO [STDOUT] java.lang.IllegalArgumentException: null object
name
| 08:48:01,000 INFO [STDOUT] at
org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:494)
| 08:48:01,001 INFO [STDOUT] at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:638)
| 08:48:01,002 INFO [STDOUT] at
org.jboss.invocation.jrmp.server.JRMPInvokerHA.invoke(JRMPInvokerHA.java:163)
| 08:48:01,002 INFO [STDOUT] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 08:48:01,003 INFO [STDOUT] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 08:48:01,003 INFO [STDOUT] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 08:48:01,003 INFO [STDOUT] at
java.lang.reflect.Method.invoke(Method.java:585)
| 08:48:01,004 INFO [STDOUT] at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
| 08:48:01,004 INFO [STDOUT] at
sun.rmi.transport.Transport$1.run(Transport.java:153)
| 08:48:01,005 INFO [STDOUT] at
java.security.AccessController.doPrivileged(Native Method)
| 08:48:01,005 INFO [STDOUT] at
sun.rmi.transport.Transport.serviceCall(Transport.java:149)
| 08:48:01,006 INFO [STDOUT] at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
| 08:48:01,006 INFO [STDOUT] at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
| 08:48:01,007 INFO [STDOUT] at java.lang.Thread.run(Thread.java:595)
| 08:48:01,007 INFO [STDOUT] at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
| 08:48:01,008 INFO [STDOUT] at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
| 08:48:01,008 INFO [STDOUT] at
sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
| 08:48:01,008 INFO [STDOUT] at
org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
| 08:48:01,009 INFO [STDOUT] at
org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxyHA.invoke(JRMPInvokerProxyHA.java:172)
| 08:48:01,009 INFO [STDOUT] at
org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:227)
| 08:48:01,010 INFO [STDOUT] at
org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:167)
| 08:48:01,010 INFO [STDOUT] at
org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:59)
| 08:48:01,011 INFO [STDOUT] at
org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
| 08:48:01,013 INFO [STDOUT] at $Proxy63.test(Unknown Source)
| 08:48:01,014 INFO [STDOUT] at
at.arsenal.spirit.request.RequestListenerServlet.service(RequestListenerServlet.java:80)
| 08:48:01,014 INFO [STDOUT] at
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| 08:48:01,014 INFO [STDOUT] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| 08:48:01,015 INFO [STDOUT] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| 08:48:01,015 INFO [STDOUT] at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
| 08:48:01,016 INFO [STDOUT] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| 08:48:01,016 INFO [STDOUT] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| 08:48:01,017 INFO [STDOUT] at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| 08:48:01,017 INFO [STDOUT] at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| 08:48:01,018 INFO [STDOUT] at
org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
| 08:48:01,018 INFO [STDOUT] at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
| 08:48:01,019 INFO [STDOUT] at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
| 08:48:01,019 INFO [STDOUT] at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| 08:48:01,019 INFO [STDOUT] at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| 08:48:01,020 INFO [STDOUT] at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| 08:48:01,020 INFO [STDOUT] at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| 08:48:01,021 INFO [STDOUT] at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
| 08:48:01,021 INFO [STDOUT] at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
| 08:48:01,022 INFO [STDOUT] at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| 08:48:01,022 INFO [STDOUT] at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| 08:48:01,023 INFO [STDOUT] at java.lang.Thread.run(Thread.java:595)
|
|
I traced the exception and the root cause seems to be the following: An
Invocation object is created, which contains -among other things- the invoked
method name, invocation context and an objectName Integer field, which seems to
contain some kind of hash value. In the invoke() method of the JRMPInvokerHA
class, a lookup is done to get the ObjectName which is associated with this
hash Value:
| Integer beanNameHash = (Integer) invocation.getObjectName();
| ObjectName mbean = (ObjectName) Registry.lookup(beanNameHash);
|
(http://www.cenqua.com/clover/eg/jboss/report/org/jboss/invocation/jrmp/server/JRMPInvokerHA.html
, Line 194 )
This lookup returns null in my tests, and thus causes the subsequent
exception.. I checked the HashValue in the objectName field and tried to find
it in the org.jboss.sysetm.Registry.entries Map manually, but it is not there.
So my theory is that the actual MBean that should be called by the proxy is not
registered.. As I am completely new to JBoss and clustering i would be most
thankful if someone could tell me what I am doing wrong here, or maybe point me
to the sourcecode of a complete example which uses the HAServiceMBeanSupport
class.
Thanks for your time. :-)
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3926479#3926479
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3926479
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user