JBoss JMX twiddle Runtime not registered - jboss

I have a problem with the twiddle script on a Solaris 10 server.
I have to read some properties e.g jboss.system and others.
All properties depending on the jboss server are fine, but when I try
to read properties from java.lang, the following error occurs:
javax.management.InstanceNotFoundException: java.lang:type=Runtime is not registered.

The problem is that java.lang:type=Runtime is a Platform MBeanServer registered MBean and by default, twiddle connects you to the JBoss MBeanServer which by default, will not have the RuntimeMXBean server registered.
The easiest way to resolve this, assuming you only want to access system properties, is to point twiddle at the JBoss MBean jboss:name=SystemProperties,type=Service. The MBean exposes:
String get(String key)
String get(String key, String default)
or to retrieve all values,
Map shopwAll()
Other more laborious solutions would inlcude:
Register the Platform MBeanServer MXBeans in the JBoss MBeanServer. See this Question.
Enable the management agent in the JVM and use a JMX Connector to connect to the Platform MBeanServer. See this Question.
Use the Attach API to connect to the Platform MBeanServer of your JBoss Server by process ID. You can then reference the MXRuntime MBean.

Related

Jboos connectivity Issue

I am getting the following error when trying to connect my application to jboss:
WARN | ISPN004022: Unable to invalidate transport for server:
/127.0.0.1:12222 ERROR | ISPN004017: Could not fetch transport
org.infinispan.client.hotrod.exceptions.TransportException:: Could not
connect to server: /127.0.0.1:12222
Tried searching a lot for a solution. It would be great is someone could help me out with this. Thanks
You must recall the following actions:
Make sure that your webapp is using the same port as defined in the socket-binding definitions for hotrod in the standalone.xml for JDG configuration folder;
Make sure that your webapp is using the proper inject annotations for your RemoteCacheManager class (remember to use the #ApplicationScopped annotation at the class definition and for additional methods used to get the cache instance);
If you are using JBoss and JDG on the same host, you must check declarations of the JBOSS_HOME environment variable. This variable must be assigned to the JDG installation home directory and not the JBoss EAP home (check also port-offset settings at startup if you're using a custom shell script);
If you are not using both products on the same host, check firewall and network settings;
Remember to re-deploy the application always after every modification and check both EAP and JDG console output for warnings and/or errors.
The following errors are related (for example):
14:38:42,610 WARN [org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory] (http-127.0.0.1:8080-1) ISPN004022:
Unable to invalidate transport for server: /127.0.0.1:11322
14:38:42,610 ERROR [org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory] (http-127.0.0.1:8080-1) ISPN004017:
Could not fetch transport: java.lang.IllegalStateException: Pool not open

How can I set distinct-name on Wildfly?

I try EJB invocations from a client to a server, they are actually same copied ear files each other and on same machine.
I think that I must set "distinct-name" in somewhere, but I can not find it.
WildFly Developer Guide - EJB invocations from a remote client using JNDI:
distinct-name : This is a WildFly-specific name which can be optionally assigned to the deployments that are deployed on the server. More about the purpose and usage of this will be explained in a separate chapter. If a deployment doesn't use distinct-name then, use an empty string in the JNDI name, for distinct-name
Where is "a separate chapter"?
Set <distinct-name> attribute in jboss-app.xml(EAR) or jboss-ejb3.xml(WAR/EJB jar).

Connect HermesJMS to Wildfly 8.2

we recently changed our Application Server from Glassfish to Wildfly. With Glassfish we used QBrowser to monitor our JMS Queues, sadly that tool does not work with Wildfly.
After a quick search I found the Tool HermesJMS. Although there are lots of guides how to set up a connection to a JMS queue with it I couldn´t find anything directly for the JBoss Wildfly application server. After lots of reading through different guides I think I can now connect to the wildfly server but I just can´t connect to my jms queues.
First I tried to connect via JNDI InitialContext. Here´s my settings for it:
initialContextFactory: org.jboss.naming.remote.client.InitialContextFactory
providerURL: http-remoting://localhost:
urlPkgPrefixes: org.jboss.naming.remote.client
securityPrincipal: admin
securityCredentials: admin
It does connect but all I see are my deployed web applications and a "jms" folder. But they all contain the same web-applications again plus the jms folder and appear as a red circle with a white X in it.
So next I tried to set up a session manually via "Create new JMS Session" with following preferences:
Session: HornetQ
Plugin: HornetQ
Properties:
binding: jms/RemoteConnectionFactory
initialContextFactory: initialContextFactory: org.jboss.naming.remote.client.InitialContextFactory
providerURL: http-remoting://localhost:
urlPkgPrefixes: org.jboss.naming.remote.client
User: guest Password: pass
The guest user is an user I created in Wildfly as an application user
When I then double click on one of the queues it says that there is no such queue.
javax.jms.JMSException: There is no queue with name java:jboss/jms/queue/ngsEmailProvRequestQueue
at org.hornetq.jms.client.HornetQSession.createQueue(HornetQSession.java:397)
at hermes.impl.jms.SimpleDestinationManager.createDesintaion(SimpleDestinationManager.java:60)
at hermes.impl.JNDIDestinationManager.createDesintaion(JNDIDestinationManager.java:105)
at hermes.impl.jms.SimpleDestinationManager.getDestination(SimpleDestinationManager.java:137)
at hermes.impl.jms.AbstractSessionManager.getDestination(AbstractSessionManager.java:387)
at hermes.impl.DefaultHermesImpl.getDestination(DefaultHermesImpl.java:323)
at hermes.browser.tasks.BrowseDestinationTask.invoke(BrowseDestinationTask.java:122)
at hermes.browser.tasks.TaskSupport.run(TaskSupport.java:175)
at hermes.browser.tasks.ThreadPool.run(ThreadPool.java:170)
at java.lang.Thread.run(Thread.java:745)
Does anybody know what I´m missing? Is it even possible to get HermesJms to work with Wildfly? Of if not is there an alternative monitoring tool for JMS queues?
Thank you for your help.
To work with Wildfly, follow this doc: https://developer.jboss.org/wiki/UsingHermesJMSWithHornetQ
Second part: Configuring HermesJMS for JBoss7 / EAP6 with HornetQ
And change those values:
binding=jms/RemoteConnectionFactory
initialContextFactory=org.jboss.naming.remote.client.InitialContextFactory
providerURL=http-remoting://localhost:8080
urlPkgPrefixes=org.jboss.naming.remote.client
In the destinations, change also:
Name: sample
Domain: QUEUE
Maybe you could have a look at JMSToolbox on sourceforge: https://sourceforge.net/projects/jmstoolbox/?source=directory
i recently revisited this as the team is moving from glassfish (yaye...) to wildfly. I tried with wildfly9 and it works.
I think it is a matter of exporting your queue name. see below
java:/jms/queue/test does not work
java:jboss/exported/jms/queue/test works
Note: wildfly9.2 is the final version that has hornetq. wildfly 10++ supports artemis instead.

Implementing CORBA interface in JBoss

I'm looking for a tutorial or any additional information on how to make an EJB (or underlying MBean) accessible via CORBA.
This is all I've found: http://www.jboss.org/jbossiiop
I have an existing CORBA server (java-based, but non-standard) and I want to allow it to call into my JBoss MBean. This MBean is already exposed via RMI using an EJB (v2.1).
The current AppServer target version is jboss-eap-4.3.
Edit: I'm hoping my question is just too vague to get answered so here's an update:
I want my EJB running in JBoss to register with the Corba ORB running on a remote separate server. At least I think I do. The existing CORBA client connects to services via a defined IDL/interface that I'm trying to implement via a JBoss EJB. At this point, said client connects to several instances of the same interface to pull information and manage local (same process) services via this interface. I want the JBoss EJB to be dropped in as just another implementation of this CORBA IDL.
My understanding of CORBA is rusty and weak to begin with so I'm not getting very far. I can run an ORB in JBoss easily enough, but it's not clear to me how to set up the binding so the "legacy" CORBA ORB can find it. I can change any part of the JBoss implementation to make this work, but changing the other server is difficult.
Is there a way for the EJB to register itself with a remote server (ala jndi)?
Will the existing client be able to connect to Jacorb without adding jboss specific classes?
In short you have to implement an adapter, deploy it in Jboss, register it with the remote NamingService. In your adapter implementation you call your MBeans.
Now more in details
You have a CORBA idl, you generate stubs and skeletons.
interface Stock {
int getQuote( in string company);
};
You provide necessary implementation
public class StockImpl extends StockPOA {
public int getQuote(String company) {
//forward a call to MBean here
}
}
You do the usual CORBA registration stuff. something like:
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(...);
org.omg.PortableServer.POA poa = org.omg.PortableServer.POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
poa.the_POAManager().activate();
NamingContextExt nc = NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService"));
NameComponent [] name = new NameComponent[1];
org.omg.CORBA.Object o = poa.servant_to_reference( new StockImpl(orb,poa));
name[0] = new NameComponent( "Stock", "server");
nc.bind(name, o);
orb.run();
Now your object is registered in the remote NamingService and is accessible via CORBA.
You have to include CORBA jars in the JBOSS classpath.
A Corba orb is a socket listener, so best to use the one under JBoss's control, i.e. the standard orb:
ObjectName ORB_NAME = ObjectNameFactory.create("jboss:service=CorbaORB");
ORB orb = (ORB)server.getAttribute(ORB_NAME, "ORB");
to automatically start your Corba service do it in a JBoss Service mbean:
http://community.jboss.org/wiki/examplehelloworldservice
To avoid having to compile IDL you could use the Dynamic Invocation Interface.
Have a look at how Axis2 CORBA Module does it: http://wso2.org/library/2807
You do not need an Orb on the classpath if you use the JBoss "all" configuration, this includes Corba.

JBoss5 MainDeployer MBEAN listDeployer returns empty collection

It seems that the MainDeployer MBean doesn't work/is not implemented.
how to retrieve the list of deployed application in JBoss 5?
You might be interessted in the JMX MBean View of Web-Console which can be reached using this URL http://localhost:8080/web-console/ as well as JMX-Console http://localhost:8080/jmx-console/
If you bound your jboss using parameter -b to another interface, you need to replace localhost in the URL given above.