Skip to content

Commit

Permalink
Merge pull request #225 from solarwinds-cloud/cc/NH-78653
Browse files Browse the repository at this point in the history
NH-78653: Fix SDK's `java.lang.NoClassDefFoundError`
  • Loading branch information
cleverchuk authored Apr 23, 2024
2 parents 70734df + 13ef3e5 commit 773fa10
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 1 addition & 3 deletions solarwinds-otel-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ project.archivesBaseName = 'solarwinds-otel-sdk'
def relocatePackages = ext.relocatePackages

dependencies {
compileOnly project(":custom")
compileOnly project(":bootstrap")
compileOnly("io.opentelemetry:opentelemetry-sdk:${versions.opentelemetry}")

Expand All @@ -19,8 +18,7 @@ dependencies {
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-bootstrap:${versions.opentelemetryJavaagentAlpha}")

compileOnly("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api:${versions.opentelemetryJavaagent}")
compileOnly "com.solarwinds.joboe:core:${versions.joboe}"
compileOnly "com.solarwinds.joboe:metrics:${versions.joboe}"
implementation "com.solarwinds.joboe:logging:${versions.joboe}"

testImplementation project(path: ":bootstrap")
testImplementation 'org.mockito:mockito-core:5.3.0'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package com.solarwinds.api.ext;

import com.solarwinds.joboe.logging.Logger;
import com.solarwinds.joboe.logging.LoggerFactory;
import com.solarwinds.opentelemetry.core.AgentState;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;

public class SolarwindsAgent {
private SolarwindsAgent() {}

private static final Logger logger = Logger.getLogger(SolarwindsAgent.class.getName());
private static final Logger logger = LoggerFactory.getLogger();

private static boolean agentAttached = false;

Expand All @@ -18,7 +19,7 @@ private SolarwindsAgent() {}
agentAttached = true;

} catch (ClassNotFoundException | NoClassDefFoundError | NoSuchMethodError e) {
logger.warning("The SolarWinds APM Agent is not available. The SDK will be no-op.");
logger.warn("The SolarWinds APM Agent is not available. The SDK will be no-op.");
}
}

Expand Down

0 comments on commit 773fa10

Please sign in to comment.