hi all, i’m useing the new 7.15 camunda integrate with spring-boot.
when start, i break with an error java.lang.NoClassDefFoundError: connectjar.org.apache.log4j.Priority
.
how to fix it.
error throw at this line, but the line has nothing todo with Priority.
public class Log4JLogger implements Log, Serializable {
/** Serializable version identifier. */
private static final long serialVersionUID = 5160705895411730424L;
// ------------------------------------------------------------- Attributes
/** The fully qualified name of the Log4JLogger class. */
private static final String FQCN = Log4JLogger.class.getName(); ////<<<--this line error
private transient volatile Logger logger = null;
/** Logger name */
private final String name;
private static final Priority traceLevel; // this line's has "org.apache.log4j.Priority"
the stack:
class$:53, Log4JLogger (connectjar.org.apache.commons.logging.impl)
<clinit>:78, Log4JLogger (connectjar.org.apache.commons.logging.impl)
forName0:-1, Class (java.lang)
forName:348, Class (java.lang)
createLogFromClass:998, LogFactoryImpl (connectjar.org.apache.commons.logging.impl)
discoverLogImplementation:844, LogFactoryImpl (connectjar.org.apache.commons.logging.impl)
newInstance:541, LogFactoryImpl (connectjar.org.apache.commons.logging.impl)
getInstance:292, LogFactoryImpl (connectjar.org.apache.commons.logging.impl)
getInstance:269, LogFactoryImpl (connectjar.org.apache.commons.logging.impl)
getLog:655, LogFactory (connectjar.org.apache.commons.logging)
<init>:82, DefaultHostnameVerifier (connectjar.org.apache.http.conn.ssl)
build:966, HttpClientBuilder (connectjar.org.apache.http.impl.client)
createSystem:64, HttpClients (connectjar.org.apache.http.impl.client)
createClient:58, AbstractHttpConnector (org.camunda.connect.httpclient.impl)
<init>:53, AbstractHttpConnector (org.camunda.connect.httpclient.impl)
<init>:31, HttpConnectorImpl (org.camunda.connect.httpclient.impl)
createConnectorInstance:29, HttpConnectorProviderImpl (org.camunda.connect.httpclient.impl)
createConnectorInstance:22, HttpConnectorProviderImpl (org.camunda.connect.httpclient.impl)
registerProvider:186, Connectors (org.camunda.connect)
registerConnectors:176, Connectors (org.camunda.connect)
initializeConnectors:163, Connectors (org.camunda.connect)
ensureConnectorProvidersInitialized:149, Connectors (org.camunda.connect)
getConnectorById:138, Connectors (org.camunda.connect)
getConnector:77, Connectors (org.camunda.connect)
initTelemetry:2713, ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg)
init:1038, ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg)
buildProcessEngine:977, ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg)
buildProcessEngine:67, SpringTransactionsProcessEngineConfiguration (org.camunda.bpm.engine.spring)
getObject:55, ProcessEngineFactoryBean (org.camunda.bpm.engine.spring)
getObject:34, ProcessEngineFactoryBean (org.camunda.bpm.engine.spring)
doGetObjectFromFactoryBean:169, FactoryBeanRegistrySupport
......
the jar has not connectjar.org.apache.log4j
gradle.build:
configurations {
providedRuntime
// remove default logger
all*.exclude module: 'spring-boot-starter-logging'
all*.exclude module: 'logback-classic'
all*.exclude module: 'log4j-over-slf4j'
all*.exclude module: 'slf4j-log4j12' //注意这里一定要加上
}
dependencies {
implementation project(':base-definition')
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.security:spring-security-config'
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
implementation 'org.springframework.boot:spring-boot-starter-log4j2' // here log4j2
}