Docker Community Forums

Share and learn in the Docker community.

Could not load Logmanager “org.jboss.logmanager.LogManager”

docker

(Sarahjohn) #1

I am using Visualvm tool and trying to establish remote connection through jmx. I need to connect to my remote server which is ubuntu 14.04. My web application is running on [Docker](https://forums.docker.com/) and Jboss/wildfly is running on docker. Below is the dockerfile.

    FROM jboss/wildfly:10.1.0.Final
RUN /opt/jboss/wildfly/bin/add-user.sh username password --silent
ENV JBOSS_LOG_MANAGER_LIB /opt/wildfly-8.2.0.Final/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-1.5.2.Final.jar
ENV JAVA_OPTS="-XX:PermSize=4096m -XX:MaxPermSize=1024m -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses -Dcom.sun.management.jmxremote.rmi.port=8686 -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=8787 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=false -Djava.rmi.server.hostname=x.x.x.x -Xbootclasspath/p:$JBOSS_LOG_MANAGER_LIB -Djboss.modules.system.pkgs=org.jboss.logmanager -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:/opt/wildfly-8.2.0.Final/modules/system/layers/base/org/jboss/logging/main/jboss-logging-3.1.4.GA.jar -Xbootclasspath/p:/opt/wildfly-8.2.0.Final/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-1.5.2.Final.jar"
ADD project_web.war /home/ubuntu/SampleTest/project
ADD standalone.xml /opt/wildfly-8.2.0.Final/standalone/configuration
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]
ENV OFFLINE_DB_USERNAME username
ENV OFFLINE_DB_URL jdbc:mysql://x.x.x.x:3306/%s?useLegacyDatetimeCode=false&useTimezone=true&serverTimezone=UTC
ENV OFFLINE_DB_SERVER_URL jdbc:mysql://x.x.x.x:3306/offlineserver?useLegacyDatetimeCode=false&useTimezone=true&serverTimezone=UTC
ENV OFFLINE_DB_PASSWORD password
EXPOSE 8787

My run command is-

sudo docker run -e JAVA_OPTS="-Dlog4j.configurationFile=log4j2_dev.xml -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=8787 -Dcom.sun.management.jmxremote.rmi.port=8686 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=x.x.x.x -Xbootclasspath/p:/opt/wildfly-8.2.0.Final/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-1.5.2.Final.jar -Djboss.modules.system.pkgs=org.jboss.logmanager -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:/opt/wildfly-8.2.0.Final/modules/system/layers/base/org/jboss/logging/main/jboss-logging-3.1.4.GA.jar -Xbootclasspath/p:/opt/wildfly-8.2.0.Final/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-1.5.2.Final.jar" -p 9595:8080 -p 9696:8080 -p 8787:8787 -v /home/ubuntu/SampleTest/project/logs:/opt/wildfly/standalone/log --restart=always -d sample/testweb:20170615

By executing docker log along with container id, I get the below error-

WARNING: Failed to load the specified log manager class org.jboss.logmanager.LogManager
Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/logmanager/Level
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at org.jboss.modules.Module.run(Module.java:320)
    at org.jboss.modules.Main.main(Main.java:505)
 Caused by: java.lang.ClassNotFoundException: org.jboss.logmanager.Level
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:348)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)

Please help me on this!
Thanks
Sarahjohn