• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Migration issues from JBOSS previous versions to JBOSS4.0.5

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Self destruct mode activated. Instructions for deactivation encoded in this tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic