我们可以在JBoss (WildFly)上为我们的应用程序设置JBoss。这一步没有任何问题,我们可以在Azure门户上看到监视web请求的数据。
但是我们在安装NoClassDefFoundError时得到了代理人。
我试了几天才解决了这个问题,但没有成功。将代理jar添加到我们的应用程序依赖项(WEB-INF/lib)中没有帮助。
顺便提一句,我们可以让我们的应用程序成功地使用New代理运行。这个问题的一个原因似乎是特定于Application代理的。
我们的应用程序运行在一个Docker容器上:
JBoss日志:
wildfly | JBoss Bootstrap Environment
wildfly |
wildfly | JBOSS_HOME: /opt/wildfly
wildfly |
wildfly | JAVA: /opt/java/bin/java
wildfly |
wildfly | JAVA_OPTS: -server -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:/opt/wildfly/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-2.0.4.Final.jar -Xms64m -Xmx1024m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager -Djava.awt.headless=true -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n -javaagent:/opt/wildfly/applicationinsights/applicationinsights-agent-2.0.0-BETA.jar
wildfly |
wildfly | =========================================================================
wildfly |
wildfly | Listening for transport dt_socket at address: 8787
wildfly | AI-Agent: INFO 12-01-2018 15:35, 1: Agent jar found at /opt/wildfly/applicationinsights/applicationinsights-agent-2.0.0-BETA.jar
wildfly | AI-Agent: INFO 12-01-2018 15:35, 1: Agent jar name is applicationinsights-agent-2.0.0-BETA.jar
wildfly | AI-Agent: TRACE 12-01-2018 15:35, 1: Successfully loaded Agent jar
wildfly | AI-Agent: INFO 12-01-2018 15:35, 1: Agent is up
wildfly | 15:35:43,988 INFO [org.jboss.modules] (main) JBoss Modules version 1.5.2.Final
wildfly | 15:35:44,116 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
wildfly | 15:35:44,194 INFO [org.jboss.as] (MSC service thread 1-4) WFLYSRV0049: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) starting
...
<truncated>
...
wildfly | Caused by: java.sql.SQLException: java.lang.NoClassDefFoundError: com/microsoft/applicationinsights/agent/internal/coresync/impl/ImplementationsCoordinator
wildfly | at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:963)
wildfly | at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:896)
wildfly | at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:885)
wildfly | at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:860)
wildfly | at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:877)
wildfly | at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:873)
wildfly | at com.mysql.jdbc.Util.handleNewInstance(Util.java:422)
wildfly | at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:410)
wildfly | at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:328)
wildfly | at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:321)
wildfly | ... 28 more
wildfly | Caused by: java.lang.NoClassDefFoundError: com/microsoft/applicationinsights/agent/internal/coresync/impl/ImplementationsCoordinator
wildfly | at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1424)
wildfly | at com.mysql.jdbc.ConnectionImpl.loadServerVariables(ConnectionImpl.java:3833)
wildfly | at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3283)
wildfly | at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2126)
wildfly | at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2088)
wildfly | at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:806)
wildfly | at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
wildfly | at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
wildfly | at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
wildfly | at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
wildfly | at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
wildfly | at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
wildfly | ... 31 more发布于 2018-07-04 05:18:41
我也遇到了同样的问题,直到我用下面的配置来处理Wildfly
set JAVA_OPTS=%JAVA_OPTS% -javaagent:D:\workspace\applicationinsights-agent-2.1.1.jar
set JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=org.jboss.byteman,com.singularity,org.jboss.logmanager,com.microsoft.applicationinsights.agent
set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:D:/wildfly-10.1.0.Final/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-2.0.3.Final.jar发布于 2019-11-20 22:11:38
第3行不相关,但第2行包含修复。我还必须在其中添加另一个值:-Djboss.modules.system.pkgs=org.jboss.byteman,com.microsoft.applicationinsights.agent,org.glowroot.instrumentation.api
您还可以在bin/standalone.conf if [ "x$JBOSS_MODULES_SYSTEM_PKGS" = "x" ]; then JBOSS_MODULES_SYSTEM_PKGS="org.jboss.bytemancom.microsoft.applicationinsights.agent,org.glowroot.instrumentation.api" fi中进行更改
https://stackoverflow.com/questions/48275650
复制相似问题