Jboss.as mbean missing after enable jmx remote wildfly 9.0.2 Final - jboss

I am having to extract information from the datasource and other JMX information in wildfly 9.0.2.Final. When I enable JMX in wildfly the Jboss.as mbean simply disappears and I do not know what to do.
Below is the image of the mbean map extracted from JCONSOLE, without activating JMX:
Image_Mbean_jconsole_without_JMX_enable
Below is the image of the mbean map extracted from JCONSOLE, activating JMX REMOTE:
Image_Mbean_jconsole_with_JMX_enabled
Below is JAVA_OPTS that I am adding to activate JMX REMOTE:
JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman,org.jboss.logmanager"
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:$JBOSS_HOME/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-2.0.0.Final.jar -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
All the commands added start Wildfly without any problems. The tests carried out, are of the official Wildfly image without any configuration outside this posted here.

Related

Quarkus devservices not starting config free postgres db

I just wanted to try dev services for spinning up a config free postgres in docker as I read at https://quarkus.io/guides/datasource#dev-services-configuration-free-databases
Generated a quarkus project https://code.quarkus.io/ with dependency quarkus-jdbc-postgresql
and application.properties looks like
quarkus.datasource.devservices.enabled=true
quarkus.datasource.db-kind=postgresql
quarkus.datasource.devservices.port=5432
Starting quarkus does NOT spin up postgres, instead I get a warning that quarkus does not understand its own properties, see Quarkus Log
2022-03-09 23:11:14,433 WARN [io.qua.config] (Quarkus Main Thread) Unrecognized configuration key "quarkus.datasource.devservices.enabled" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
2022-03-09 23:11:14,433 WARN [io.qua.config] (Quarkus Main Thread) Unrecognized configuration key "quarkus.datasource.devservices.port" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
2022-03-09 23:11:14,433 WARN [io.qua.config] (Quarkus Main Thread) Unrecognized configuration key "quarkus.datasource.db-kind" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
2022-03-09 23:11:14,936 INFO [io.quarkus] (Quarkus Main Thread) quarkus-resteasy-postgres 1.0.0-SNAPSHOT on JVM (powered by Quarkus 2.7.4.Final) started in 2.182s. Listening on: http://localhost:8080
2022-03-09 23:11:14,937 INFO [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2022-03-09 23:11:14,937 INFO [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, jdbc-postgresql, resteasy, smallrye-context-propagation, vertx]
Any idea what is going on here?
Project here: https://github.com/syr/quarkus-resteasy-postgres
According to your warning message, there's one extension missing for this configuration:
2022-03-09 23:11:14,433 WARN [io.qua.config] (Quarkus Main Thread) Unrecognized configuration key "quarkus.datasource.db-kind" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
You can solve your problem adding one of these dependencies to your project (on your pom.xml):
Pool your database connections (included in Hibernate ORM)
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-agroal</artifactId>
</dependency>
or
Hibernate ORM
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-orm</artifactId>
</dependency>

NoClassDefFoundError when using JMX Exporter with Wildfly 15

We're using Wildfly 15 with JMX Exporter. When starting the WildFly server I get the following exception and I'm running out of ideas. The package exists under modules/system/layers/base/org/wildfly/common/main/wildfly-common-1.4.0.Final.jar.
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /opt/jboss/wildfly-15.0.1.Final
JAVA: /opt/java/jdk1.8.0_201/bin/java
JAVA_OPTS: -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:/opt/jboss/wildfly-15.0.1.Final/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-2.1.5.Final.jar -Xbootclasspath/p:/opt/jboss/wildfly-15.0.1.Final/modules/system/layers/base/org/jboss/log4j/logmanager/main/log4j-jboss-logmanager-1.1.6.Final.jar -Xbootclasspath/p:/opt/jboss/wildfly-15.0.1.Final/modules/system/layers/base/org/slf4j/impl/main/slf4j-jboss-logmanager-1.0.3.GA.jar -javaagent:/opt/jboss/wildfly-15.0.1.Final/prometheus/jmx-prometheus.jar=9404:/opt/jboss/wildfly-15.0.1.Final/prometheus/config.yaml -Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager -server -Xmx3G -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n
=========================================================================
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
Listening for transport dt_socket at address: 8787
java.lang.NoClassDefFoundError: org/wildfly/common/net/HostName
at org.jboss.logmanager.ExtLogRecord.<init>(ExtLogRecord.java:87)
at org.jboss.logmanager.Logger.log(Logger.java:796)
at org.jboss.logging.JBossLogManagerLogger.doLogf(JBossLogManagerLogger.java:53)
at org.jboss.logging.Logger.logf(Logger.java:2398)
at org.jboss.msc.service.ServiceLogger_$logger.greeting(ServiceLogger_$logger.java:40)
at org.jboss.msc.service.ServiceContainerImpl.<clinit>(ServiceContainerImpl.java:91)
at org.jboss.msc.service.ServiceContainer$Factory.create(ServiceContainer.java:250)
at org.jboss.as.server.BootstrapImpl$ShutdownHook.register(BootstrapImpl.java:231)
at org.jboss.as.server.BootstrapImpl$ShutdownHook.access$100(BootstrapImpl.java:221)
at org.jboss.as.server.BootstrapImpl.<init>(BootstrapImpl.java:72)
at org.jboss.as.server.Bootstrap$Factory.newInstance(Bootstrap.java:278)
at org.jboss.as.server.Main.main(Main.java:106)
at org.jboss.modules.Module.run(Module.java:352)
at org.jboss.modules.Module.run(Module.java:320)
at org.jboss.modules.Main.main(Main.java:593)
I finally managed to get it running by setting the following JAVA_OPTS:
-Djava.util.logging.manager=org.jboss.logmanager.LogManager
-Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager
# We need to add this JAR explicitly to avoid a NoClassDefFoundError.
-Xbootclasspath/p:${JBOSS_HOME}/modules/system/layers/base/org/wildfly/common/main/wildfly-common-1.4.0.Final.jar
-Xbootclasspath/p:$JBOSS_HOME/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-2.1.5.Final.jar
-javaagent:${JBOSS_HOME}/prometheus/jmx-prometheus.jar=9404:${JBOSS_HOME}/prometheus/config.yaml"
Keep in mind to adapt the versions depending on your setup.

Set system properties in standalone-full.xml in wildfly 8.2

I have added system-properties tag in standalone-full.xml, but its not working in standalone mode. However, if I add the same tag in domain.xml it's working for domain mode.
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns="urn:jboss:domain:2.2">
<extensions>
....
</extensions>
<system-properties>
<property name="java.util.Arrays.useLegacyMergeSort" value="true"/>
</system-properties>
</server>
According to this article on jBoss General configuration concepts
System property values can be set in a number of places in domain.xml, host.xml and standalone.xml.
Then what about standalone-full.xml?
I don't want to set it through command line and not even in java code.
In standalone it's probably too late to set it in the configuration files. You'll need to add it to the standalone.conf or standalone.conf.bat in the JAVA_OPTS environment variable. A global property like that needs to be set before anything else attempts to use java.util.Arrays.
If you have started the Wildfly server with standalone-full.xml instead of standalone.xml(the default) than this should be reflected in the start of the server:
standalone.sh -b <hostIP> -c standalone-full.xml -Dorg...
Then this will have effect on first start.
If you change something in this config file, you will need to reload Wildfly(configuration) from jboss cli:
[standalone#localhost:9990 /] :reload
For Wildfly 10 it's working nontheless. I was able to read the property for an instance started with the standalone-full.xml containing some properties.
The manual must be outdated then I guess? Because even Wildfly itself inserts a new property in the standalone-full.xml when using the Wildfly admin webinterface: http://localhost:9990 > Configuration > System Properties (Wildfly will add the property of course to the xml config which was used to start the instance). That's enough proof for me.

Karaf 3.0.x config:update command does not create .cfg file in /etc

I am using karaf 3.0.1 with my bundle (https://github.com/johanlelan/camel-cxfrs-blueprint-example). I want to manage properties at runtime but I see that config:update does not create file on /etc, why?
<cm:property-placeholder persistent-id="org.apache.camel.examples.cxfrs.blueprint"
update-strategy="reload">
<!-- list some properties for this test -->
<cm:default-properties>
<cm:property name="cxf.application.in"
value="cxfrs:bean:rest.endpoint?throwExceptionOnFailure=false&bindingStyle=SimpleConsumer&loggingFeatureEnabled=true"/>
<cm:property name="common.tenant.in" value="direct-vm:common.tenant.in"/>
<cm:property name="common.authentication.in" value="direct-vm:common.authentication.in"/>
<cm:property name="application.put.in" value="direct-vm:application.putById"/>
<cm:property name="application.post.in"
value="direct-vm:application.postApplications"/>
<cm:property name="log.trace.level" value="INFO"/>
</cm:default-properties>
</cm:property-placeholder>
In karaf I try to modify an endpoint url:
karaf#root()> config:edit org.apache.camel.examples.cxfrs.blueprint
karaf#root()> config:property-set common.tenant.in direct-vm:test
karaf#root()> config:property-list
service.pid = org.apache.camel.examples.cxfrs.blueprint
common.tenant.in = direct-vm:test
felix.fileinstall.filename = file:/F:/travail/servers/karaf-lan/etc/org.apache.camel.examples.cxfrs.blueprint.cfg
karaf#root()> config:update
karaf#root()>
I precise that my bundle is updated after config:update but no file exists in /etc... I think it works in karaf 2.3.5.
Configurations are persisted by the ConfigurationAdmin service. If you are using Karaf, it uses the implementation from Felix ConfigAdmin [1]. By default Karaf configures ConfigAdmin to store files in its local bundle storage area under /data, but that can be changed by editing the felix.cm.dir property.
Also, the support for the .cfg files comes from Felix FileInstall [2].
[1] http://felix.apache.org/documentation/subprojects/apache-felix-config-admin.html
[2] http://felix.apache.org/site/apache-felix-file-install.html
It is a known issue at karaf 3.0.1
You may use apache karaf 3.0.2 that this bug is fixed.

enabling jmx remote in jboss 6.1

I'm trying to enable jmx remote in jboss 6.1. When I've added options like below
-Djboss.platform.mbeanserver
-Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl
-Dcom.sun.management.jmxremote.port=12349
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
, jboss can't start properly and I'got following error:
" Deployment "JBossLogService" is in error due to the following reason(s): java.lang.IllegalStateException: The LogManager was not properly installed (you must set the "java.util.logging.manager" system property to "org.jboss.logmanager.LogManager"), **ERROR**"
Do you have any ideas how to fix it ?
In Jboss EAP 6.1 JMX is enabled by default.
ensure you have:
<extension module="org.jboss.as.jmx"/> under <extensions>
<subsystem xmlns="urn:jboss:domain:jmx:1.2">
<expose-resolved-model/>
<expose-expression-model/>
<remoting-connector/>
</subsystem>
use -Djboss.bind.address.management=YOURSERVERIP as command line argument to start you AS or change it here:
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:**127.0.0.1**}"/>
</interface>
..
</interfaces>
use jconsole start script under JBOSS_HOME/bin/jconsole.sh (it loads JBoss remoting libraries on classpath )
to use jvisualvm instead refer to https://github.com/johnaoahra80/jboss-as-tool-integration/tree/master/visualvm
use that url in jconsole service:jmx:remoting-jmx://yourIP:magementport (default is 9999)
use user/password you crated using JBOSS_HOME/bin/add-user.sh
add next options
-Djava.util.logging.manager=org.jboss.logmanager.LogManager
-Xbootclasspath/p:$JBOSS_HOME/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-version.jar
-Xbootclasspath/p:$JBOSS_HOME/modules/system/layers/base/org/jboss/log4j/logmanager/main/log4j-jboss-logmanager-version.jar
-Xbootclasspath/p:$JBOSS_HOME/modules/system/layers/base/org/apache/log4j/main/log4j-jboss-logmanager-version.jar
-Dcom.sun.management.jmxremote