mirror of
https://github.com/corda/corda.git
synced 2025-06-02 23:50:54 +00:00
NOTICK - allow resolveJar errors to be quieter (#5898)
This commit is contained in:
parent
fa55b66c8d
commit
d0faf4d7cb
@ -164,7 +164,7 @@ class DriverDSLImpl(
|
|||||||
|
|
||||||
private val bytemanJarPath: String? by lazy {
|
private val bytemanJarPath: String? by lazy {
|
||||||
try {
|
try {
|
||||||
resolveJar("org.jboss.byteman.agent.Transformer")
|
resolveJar("org.jboss.byteman.agent.Transformer", verbose = false)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
@ -180,13 +180,16 @@ class DriverDSLImpl(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun resolveJar(className: String): String {
|
private fun resolveJar(className: String, verbose: Boolean = true): String {
|
||||||
return try {
|
return try {
|
||||||
val type = Class.forName(className)
|
val type = Class.forName(className)
|
||||||
val src = type.protectionDomain.codeSource
|
val src = type.protectionDomain.codeSource
|
||||||
src.location.toPath().toString()
|
src.location.toPath().toString()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
log.warn("Unable to locate JAR for class given by `$className` on classpath: ${e.message}", e)
|
when (verbose) {
|
||||||
|
true -> log.warn("Unable to locate JAR for class given by `$className` on classpath:", e)
|
||||||
|
false -> log.info("Unable to locate JAR for class given by `$className` on classpath")
|
||||||
|
}
|
||||||
throw e
|
throw e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user