SLF4J:类路径包含多个 SLF4J 绑定。 SLF4J:在 [jar:file:/home/cc-dev/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-slf4j-impl/2.17.1/84692d456bcce689355d33d68167875e486954dd/ 中找到绑定log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J:在 [jar:file:/home/cc-dev/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.2.3/7c4f3c474fb2c041d8028740440937705ebb473a/logback-classic- 中找到绑定1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J:有关解释,请参阅http://www.slf4j.org/codes.html#multiple_bindings。 SLF4J:实际绑定类型为 [org.apache.logging.slf4j.Log4jLoggerFactory] 线程“主”java.lang.IllegalArgumentException 中的异常:LoggerFactory 不是 Logback LoggerContext 但 Logback 在类路径上。删除 Logback 或竞争实现(从文件加载的类 org.apache.logging.slf4j.Log4jLoggerFactory:/home/cc-dev/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/ log4j-slf4j-impl/2.17.1/84692d456bcce689355d33d68167875e486954dd/log4j-slf4j-impl-2.17.1.jar)。如果您使用的是 WebLogic,则需要将“org.slf4j”添加到 WEB-INF/weblogic.xml 中的 prefer-application-packages:org.apache.logging.slf4j.Log4jLoggerFactory 在 org.springframework.util.Assert.instanceCheckFailed(Assert.java:637) 在 org.springframework.util.Assert.isInstanceOf(Assert.java:537) 在 org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:274) 在 org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:99) 在 org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationStartingEvent(LoggingApplicationListener.java:191) 在 org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:170) 在 org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) 在 org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) 在 org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) 在 org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127) 在 org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:68) 在 org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:48) 在 org.springframework.boot.SpringApplication.run(SpringApplication.java:313) 在 net.corda.samples.example.webserver.Starter.main(Starter.java:21)
//gradle file
buildscript {//properties that you need to build the project
Properties constants = new Properties()
file("$projectDir/../constants.properties").withInputStream { constants.load(it) }
ext {
corda_release_group = constants.getProperty("cordaReleaseGroup")
corda_core_release_group = constants.getProperty("cordaCoreReleaseGroup")
corda_release_version = constants.getProperty("cordaVersion")
corda_core_release_version = constants.getProperty("cordaCoreVersion")
corda_gradle_plugins_version = constants.getProperty("gradlePluginsVersion")
kotlin_version = constants.getProperty("kotlinVersion")
junit_version = constants.getProperty("junitVersion")
quasar_version = constants.getProperty("quasarVersion")
log4j_version = constants.getProperty("log4jVersion")
slf4j_version = constants.getProperty("slf4jVersion")
corda_platform_version = constants.getProperty("platformVersion").toInteger()
//springboot
spring_boot_version = '2.0.2.RELEASE'
spring_boot_gradle_plugin_version = '2.0.2.RELEASE'
}
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://software.r3.com/artifactory/corda-releases' }
}
dependencies {
classpath "net.corda.plugins:cordapp:$corda_gradle_plugins_version"
classpath "net.corda.plugins:cordformation:$corda_gradle_plugins_version"
classpath "net.corda.plugins:quasar-utils:$corda_gradle_plugins_version"
classpath "org.springframework.boot:spring-boot-gradle-plugin:$spring_boot_gradle_plugin_version"
}
}
allprojects {//Properties that you need to compile your project (The application)
apply from: "${rootProject.projectDir}/repositories.gradle"
apply plugin: 'java'
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://software.r3.com/artifactory/corda' }
maven { url 'https://jitpack.io' }
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-parameters" // Required by Corda's serialisation framework.
}
jar {
// This makes the JAR's SHA-256 hash repeatable.
preserveFileTimestamps = false
reproducibleFileOrder = true
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}
apply plugin: 'net.corda.plugins.cordapp'
apply plugin: 'net.corda.plugins.cordformation'
apply plugin: 'net.corda.plugins.quasar-utils'
sourceSets {
main {
resources {
srcDir rootProject.file("config/dev")
}
}
}
//Module dependencies
dependencies {
// Corda dependencies.
cordaCompile "$corda_core_release_group:corda-core:$corda_core_release_version"
cordaCompile "$corda_release_group:corda-node-api:$corda_release_version"
cordaRuntime "$corda_release_group:corda:$corda_release_version"
// CorDapp dependencies.
cordapp project(":workflows")
cordapp project(":contracts")
cordaCompile "org.apache.logging.log4j:log4j-slf4j-impl:${log4j_version}"
cordaCompile "org.apache.logging.log4j:log4j-web:${log4j_version}"
cordaCompile "org.slf4j:jul-to-slf4j:$slf4j_version"
cordaDriver "net.corda:corda-shell:4.10"
}
//Task to deploy the nodes in order to bootstrap a network
task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
/* This property will load the CorDapps to each of the node by default, including the Notary. You can find them
* in the cordapps folder of the node at build/nodes/Notary/cordapps. However, the notary doesn't really understand
* the notion of cordapps. In production, Notary does not need cordapps as well. This is just a short cut to load
* the Corda network bootstrapper.
*/
nodeDefaults {
projectCordapp {
deploy = false
}
cordapp project(':contracts')
cordapp project(':workflows')
runSchemaMigration = true //This configuration is for any CorDapps with custom schema, We will leave this as true to avoid
//problems for developers who are not familiar with Corda. If you are not using custom schemas, you can change
//it to false for quicker project compiling time.
}
node {
name "O=Notary,L=London,C=GB"
notary = [validating : false]
p2pPort 10002
rpcSettings {
address("localhost:10003")
adminAddress("localhost:10043")
}
}
node {
name "O=PartyA,L=London,C=GB"
p2pPort 10005
rpcSettings {
address("localhost:10006")
adminAddress("localhost:10046")
}
rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
}
node {
name "O=PartyB,L=New York,C=US"
p2pPort 10008
rpcSettings {
address("localhost:10009")
adminAddress("localhost:10049")
}
rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
}
}