You cannot get a reference. Instead, all operations on an mbean must be done
through the MBeanServerConnection instance. Thus, to make the example method
call, you would write:
ObjectName name = new ObjectName(--name of your 'world' mbean--);
| mconn.invoke(name, tell, null, null);
See
ok, I get that now
How would I be able to do something like:
Beanname.methodxyz();
e.g.:
world.tell();
i.e. How can I get a reference?
Sorry if that is already explained and I'm just missing it.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3953169#3953169
Hi,
executing
if (System.getSecurityManager() == null) {
| System.setSecurityManager(new
RMISecurityManager());
| }
| Hashtable env = new Hashtable();
| String factory =
Oops, my instructions were not completely correct. The correct data source
name is DefaultDS, not ds/DefaultDS.
The easiest way to find out the name of the mbean you are looking for it to use
the jmx-console: http://localhost:8080/jmx-console. Then you simple replace
the object name text
Thank you so much for pointing that out.
One more problem remains:
How do i get my stub?
Currently I'm using the following code: (World being the ManagementInterface of
the Bean I want to use)
if (System.getSecurityManager() == null) {
| System.setSecurityManager(new
See http://www.jboss.com/index.html?module=bbop=viewtopict=84303 for a
complete program. The mbean name I used was based on my data source, but you
could subsistutue DefaultDS for ProductDS and it should work. Or pick a name
from the jmx-console.
View the original post :
@PeterJ:
Executing your code leads to the following:
anonymous wrote : javax.naming.CommunicationException [Root exception is
java.lang.ClassNotFoundException: org.jboss.jmx.adaptor.rmi.RMIAdaptor (no
security manager: RMI class loader disabled)]
| at
This is all described in the FAQ:
http://www.jboss.org/wiki/Wiki.jsp?page=FAQJBossJMX
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3952294#3952294
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3952294
The no security manager error sure looked familiar, but it took me some time
to find it. I ran into the same error when I wrote mbean client code that I
ran on my Linux box attempting to connect to JBoss running on my Windows box.
Here is what I did. I added the following lines before the
Here's my current code :
try{
|
| if (System.getSecurityManager() == null) {
| System.setSecurityManager(new
RMISecurityManager());
| }
| Hashtable env = new Hashtable();
|
The org.jboss.jmx.adaptor.rmi.RMIAdaptor class is in these jar files, all found
in jboss_home/client:
* jbossall-client.jar
* jbossjmx-ant.jar
* jmx-invoker-adaptor-client.jar
Include one of these in your classpath (I use jbossall-client).
View the original post :
Are you trying to get the mbean server for JBoss? If so, I usually use the
following code:
Hashtable env = new Hashtable();
| String factory = org.jnp.interfaces.NamingContextFactory;
| env.put(Context.INITIAL_CONTEXT_FACTORY, factory);
| String url1 = jnp://localhost:1099;
|
It seems he's trying to locate the local mbeanserver, which doesn't exist.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3952093#3952093
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3952093
13 matches
Mail list logo