wood burning stoves 2.0*
The moose likes JBoss/WildFly and the fly likes Migration issues from JBOSS previous versions to JBOSS4.0.5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Migration issues from JBOSS previous versions to JBOSS4.0.5" Watch "Migration issues from JBOSS previous versions to JBOSS4.0.5" New topic
Author

Migration issues from JBOSS previous versions to JBOSS4.0.5

Faisal Ahmed Siddiqui
Greenhorn

Joined: Jan 03, 2002
Posts: 29
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


Architect<br />SCJP<br />SCWCD<br />IBM-486
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9947
    
161

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.


[My Blog] [JavaRanch Journal]
Faisal Ahmed Siddiqui
Greenhorn

Joined: Jan 03, 2002
Posts: 29
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

Joined: Jan 03, 2002
Posts: 29
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Migration issues from JBOSS previous versions to JBOSS4.0.5
 
Similar Threads
Stateless Session Bean on JBOSS4.0.5 using EJB2.0 Spec.
How to retrieve the Jnp or RMi port of JBoss server
Application start through JMX fails for JBoss5xx
Problem with JBOSS4.0.5 EJB Server Its not starting - error during deploy
Error during Migrating from Jboss4.0.5.GA to Jboss5.0.0.GA