NoClassDefFoundError when using JMX Exporter with Wildfly 15 - jboss

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.

Related

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

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.

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

Enable debug mode with liferay in weblogic server? and debug in eclipse with those serves?

I am working with Liferay portal on weblogic server and I have problems to debug with eclipse.
I use Eclipse Juno with OEPE Pack extension, Oracle Weblogic Server 11gR1 (10.3.5) and Liferay 6.1.
When i start without debug options i launch weblogic admin server OK and liferay server OK.
But when I change local domain file setDomainEnv.sh with this lines
set JAVA_DEBUG=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=%DEBUG_PORT%,server=y,suspend=n -Djava.compiler=NONE
set JAVA_OPTIONS=%JAVA_OPTIONS% %enableHotswapFlag% -ea -da:com.bea... -da:javelin... -da:weblogic... -ea:com.bea.wli... -ea:com.bea.broker... -ea:com.bea.sbconsole.`
Weblogic serve starts OK
Server Log
Listening for transport dt_socket at address: 8453
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Oracle JRockit(R) (build R28.1.3-11-141760-1.6.0_24-20110301-1429-windows-ia32, compiled mode)
Starting WLS with line:
E:\Oracle\MIDDLE~1\JROCKI~1.2-4\bin\java -jrockit -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8453,server=y,suspend=n -Djava.compiler=NONE
-Xms512m -Xmx512m -Dweblogic.Name=Admin -Djava.security.policy=E:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.policy -Dweblogic.ProductionModeEn
abled=true -ea -da:com.bea... -da:javelin... -da:weblogic... -ea:com.bea.wli... -ea:com.bea.broker... -ea:com.bea.sbconsole... -Dplatform.home=E:\Or
acle\MIDDLE~1\WLSERV~1.3 -Dwls.home=E:\Oracle\MIDDLE~1\WLSERV~1.3\server -Dweblogic.home=E:\Oracle\MIDDLE~1\WLSERV~1.3\server -Ddomain.home=E:\WLS\DO
MINI~1\LOCAL_~1 -Does.client.home=E:\Oracle\MIDDLE~1\OES -Doracle.home=E:\Oracle\MIDDLE~1\OES -Doracle.security.jps.config=E:\WLS\DOMINI~1\LOCAL_~1\co
nfig\oeswlssmconfig\Admin\jps-config.xml -Dweblogic.management.discover=true -Dwlw.iterativeDev=false -Dwlw.testConsole=false -Dwlw.logErrorsToConso
le=false -Dweblogic.ext.dirs=E:\Oracle\MIDDLE~1\patch_wls1035\profiles\default\sysext_manifest_classpath;E:\Oracle\MIDDLE~1\patch_oepe180\profiles\def
ault\sysext_manifest_classpath;E:\Oracle\MIDDLE~1\patch_ocp360\profiles\default\sysext_manifest_classpath;E:\Oracle\MIDDLE~1\patch_jdev1111\profiles\d
efault\sysext_manifest_classpath;E:\Oracle\MIDDLE~1\patch_adfr1111\profiles\default\sysext_manifest_classpath weblogic.Server
Listening for transport dt_socket at address: 8453
but when I start liferay server fails
Liferay script
set DOMAIN_HOME=E:\WLS\Dominio_wls11\local_domain1
call "%DOMAIN_HOME%\bin\startManagedWebLogic.cmd" liferay %*)
Server log
starting weblogic with Java version:
ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:690]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
[ERROR] aborted
JRockit aborted: Unknown error (50)
Starting WLS with line:
E:\Oracle\MIDDLE~1\JROCKI~1.2-4\bin\java -jrockit -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8453,server=y,suspend=n -Djava.compiler=NONE -Xms512m -Xmx512m -Dweblogic.Name=liferay -Djava.security.policy=E:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.policy -Dweblogic.ProductionModeEnabled=true -Dweblogic.security.SSL.trustedCAKeyStore="E:\Oracle\Middleware\wlserver_10.3\server\lib\cacerts" -ea -da:com.bea... -da:javelin... -da:weblogic... -ea:com.bea.wli... -ea:com.bea.broker... -ea:com.bea.sbconsole... -Dplatform.home=E:\Oracle\MIDDLE~1\WLSERV~1.3 -Dwls.home=E:\Oracle\MIDDLE~1\WLSERV~1.3\server -Dweblogic.home=E:\Oracle\MIDDLE~1\WLSERV~1.3\server -Ddomain.home=E:\WLS\DOMINI~1\LOCAL_~1 -Does.client.home=E:\Oracle\MIDDLE~1\OES -Doracle.home=E:\Oracle\MIDDLE~1\OES -Doracle.security.jps.config=E:\WLS\DOMINI~1\LOCAL_~1\config\oeswlssmconfig\liferay\jps-config.xml -Dweblogic.management.discover=false -Dweblogic.management.server=http://localhost:9819 -Dwlw.iterativeDev=false -Dwlw.testConsole=false -Dwlw.logErrorsToConsole=false -Dweblogic.ext.dirs=E:\Oracle\MIDDLE~1\patch_wls1035\profiles\default\sysext_manifest_classpath;E:\Oracle\MIDDLE~1\patch_oepe180\profiles\default\sysext_manifest_classpath;E:\Oracle\MIDDLE~1\patch_ocp360\profiles\default\sysext_manifest_classpath;E:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\sysext_manifest_classpath;E:\Oracle\MIDDLE~1\patch_adfr1111\profiles\default\sysext_manifest_classpath weblogic.Server
ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:690]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
[ERROR] aborted
JRockit aborted: Unknown error (50)
Why does liferay server fail?
I think that i need to configurate servers in eclipse for connect to weblogic in debug mode. How could i do this?
I have seen that i donĀ“t have Liferay 6.1 server for weblogic in the server list only Liferay 6.1 server to Tomcat 6 o 7. I try to install Liferay IDE plugin but it fails due to different conflicts with OEPE Pack.
You're using the same debug port (8453) for both JVMs. "Address already in use" means that Java cannot create a socket on this port because another socket occupies it.

JBOSS 5.0 Starting Error

I have installed Jboss 5.0.0GA-jdk6... While trying to start jboss by running "run.bat" (inside bin folder), I am getting following error... what am I doing wrong ?
Failed to boot JBoss:
java.lang.IllegalStateException: Incompletely deployed:
*** DEPLOYMENTS IN ERROR: Name -> Error
StandardBindings -> java.lang.IllegalArgumentException: Wrong arguments. new for
target java.lang.reflect.Constructor expected=[int] actual=[java.util.HashSet]
*** DEPLOYMENTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual S
tate}
ServiceBindingManager -> ServiceBindingStore{Installed:Instantiated}
SystemPropertyBinder -> SystemPropertyBinder#1{Installed:Described}
SystemPropertyBinder#1 -> ServiceBindingManager{Installed:Described}
ServiceBindingStore -> StandardBindings{Installed:**ERROR**}
at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalVa
lidate(AbstractKernelDeployer.java:290)
at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(A
bstractKernelDeployer.java:174)
at org.jboss.bootstrap.microcontainer.ServerImpl.doStart(ServerImpl.java
:148)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:
394)
at org.jboss.Main.boot(Main.java:209)
at org.jboss.Main$1.run(Main.java:547)
at java.lang.Thread.run(Unknown Source)
15:05:41,329 INFO [ServerImpl] Runtime shutdown hook called, forceHalt: true
15:05:41,332 INFO [ServerImpl] Shutdown complete
Shutdown complete
Halting VM
Press any key to continue . . .
There is a bug in the profile.xml
For a fix quick add the type "class=java.io.File" to the parameter of the constructor as showed:
<bean name="AttachmentStore"
class="org.jboss.system.server.profileservice.repository.AbstractAttachmentStore">
<constructor><parameter class="java.io.File"><inject bean="BootstrapProfileFactory"
property="attachmentStoreRoot" /></parameter></constructor>
For a detailed explanation go to: https://issues.jboss.org/browse/JBAS-6981
There is bug with incompatible version of java.You should add jre 6 in to jboss configuration file under jre folder .
jboss 5.0.0.GA requires IBMV9 jdk.
so we can use jboss 4.3.2.GA instead . it is compatible with jdk 6 and jdk 7.

trouble in starting jboss server

I'm trying to start jboss but the it's not getting started. It gives the following error
JBoss Bootstrap Environment
JBOSS_HOME: /opt/portal/jbossPayments/jboss-5.1.0.GA
JAVA: /usr/jdk/jdk1.6.0_19/bin/java
JAVA_OPTS: -Dprogram.name=run_pmnts_ports_01.sh -server -Xms2650m -Xmx2650m -XX:+AggressiveHeap -XX:+UseParallelGC -XX:ParallelGCThreads=12 -XX:MaxPermSize=256m -Dsu
n.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dcom.sun.management.jmxremote.port=12345 -Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false -Xrunjdwp:transport=dt_socket,address=8987,server=y,suspend=n
CLASSPATH: /opt/portal/jbossPayments/jboss-5.1.0.GA/bin/run.jar::/opt/portal/jbossPayments/jboss-5.1.0.GA/config:/usr/jdk/jdk1.6.0_19/lib/tools.jar
=========================================================================
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
Can anyone please help me out?