How to access JBoss 5.1 GA 's MBeans? - jboss

I would like to access JBoss server's mbeans with my POJO class. I learned about mbeans in these site.But I'm not satisfied.Is there any ways to access JBoss server's mbeans with java class and how to apply these mbeans?

To get reference to local JBoss MBean server, the easiest way is to use MBeanServerLocator. Check this link: https://community.jboss.org/wiki/HowCanIGetAReferenceToTheMBeanServer
If you want access to remote JBoss MBean server, then you can either use:
JMXConnectionFactory http://docs.oracle.com/javase/1.5.0/docs/api/javax/management/remote/JMXConnectorFactory.html or
RMI adaptor http://docs.jboss.org/jbossas/docs/Server_Configuration_Guide/4/html/Connecting_to_the_JMX_Server-Connecting_to_JMX_Using_RMI.html
You can find plenty of examples for each approach if you Google it.

Related

Weblogic to JBoss JNDI - JMS queue Consumer and Publisher

I am working on an example where a JMS queue is hosted on a JBoss EAP 6 instance (one for Request and another for Response). I also have an application running on a Weblogic managed server.
I would like to setup a mechanism that allows applications running on Weblogic to be able to consume messages that are added on the Request queue hosted on JBoss. Also the applications should be able to publish messages to the Request queue (also hosted on JBoss)
I read about Foreign JNDI Providers in Oracle Documentation, and most of the examples I find are Weblogic to Remote Weblogic connections and Weblogic to Remote LDAP. My concern is around the difference in in the implementations on javax.naming.InitialContext for Weblogic and JBoss (whether it would be compatible).
Does anyone have any suggestions on this?
Neither the JNDI implementation nor the JMS implementation from JBoss EAP will be compatible with Weblogic. However, that shouldn't be a problem as both can be used by the same application given the right configuration.
Consider a standalone JMS application that consume a message from JMS provider X and sends a message to JMS provider Y. It would first use the JNDI implementation from JMX provider X to lookup the JMS connection factory and queue. That lookup would return the proper JMS implementation objects from provider X. The application would use those objects to consume a message from the queue. Then it would use the JNDI implementation from JMX provider Y to lookup the second JMS connection factory and queue. That lookup would return the proper JMS implementation objects from provider Y. As long as the JNDI InitialContext properties are all correct for each of the lookups and all the implementation classes are on the the application's classpath then everything will work without issue.
The situation in Weblogic is similar. You simply need to configure the foreign JNDI provider with the right properties, put the right implementation classes on the classpath, and then use all the right names in your JNDI lookups.

Wildfly 8.2.0 expose JMX over RMI

Is it possible to expose JMX interface over RMI, not over http-remoting? Or expose via both?
It would be great to access Mbeans via url like "service:jmx:rmi//" to be able to establish zabbix gate monitoring. Zabbix has an issue with hard-coded value in connection url ([ZBXNEXT-1274] Configurable JMX Endpoint - ZABBIX SUPPORT)
As far as I understand I need to add additional connector to jmx subsystem. Is is correct?
Part of xml for jmx subsystem is default for now and looks like this:
<subsystem xmlns="urn:jboss:domain:jmx:1.3">
<expose-resolved-model/>
<expose-expression-model/>
<remoting-connector/>
</subsystem>
Thanks!
I'm not sure that it is possibly to add alternative JMX access protocols in WildFly. At least not as a supported configuration option.
It might be possible to expose JMX via the standard JVM parameters, as described in the Java Documentation, but I would not expect it to be working correctly.
An alternative solution for enabling monitoring from Zabbix is to expose some or all of the JMX MBeans through a http or RESTful interface with Jolokia or other similar technology.
zabbix in version 3.4 have Configurable JMX Endpoint.
https://www.zabbix.com/documentation/3.4/manual/config/items/itemtypes/jmx_monitoring
You need only upgrade zabbix, add jar for application server in zabbix and change endpoint in template. I have success setting with wildlfy 10,10.1 and 11. Both modes is supported (domain and standalone).

JBoss 7(EAP 6) MDB integration with Websphere MQ using JNDI on LDAP

I want to write a application using MDB(message driven bean) and deploy to jboss eap 6.1 server.
My MQ is IBM Websphere MQ, and I have a LDAP server to locate the MQ JNDI namespace, and I know how to get/put message using JNDI and JMS.
But when coming to JBoss, I don't know how to configure MDB to listen to the MQ. I want to use the JNDI on LDAP, and write a message consumer on the JBoss server. And I don't want to hard code configuration in the annotation.
I did a lot of searching, but no any solutions. Can anybody show me the detailed process?
Thank you!
Unfortunately, this is not possible due to the limitations in the IBM JCA. The IBM JCA builds a managed connection factory for each MDB deployment based on the MDBs activation specification. This will typically have your MQ host, port, channel, etc. specified.
You can not specify a the JNDI name of a connection factory to use. This is a bit odd as you can specify the JNDI name of your destination.
Functionality similar to the LDAP external context can be achieved using the IBM Client Channel Definition Table (CCDT).

What protocol provider to connect to JMX on WebSphere via SOAP?

I'd like to connect to the JMX server on a WebSphere application server instance using a SOAP over HTTP connector but I don't know where to find a compatible SOAP protocol provider.
I get a MalformedURLException when using a JMXServiceURL starting service:jmx:soap:... that says Unsupported protocol: soap. What jar(s)/protocol provider string do I need to include?
Update: I am playing with a standalone Java client.
Unfortunately, IBM only provides a proprietary API to connect with SOAP over HTTP. They don't provide an implementation of the standard JMX API for that protocol. I faced the same issue and I developed such a connector (which is basically a thin JMX compliant wrapper around IBM's proprietary API), which is now available as Open Source. You can find more information here:
https://github.com/kszbcss/xm4was/wiki/JmxClientConnector
The following document describes how to set up a standard JMX tool (VisualVM) to use that connector:
https://github.com/kszbcss/xm4was/wiki/VisualVMHowTo
As you can see from these documents, after adding the relevant JARs to the class path and setting the necessary system properties, you would simply connect using wssoap as protocol.
Check that in the path Application servers > <server_name> > Administration services > JMX connectors the relative SOAPConnector exists and is Enabled.
Refer at Infocenter for more information.

Remote JMS #Resource injection into EJBs

Does anyone know if it is possible to inject a JMS Queue as a #Resource when the jms queue is provided by a remote server.
I'm using Jboss 5.1 with JBoss Messaging. We have a client program on a different JBoss server that needs to post messages to this remote queue.
Thanks in advance.
#Resource annotation has a name attribute in which you can specify the JNDI name of the component you want to inject. The container will however prefix it with java:comp/env, so that means that it will look up resources in your local JNDI namespace.
You will have to perform a programmatic JNDI lookup for this as far as I know.