Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Migration issues from JBOSS previous versions to JBOSS4.0.5

 
Faisal Ahmed Siddiqui
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey i have made an application which clustered enabled. but i am facing few issues while porting it onto jBOSS4.0.5, its perfectly running in JBOSS-3.2.6

1-HARMIProxyCallBack interface not found, in JBOSS-4.0.5 what is the alternate of it.
2-getting error while invoking on

context = new InitialContext();
adaptor = (RMIAdaptor) context.lookup("jmx/rmi/RMIAdaptor");
ObjectName objName = new ObjectName("txt:config=Core");
Object obj = adaptor.invoke(objName, "getCoreDBSource",null, null);
this piece of code is working fine in 3.2.6 version.
3-is there any difference in dynamic invocation of MBean in JBOSS-4.0.5
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
context = new InitialContext();
adaptor = (RMIAdaptor) context.lookup("jmx/rmi/RMIAdaptor");


I believe, there's been change in the way you lookup this in JBoss. Have a look at HowDoIGetRemoteAccessToMyMBean which mentions:

Note: Use the MBeanServerConnection interface rather than RMIAdaptor on the most recent versions of JBoss.


That link contains a sample code which shows how to do the lookup for the MBeanServerConnection.
 
Faisal Ahmed Siddiqui
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, for your reply..
after using the
MBeanServerConnection server = (MBeanServerConnection) ctx.lookup("jmx/invoker/RMIAdaptor");
still getting error
javax.management.ReflectionException
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvo

at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:6

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorI

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodA

at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.jmx.connector.invoker.InvokerAdaptorService.invoke(Invo

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorI

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodA

at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDisp

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInter

at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)

where as, it's running perfect on jboss.3.2.6 with RMIAdaptor.
is there any need... to extend Bean from certain classes or implement any interface?
my MBean is very simple..
extending HAServiceMBeanSupport and implementing NotificationListener.
 
Faisal Ahmed Siddiqui
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ooh.. at last i have got the solution ... dynamic MBean invocation problem..
you people know what was that..
refer the wiki.
http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingTheRMIAdaptor
but the mistake i was doing is i was invoking an operation defined as attribute
my MBean had the property named dataSourceName and i was calling its getter method getDataSourceName through invoke.
its working in jboss3.2.6 but not in jboss4.0.5.
then i called the property through server.getAttribute() it was working..
later i create another operation like getInfo in my MBean as well as in my xml file. and called it dynamically through invoke. it was also running...
conclusion i come with..
1- use MBeanConnection instead of RMIAdaptor
2- use getAttribute,setAttribute in order to access your attribues.
3- use dynamic invocation where it requires, since its bit costly in term of processing resolving objectName.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic