JBoss5 MainDeployer MBEAN listDeployer returns empty collection - jboss

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.

Related

MicroProfile LRA on Wildfly - How to setup LRA coordinator host and port on client application runing on WildFly

I have introduced LRA on a MicroProfile application already running on WildFly AS.
To get the LRA working I have added the following depedency on my application pom.xml
<dependency>
<groupId>org.jboss.narayana.rts</groupId>
<artifactId>narayana-lra</artifactId>
<version>5.10.6.Final</version>
</dependency>
and I have created an LRA coordinator running on the same host ad listening on port 8080.
The application works as expected.
Now I want to move LRA coordinator on a remote host, but I'm not able to configure my application to point to it (on new host and port).
I have tried to put in my microprofile-config.properties the following parameters:
mp.lra.http.host=<new_host>
mp.lra.http.port=<new_port>
but without effect.
Can anyone suggest me hot to configure LRA coordinator host and port on client application?
Thanks in advance
Narayana doesn't support MicroProfile Config yet even if it is something that it probably should. The properties you want to set are defined only as system properties (i.e., read with System.getProperty(String, String).
Another issue is that the properties you are looking for are defined as lra.http.host and lra.http.port respectively. MP LRA made a deliberate decision to remove all coordinator references from the specification to not specify the implementation architectures (saga can also be implemented as an orchestration pattern).
So you need to set these system properties for instance when you are starting the WildFly server:
bin/standalone.sh -Dlra.http.host=lra-coordinator.com -Dlra.http.port=7777
Finally, if you ever move to the latest Narayana releases, these properties were merged only into single property lra.coordinator.url which is however still read only from system properties.

Wildfly does not update MBean session attributes (JMX)

I am accessing WildFly (22) via JMX to access one of its MBeans. It is the session information of an web application. This is generally working however I can only see one attribute changing over time which is the activeSessions attribute. All other attributes like expiredSessions, highestSessionCount, maxActiveSessions, rejectedSessions, sessionsCreated etc always remain 0.
Does anybody know the reason for this? Is some special activation for those values necessary?
Ok I found it. In order to gather statistics about HTTP sessions, you need to enable statistics on undertow subsystem. One possibility is to use the CLI as follows:
/subsystem=undertow:write-attribute(name=statistics-enabled,value=true)
or directly in the standalone.xml:
<subsystem xmlns="urn:jboss:domain:undertow:XX.0" default-server="default-server" statistics-enabled="true">

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.

JBoss JMX twiddle Runtime not registered

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.