Logback doesn't show stacktrace - java

I'm using Spring Boot 1.2.0 and I don't see exception stack trace in the console.
Everything else is logged, the SQL, transaction start and rollback (when exception occurs) but I don't see them. Does anyone have some ideas?
logback.xml in resources folder
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="true" scan="true">
<jmxConfigurator/>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<logger name="org.apt.crm" level="DEBUG"/>
<logger name="org.springframework" level="ERROR"/>
<logger name="org.hibernate" level="ERROR"/>
<logger name="org.springframework.orm.jpa" level="ERROR"/>
<logger name="org.springframework.transaction" level="DEBUG"/>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>
</configuration>
Gradle dependencies
dependencies {
// Core
// ====
// Spring Boot
compile("org.springframework.boot:spring-boot-starter-web") {
exclude module: 'spring-boot-starter-tomcat'
exclude module: 'commons-logging'
}
if (!buildWar)
{
compile "org.springframework.boot:spring-boot-starter-jetty"
}
compile "org.springframework.boot:spring-boot-starter-security"
compile "org.springframework.boot:spring-boot-starter-aop"
compile "org.springframework.boot:spring-boot-starter-data-jpa"
compile "org.springframework.boot:spring-boot-starter-thymeleaf"
// Needed for thymeleaf HTML5LEGACY mode
compile "net.sourceforge.nekohtml:nekohtml:$nekoHtmlVersion"
compile("org.springframework.boot:spring-boot-starter-actuator") { exclude module: 'hsqldb' }
// Bean Validation
compile "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
// Jetty Server
compile "org.eclipse.jetty:jetty-servlets:$jettyVersion"
if (!buildWar)
{
compile "org.eclipse.jetty:jetty-client:$jettyVersion"
compile "org.eclipse.jetty:jetty-continuation:$jettyVersion"
compile "org.eclipse.jetty:jetty-http:$jettyVersion"
compile "org.eclipse.jetty:jetty-io:$jettyVersion"
compile "org.eclipse.jetty:jetty-jsp:$jettyVersion"
compile "org.eclipse.jetty:jetty-security:$jettyVersion"
compile "org.eclipse.jetty:jetty-server:$jettyVersion"
compile "org.eclipse.jetty:jetty-servlet:$jettyVersion"
compile "org.eclipse.jetty:jetty-util:$jettyVersion"
compile "org.eclipse.jetty:jetty-webapp:$jettyVersion"
compile "org.eclipse.jetty:jetty-xml:$jettyVersion"
// Servlet API
compile "javax.servlet:javax.servlet-api:$servletApiVersion"
}
// JAX-RS REST
compile "org.glassfish.hk2:spring-bridge:$springHk2BridgeVersion"
compile "org.glassfish.jersey.core:jersey-server:$jerseyVersion"
compile "org.glassfish.jersey.containers:jersey-container-servlet:$jerseyVersion"
compile "org.glassfish.jersey.ext:jersey-bean-validation:$jerseyVersion"
// Apache HTTP Client
compile ("org.glassfish.jersey.connectors:jersey-apache-connector:$jerseyVersion")
{
exclude module: 'commons-logging'
}
// Jackson JSON
compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jacksonVersion"
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion"
// Swagger Docs
compile("com.wordnik:swagger-jaxrs_2.10:$swaggerVersion") {
exclude module: 'jsr311-api'
exclude module: 'scala-compiler'
}
// JS, HTML, CSS minimizer
compile "ro.isdc.wro4j:wro4j-core:$wroVersion"
compile("ro.isdc.wro4j:wro4j-extensions:$wroVersion") {
exclude module: 'commons-logging'
}
// Mapper
compile("net.sf.dozer:dozer:$dozerVersion") {
exclude module: 'jcl-over-slf4j'
exclude module: 'slf4j-log4j12'
}
// Database
compile "com.h2database:h2:$h2Version"
// Coda Hale Metrics
compile "com.codahale.metrics:metrics-core:$metricsVersion"
// Utilities
// =========
compile "org.projectlombok:lombok:$lombokVersion"
compile "com.google.guava:guava:$guavaVersion"
// Testing
// ========
testCompile("org.springframework.boot:spring-boot-starter-test") {
exclude module: 'commons-logging'
}
// Mockito
testCompile "org.mockito:mockito-core:$mockitoVersion"
// Used for asserts in verification
testCompile "org.easytesting:fest-assert:$festAssertVersion"
}
Console output at server startup
:37:38,267 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
:37:38,268 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
:37:38,268 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/Clowio/apt-crm/src/main/resources/logback.xml]
:37:38,525 |-INFO in ReconfigureOnChangeFilter{invocationCounter=0} - Will scan for changes in [[/Clowio/apt-crm/src/main/resources/logback.xml]] every 60 seconds.
:37:38,525 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Adding ReconfigureOnChangeFilter as a turbo filter
:37:38,536 |-INFO in ch.qos.logback.classic.joran.action.JMXConfiguratorAction - begin
:37:38,620 |-INFO in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil#71d44a3 - Adding [jar:file:/Users/lalala/.m2/repository/org/springframework/boot/spring-boot/1.2.0.RELEASE/spring-boot-1.2.0.RELEASE.jar!/org/springframework/boot/logging/logback/base.xml] to configuration watch list.
:37:38,620 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList#7b98f307 - URL [jar:file:/Users/lalala/.m2/repository/org/springframework/boot/spring-boot/1.2.0.RELEASE/spring-boot-1.2.0.RELEASE.jar!/org/springframework/boot/logging/logback/base.xml] is not of type file
:37:38,624 |-INFO in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil#71d44a3 - Adding [jar:file:/Users/lalala/.m2/repository/org/springframework/boot/spring-boot/1.2.0.RELEASE/spring-boot-1.2.0.RELEASE.jar!/org/springframework/boot/logging/logback/defaults.xml] to configuration watch list.
:37:38,624 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList#7b98f307 - URL [jar:file:/Users/lalala/.m2/repository/org/springframework/boot/spring-boot/1.2.0.RELEASE/spring-boot-1.2.0.RELEASE.jar!/org/springframework/boot/logging/logback/defaults.xml] is not of type file
:37:38,628 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word clr with class [org.springframework.boot.logging.logback.ColorConverter]
:37:38,628 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word wex with class [org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter]
:37:38,634 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [org.springframework.boot.logging.logback.LevelRemappingAppender]
:37:38,637 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [DEBUG_LEVEL_REMAPPER]
:37:38,667 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.catalina.startup.DigesterFactory] to ERROR
:37:38,667 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.catalina.util.LifecycleBase] to ERROR
:37:38,667 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.coyote.http .Http NioProtocol] to WARN
:37:38,667 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.sshd.common.util.SecurityUtils] to WARN
:37:38,667 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.tomcat.util.net.NioSelectorPool] to WARN
:37:38,667 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.crsh.plugin] to WARN
:37:38,667 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.crsh.ssh] to WARN
:37:38,667 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.eclipse.jetty.util.component.AbstractLifeCycle] to ERROR
:37:38,668 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.hibernate.validator.internal.util.Version] to WARN
:37:38,668 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.springframework.boot.actuate.autoconfigure.CrshAutoConfiguration] to WARN
:37:38,668 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting additivity of logger [org.springframework.boot.actuate.endpoint.jmx] to false
:37:38,668 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [DEBUG_LEVEL_REMAPPER] to Logger[org.springframework.boot.actuate.endpoint.jmx]
:37:38,669 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting additivity of logger [org.thymeleaf] to false
:37:38,670 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [DEBUG_LEVEL_REMAPPER] to Logger[org.thymeleaf]
:37:38,670 |-INFO in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil#71d44a3 - Adding [jar:file:/Users/lalala/.m2/repository/org/springframework/boot/spring-boot/1.2.0.RELEASE/spring-boot-1.2.0.RELEASE.jar!/org/springframework/boot/logging/logback/console-appender.xml] to configuration watch list.
:37:38,671 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList#7b98f307 - URL [jar:file:/Users/lalala/.m2/repository/org/springframework/boot/spring-boot/1.2.0.RELEASE/spring-boot-1.2.0.RELEASE.jar!/org/springframework/boot/logging/logback/console-appender.xml] is not of type file
:37:38,673 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
:37:38,678 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CONSOLE]
:37:38,694 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
:37:38,769 |-INFO in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil#71d44a3 - Adding [jar:file:/Users/lalala/.m2/repository/org/springframework/boot/spring-boot/1.2.0.RELEASE/spring-boot-1.2.0.RELEASE.jar!/org/springframework/boot/logging/logback/file-appender.xml] to configuration watch list.
:37:38,769 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList#7b98f307 - URL [jar:file:/Users/lalala/.m2/repository/org/springframework/boot/spring-boot/1.2.0.RELEASE/spring-boot-1.2.0.RELEASE.jar!/org/springframework/boot/logging/logback/file-appender.xml] is not of type file
:37:38,773 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
:37:38,778 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
:37:38,789 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
:37:38,809 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy#2177849e - No compression will be used
:37:38,821 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Active log file name: /var/folders/j4/ntrxjqzx5kq19hbxfwc10czc0000gn/T//spring.log
:37:38,822 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - File property is set to [/var/folders/j4/ntrxjqzx5kq19hbxfwc10czc0000gn/T//spring.log]
:37:38,823 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
:37:38,823 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [CONSOLE] to Logger[ROOT]
:37:38,823 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
:37:38,824 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apt.crm] to DEBUG
:37:38,824 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.springframework] to ERROR
:37:38,824 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.hibernate] to ERROR
:37:38,824 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.springframework.orm.jpa] to ERROR
:37:38,824 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.springframework.transaction] to DEBUG
:37:38,824 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
:37:38,824 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
:37:38,824 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
:37:38,826 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
:37:38,826 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
:37:38,826 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
:37:38,826 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator#10959ece - Registering current configuration as safe fallback point

Solution is in this question:
Global Exception Handling in Jersey & Spring?
After creating ExceptionMapper everything works fine.

Related

Logback not able to instantiate FileAppender - Failed to instantiate type ch.qos.logback.?core.FileAppender

I have logback setup and working in my application using the ConsoleAppender, but I want to add the FileAppender to my configuration so that I can start getting logs in a file as well. However, when I change my logback.xml file to include the FileAppender in the configuration, I get a stacktrace and an error from logback saying it couldn't instantiate the type ch.qos.logback.?core.FileAppender.
Incidentally, I was just starting out by getting FileAppender working, but just learned that RollingFileAppender is what I would need to support files that, well, roll. So I will likely ultimately be using that appender if it matters.
Here's my logback.xml file.
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>C:\testFile.log</file>
<append>true</append>
<!-- set immediateFlush to false for much higher logging throughput -->
<immediateFlush>true</immediateFlush>
<!-- encoders are assigned the type
ch.qos.logback.classic.​encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</pattern>
</encoder>
</appender>
<root level="info">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</root>
</configuration>
And here is the logged output in the console
17:56:14,729 |-INFO in ch.qos.logback.classic.LoggerContext[default] - This is logback-classic version 1.4.3
17:56:14,793 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
17:56:14,793 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/C:/data-sync-1.0-SNAPSHOT.jar!/logback.xml]
17:56:14,812 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList#43ee72e6 - URL [jar:file:/C:/data-sync-1.0-SNAPSHOT.jar!/logback.xml] is not of type file
17:56:14,999 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - Processing appender named [STDOUT]
17:56:14,999 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
17:56:15,015 |-INFO in ch.qos.logback.core.model.processor.ImplicitModelHandler - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
17:56:15,077 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - Processing appender named [FILE]
17:56:15,077 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - About to instantiate appender of type [ch.qos.logback.?core.FileAppender]
17:56:15,077 |-ERROR in ch.qos.logback.core.model.processor.AppenderModelHandler - Could not create an Appender of type [ch.qos.logback.?core.FileAppender]. ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type ch.qos.logback.?core.FileAppender
at ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type ch.qos.logback.?core.FileAppender
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:69)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassName(OptionHelper.java:44)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassName(OptionHelper.java:33)
at at ch.qos.logback.core.model.processor.AppenderModelHandler.handle(AppenderModelHandler.java:67)
at at ch.qos.logback.core.model.processor.DefaultProcessor.secondPhaseTraverse(DefaultProcessor.java:241)
at at ch.qos.logback.core.model.processor.DefaultProcessor.secondPhaseTraverse(DefaultProcessor.java:253)
at at ch.qos.logback.core.model.processor.DefaultProcessor.traversalLoop(DefaultProcessor.java:90)
at at ch.qos.logback.core.model.processor.DefaultProcessor.process(DefaultProcessor.java:106)
at at ch.qos.logback.core.joran.GenericXMLConfigurator.processModel(GenericXMLConfigurator.java:200)
at at ch.qos.logback.core.joran.GenericXMLConfigurator.doConfigure(GenericXMLConfigurator.java:166)
at at ch.qos.logback.core.joran.GenericXMLConfigurator.doConfigure(GenericXMLConfigurator.java:122)
at at ch.qos.logback.core.joran.GenericXMLConfigurator.doConfigure(GenericXMLConfigurator.java:65)
at at ch.qos.logback.classic.util.DefaultJoranConfigurator.configureByResource(DefaultJoranConfigurator.java:53)
at at ch.qos.logback.classic.util.DefaultJoranConfigurator.configure(DefaultJoranConfigurator.java:34)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:98)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:77)
at at ch.qos.logback.classic.spi.LogbackServiceProvider.initializeLoggerContext(LogbackServiceProvider.java:50)
at at ch.qos.logback.classic.spi.LogbackServiceProvider.initialize(LogbackServiceProvider.java:41)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:152)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:139)
at at org.slf4j.LoggerFactory.getProvider(LoggerFactory.java:422)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:408)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
at at com.domain.program.App.<clinit>(App.java:12)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.?core.FileAppender
at at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:56)
at ... 24 common frames omitted
17:56:15,077 |-ERROR in ch.qos.logback.core.model.processor.DefaultProcessor#233fe9b6 - Failed to traverse model appender ch.qos.logback.core.model.processor.ModelHandlerException: ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type ch.qos.logback.?core.FileAppender
at ch.qos.logback.core.model.processor.ModelHandlerException: ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type ch.qos.logback.?core.FileAppender
at at ch.qos.logback.core.model.processor.AppenderModelHandler.handle(AppenderModelHandler.java:75)
at at ch.qos.logback.core.model.processor.DefaultProcessor.secondPhaseTraverse(DefaultProcessor.java:241)
at at ch.qos.logback.core.model.processor.DefaultProcessor.secondPhaseTraverse(DefaultProcessor.java:253)
at at ch.qos.logback.core.model.processor.DefaultProcessor.traversalLoop(DefaultProcessor.java:90)
at at ch.qos.logback.core.model.processor.DefaultProcessor.process(DefaultProcessor.java:106)
at at ch.qos.logback.core.joran.GenericXMLConfigurator.processModel(GenericXMLConfigurator.java:200)
at at ch.qos.logback.core.joran.GenericXMLConfigurator.doConfigure(GenericXMLConfigurator.java:166)
at at ch.qos.logback.core.joran.GenericXMLConfigurator.doConfigure(GenericXMLConfigurator.java:122)
at at ch.qos.logback.core.joran.GenericXMLConfigurator.doConfigure(GenericXMLConfigurator.java:65)
at at ch.qos.logback.classic.util.DefaultJoranConfigurator.configureByResource(DefaultJoranConfigurator.java:53)
at at ch.qos.logback.classic.util.DefaultJoranConfigurator.configure(DefaultJoranConfigurator.java:34)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:98)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:77)
at at ch.qos.logback.classic.spi.LogbackServiceProvider.initializeLoggerContext(LogbackServiceProvider.java:50)
at at ch.qos.logback.classic.spi.LogbackServiceProvider.initialize(LogbackServiceProvider.java:41)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:152)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:139)
at at org.slf4j.LoggerFactory.getProvider(LoggerFactory.java:422)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:408)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
at at com.domain.program.App.<clinit>(App.java:12)
Caused by: ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type ch.qos.logback.?core.FileAppender
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:69)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassName(OptionHelper.java:44)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassName(OptionHelper.java:33)
at at ch.qos.logback.core.model.processor.AppenderModelHandler.handle(AppenderModelHandler.java:67)
at ... 21 common frames omitted
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.?core.FileAppender
at at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:56)
at ... 24 common frames omitted
17:56:15,077 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - Processing appender named [FILE]
17:56:15,077 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - About to instantiate appender of type [ch.qos.logback.?core.FileAppender]
17:56:15,077 |-ERROR in ch.qos.logback.core.model.processor.AppenderModelHandler - Could not create an Appender of type [ch.qos.logback.?core.FileAppender]. ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type ch.qos.logback.?core.FileAppender
at ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type ch.qos.logback.?core.FileAppender
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:69)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassName(OptionHelper.java:44)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassName(OptionHelper.java:33)
at at ch.qos.logback.core.model.processor.AppenderModelHandler.handle(AppenderModelHandler.java:67)
at at ch.qos.logback.core.model.processor.DefaultProcessor.secondPhaseTraverse(DefaultProcessor.java:241)
at at ch.qos.logback.core.model.processor.DefaultProcessor.secondPhaseTraverse(DefaultProcessor.java:253)
at at ch.qos.logback.core.model.processor.DefaultProcessor.traversalLoop(DefaultProcessor.java:90)
at at ch.qos.logback.core.model.processor.DefaultProcessor.process(DefaultProcessor.java:106)
at at ch.qos.logback.core.joran.GenericXMLConfigurator.processModel(GenericXMLConfigurator.java:200)
at at ch.qos.logback.core.joran.GenericXMLConfigurator.doConfigure(GenericXMLConfigurator.java:166)
at at ch.qos.logback.core.joran.GenericXMLConfigurator.doConfigure(GenericXMLConfigurator.java:122)
at at ch.qos.logback.core.joran.GenericXMLConfigurator.doConfigure(GenericXMLConfigurator.java:65)
at at ch.qos.logback.classic.util.DefaultJoranConfigurator.configureByResource(DefaultJoranConfigurator.java:53)
at at ch.qos.logback.classic.util.DefaultJoranConfigurator.configure(DefaultJoranConfigurator.java:34)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:98)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:77)
at at ch.qos.logback.classic.spi.LogbackServiceProvider.initializeLoggerContext(LogbackServiceProvider.java:50)
at at ch.qos.logback.classic.spi.LogbackServiceProvider.initialize(LogbackServiceProvider.java:41)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:152)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:139)
at at org.slf4j.LoggerFactory.getProvider(LoggerFactory.java:422)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:408)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
at at com.domain.program.App.<clinit>(App.java:12)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.?core.FileAppender
at at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:56)
at ... 24 common frames omitted
17:56:15,077 |-ERROR in ch.qos.logback.core.model.processor.DefaultProcessor#233fe9b6 - Failed to traverse model appender ch.qos.logback.core.model.processor.ModelHandlerException: ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type ch.qos.logback.?core.FileAppender
at ch.qos.logback.core.model.processor.ModelHandlerException: ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type ch.qos.logback.?core.FileAppender
at at ch.qos.logback.core.model.processor.AppenderModelHandler.handle(AppenderModelHandler.java:75)
at at ch.qos.logback.core.model.processor.DefaultProcessor.secondPhaseTraverse(DefaultProcessor.java:241)
at at ch.qos.logback.core.model.processor.DefaultProcessor.secondPhaseTraverse(DefaultProcessor.java:253)
at at ch.qos.logback.core.model.processor.DefaultProcessor.traversalLoop(DefaultProcessor.java:90)
at at ch.qos.logback.core.model.processor.DefaultProcessor.process(DefaultProcessor.java:106)
at at ch.qos.logback.core.joran.GenericXMLConfigurator.processModel(GenericXMLConfigurator.java:200)
at at ch.qos.logback.core.joran.GenericXMLConfigurator.doConfigure(GenericXMLConfigurator.java:166)
at at ch.qos.logback.core.joran.GenericXMLConfigurator.doConfigure(GenericXMLConfigurator.java:122)
at at ch.qos.logback.core.joran.GenericXMLConfigurator.doConfigure(GenericXMLConfigurator.java:65)
at at ch.qos.logback.classic.util.DefaultJoranConfigurator.configureByResource(DefaultJoranConfigurator.java:53)
at at ch.qos.logback.classic.util.DefaultJoranConfigurator.configure(DefaultJoranConfigurator.java:34)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:98)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:77)
at at ch.qos.logback.classic.spi.LogbackServiceProvider.initializeLoggerContext(LogbackServiceProvider.java:50)
at at ch.qos.logback.classic.spi.LogbackServiceProvider.initialize(LogbackServiceProvider.java:41)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:152)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:139)
at at org.slf4j.LoggerFactory.getProvider(LoggerFactory.java:422)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:408)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
at at com.domain.program.App.<clinit>(App.java:12)
Caused by: ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type ch.qos.logback.?core.FileAppender
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:69)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassName(OptionHelper.java:44)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassName(OptionHelper.java:33)
at at ch.qos.logback.core.model.processor.AppenderModelHandler.handle(AppenderModelHandler.java:67)
at ... 21 common frames omitted
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.?core.FileAppender
at at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:56)
at ... 24 common frames omitted
17:56:15,077 |-INFO in ch.qos.logback.core.model.processor.DefaultProcessor#233fe9b6 - End of configuration.
17:56:15,077 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator#358ee631 - Registering current configuration as safe fallback point
My pom.xml dependencies section looks like this
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.4</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.4.3</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>2.0.SP1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Thank you in advance for your help.
------------------------------ EDIT ------------------------------
I have tried fixing this by adding logback.core in my pom.xml, but I still get the same error. I have also confirmed that both logback-core-1.4.3.jar and logback-classic-1.4.3.jar are in my lib folder.
<dependency>
<groupId>ch.qos.l<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.4.3</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.4.3</version>
</dependency>

Access is denied while installing cassandra

Here I am trying to install cassandra on windows 10 but it's failing with the above error. I have set JAVA_HOME and cassandra paths. Python is also installed. I also tried changing cassandra.yaml listen_address: 127.0.0.1 and rpc_address: 127.0.0.1 but nothing is working. Complete error is given below:
C:\Users\Sudarshan>cassandra -f
'powershell' is not recognized as an internal or external command,
operable program or batch file.
WARNING! Powershell script execution unavailable.
Please use 'powershell Set-ExecutionPolicy Unrestricted'
on this user-account to run cassandra with fully featured
functionality on this platform.
Starting with legacy startup options
Starting Cassandra Server
21:48:54,612 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/C:/Program%20Files/apache-cassandra-3.11.5/conf/logback.xml]
21:48:54,709 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
21:48:54,716 |-INFO in ReconfigureOnChangeFilter{invocationCounter=0} - Will scan for changes in [[C:\Program Files\apache-cassandra-3.11.5\conf\logback.xml]] every 60 seconds.
21:48:54,716 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Adding ReconfigureOnChangeFilter as a turbo filter
21:48:54,730 |-INFO in ch.qos.logback.classic.joran.action.JMXConfiguratorAction - begin
21:48:54,789 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
21:48:54,792 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [SYSTEMLOG]
21:48:54,838 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy#7ca48474 - Will use zip compression
21:48:54,864 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
21:48:54,886 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[SYSTEMLOG] - Active log file name: C:\Program Files\apache-cassandra-3.11.5\logs/system.log
21:48:54,886 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[SYSTEMLOG] - File property is set to [C:\Program Files\apache-cassandra-3.11.5\logs/system.log]
21:48:54,887 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[SYSTEMLOG] - openFile(C:\Program Files\apache-cassandra-3.11.5\logs/system.log,true) call failed. java.io.FileNotFoundException: C:\Program Files\apache-cassandra-3.11.5\logs\system.log (Access is denied)
at java.io.FileNotFoundException: C:\Program Files\apache-cassandra-3.11.5\logs\system.log (Access is denied)
at at java.io.FileOutputStream.open0(Native Method)
at at java.io.FileOutputStream.open(FileOutputStream.java:270)
at at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at at ch.qos.logback.core.recovery.ResilientFileOutputStream.<init>(ResilientFileOutputStream.java:28)
at at ch.qos.logback.core.FileAppender.openFile(FileAppender.java:148)
at at ch.qos.logback.core.FileAppender.start(FileAppender.java:108)
at at ch.qos.logback.core.rolling.RollingFileAppender.start(RollingFileAppender.java:86)
at at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:96)
at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:77)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:152)
at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)
at at org.apache.cassandra.service.CassandraDaemon.<clinit>(CassandraDaemon.java:101)
21:48:54,887 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
21:48:54,887 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [DEBUGLOG]
21:48:54,888 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy#61a485d2 - Will use zip compression
21:48:54,889 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
21:48:54,889 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[DEBUGLOG] - Active log file name: C:\Program Files\apache-cassandra-3.11.5\logs/debug.log
21:48:54,889 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[DEBUGLOG] - File property is set to [C:\Program Files\apache-cassandra-3.11.5\logs/debug.log]
21:48:54,889 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[DEBUGLOG] - openFile(C:\Program Files\apache-cassandra-3.11.5\logs/debug.log,true) call failed. java.io.FileNotFoundException: C:\Program Files\apache-cassandra-3.11.5\logs\debug.log (Access is denied)
at java.io.FileNotFoundException: C:\Program Files\apache-cassandra-3.11.5\logs\debug.log (Access is denied)
at at java.io.FileOutputStream.open0(Native Method)
at at java.io.FileOutputStream.open(FileOutputStream.java:270)
at at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at at ch.qos.logback.core.recovery.ResilientFileOutputStream.<init>(ResilientFileOutputStream.java:28)
at at ch.qos.logback.core.FileAppender.openFile(FileAppender.java:148)
at at ch.qos.logback.core.FileAppender.start(FileAppender.java:108)
at at ch.qos.logback.core.rolling.RollingFileAppender.start(RollingFileAppender.java:86)
at at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:96)
at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:77)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:152)
at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)
at at org.apache.cassandra.service.CassandraDaemon.<clinit>(CassandraDaemon.java:101)
21:48:54,889 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.AsyncAppender]
21:48:54,891 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [ASYNCDEBUGLOG]
21:48:54,895 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [DEBUGLOG] to ch.qos.logback.classic.AsyncAppender[ASYNCDEBUGLOG]
21:48:54,895 |-INFO in ch.qos.logback.classic.AsyncAppender[ASYNCDEBUGLOG] - Attaching appender named [DEBUGLOG] to AsyncAppender.
21:48:54,895 |-INFO in ch.qos.logback.classic.AsyncAppender[ASYNCDEBUGLOG] - Setting discardingThreshold to 0
21:48:54,896 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
21:48:54,898 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
21:48:54,900 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
21:48:54,901 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
21:48:54,901 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [SYSTEMLOG] to Logger[ROOT]
21:48:54,901 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
21:48:54,901 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [ASYNCDEBUGLOG] to Logger[ROOT]
21:48:54,902 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.cassandra] to DEBUG
21:48:54,902 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.thinkaurelius.thrift] to ERROR
21:48:54,902 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
21:48:54,902 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator#39fb3ab6 - Registering current configuration as safe fallback point
INFO [main] 2020-02-12 21:48:55,011 YamlConfigurationLoader.java:89 - Configuration location: file:/C:/Program%20Files/apache-cassandra-3.11.5/conf/cassandra.yaml
INFO [main] 2020-02-12 21:48:55,591 Config.java:516 - Node configuration:[allocate_tokens_for_keyspace=null; authenticator=AllowAllAuthenticator; authorizer=AllowAllAuthorizer; auto_bootstrap=true; auto_snapshot=true; back_pressure_enabled=false; back_pressure_strategy=org.apache.cassandra.net.RateBasedBackPressure{high_ratio=0.9, factor=5, flow=FAST}; batch_size_fail_threshold_in_kb=50; batch_size_warn_threshold_in_kb=5; batchlog_replay_throttle_in_kb=1024; broadcast_address=null; broadcast_rpc_address=null; buffer_pool_use_heap_if_exhausted=true; cas_contention_timeout_in_ms=1000; cdc_enabled=false; cdc_free_space_check_interval_ms=250; cdc_raw_directory=null; cdc_total_space_in_mb=0; client_encryption_options=<REDACTED>; cluster_name=Test Cluster; column_index_cache_size_in_kb=2; column_index_size_in_kb=64; commit_failure_policy=stop; commitlog_compression=null; commitlog_directory=null; commitlog_max_compression_buffers_in_pool=3; commitlog_periodic_queue_size=-1; commitlog_segment_size_in_mb=32; commitlog_sync=periodic; commitlog_sync_batch_window_in_ms=NaN; commitlog_sync_period_in_ms=10000; commitlog_total_space_in_mb=null; compaction_large_partition_warning_threshold_mb=100; compaction_throughput_mb_per_sec=16; concurrent_compactors=null; concurrent_counter_writes=32; concurrent_materialized_view_writes=32; concurrent_reads=32; concurrent_replicates=null; concurrent_writes=32; counter_cache_keys_to_save=2147483647; counter_cache_save_period=7200; counter_cache_size_in_mb=null; counter_write_request_timeout_in_ms=5000; credentials_cache_max_entries=1000; credentials_update_interval_in_ms=-1; credentials_validity_in_ms=2000; cross_node_timeout=false; data_file_directories=[Ljava.lang.String;#42a48628; disk_access_mode=auto; disk_failure_policy=stop; disk_optimization_estimate_percentile=0.95; disk_optimization_page_cross_chance=0.1; disk_optimization_strategy=ssd; dynamic_snitch=true; dynamic_snitch_badness_threshold=0.1; dynamic_snitch_reset_interval_in_ms=600000; dynamic_snitch_update_interval_in_ms=100; enable_materialized_views=true; enable_sasi_indexes=true; enable_scripted_user_defined_functions=false; enable_user_defined_functions=false; enable_user_defined_functions_threads=true; encryption_options=null; endpoint_snitch=SimpleSnitch; file_cache_round_up=null; file_cache_size_in_mb=null; gc_log_threshold_in_ms=200; gc_warn_threshold_in_ms=1000; hinted_handoff_disabled_datacenters=[]; hinted_handoff_enabled=true; hinted_handoff_throttle_in_kb=1024; hints_compression=null; hints_directory=null; hints_flush_period_in_ms=10000; incremental_backups=false; index_interval=null; index_summary_capacity_in_mb=null; index_summary_resize_interval_in_minutes=60; initial_token=null; inter_dc_stream_throughput_outbound_megabits_per_sec=200; inter_dc_tcp_nodelay=false; internode_authenticator=null; internode_compression=dc; internode_recv_buff_size_in_bytes=0; internode_send_buff_size_in_bytes=0; key_cache_keys_to_save=2147483647; key_cache_save_period=14400; key_cache_size_in_mb=null; listen_address=localhost; listen_interface=null; listen_interface_prefer_ipv6=false; listen_on_broadcast_address=false; max_hint_window_in_ms=10800000; max_hints_delivery_threads=2; max_hints_file_size_in_mb=128; max_mutation_size_in_kb=null; max_streaming_retries=3; max_value_size_in_mb=256; memtable_allocation_type=heap_buffers; memtable_cleanup_threshold=null; memtable_flush_writers=0; memtable_heap_space_in_mb=null; memtable_offheap_space_in_mb=null; min_free_space_per_drive_in_mb=50; native_transport_flush_in_batches_legacy=true; native_transport_max_concurrent_connections=-1; native_transport_max_concurrent_connections_per_ip=-1; native_transport_max_concurrent_requests_in_bytes=-1; native_transport_max_concurrent_requests_in_bytes_per_ip=-1; native_transport_max_frame_size_in_mb=256; native_transport_max_negotiable_protocol_version=-2147483648; native_transport_max_threads=128; native_transport_port=9042; native_transport_port_ssl=null; num_tokens=256; otc_backlog_expiration_interval_ms=200; otc_coalescing_enough_coalesced_messages=8; otc_coalescing_strategy=DISABLED; otc_coalescing_window_us=200; partitioner=org.apache.cassandra.dht.Murmur3Partitioner; permissions_cache_max_entries=1000; permissions_update_interval_in_ms=-1; permissions_validity_in_ms=2000; phi_convict_threshold=8.0; prepared_statements_cache_size_mb=null; range_request_timeout_in_ms=10000; read_request_timeout_in_ms=5000; repair_session_max_tree_depth=18; request_scheduler=org.apache.cassandra.scheduler.NoScheduler; request_scheduler_id=null; request_scheduler_options=null; request_timeout_in_ms=10000; role_manager=CassandraRoleManager; roles_cache_max_entries=1000; roles_update_interval_in_ms=-1; roles_validity_in_ms=2000; row_cache_class_name=org.apache.cassandra.cache.OHCProvider; row_cache_keys_to_save=2147483647; row_cache_save_period=0; row_cache_size_in_mb=0; rpc_address=localhost; rpc_interface=null; rpc_interface_prefer_ipv6=false; rpc_keepalive=true; rpc_listen_backlog=50; rpc_max_threads=2147483647; rpc_min_threads=16; rpc_port=9160; rpc_recv_buff_size_in_bytes=null; rpc_send_buff_size_in_bytes=null; rpc_server_type=sync; saved_caches_directory=null; seed_provider=org.apache.cassandra.locator.SimpleSeedProvider{seeds=127.0.0.1}; server_encryption_options=<REDACTED>; slow_query_log_timeout_in_ms=500; snapshot_before_compaction=false; ssl_storage_port=7001; sstable_preemptive_open_interval_in_mb=50; start_native_transport=true; start_rpc=true; storage_port=7000; stream_throughput_outbound_megabits_per_sec=200; streaming_keep_alive_period_in_secs=300; streaming_socket_timeout_in_ms=86400000; thrift_framed_transport_size_in_mb=15; thrift_max_message_length_in_mb=16; thrift_prepared_statements_cache_size_mb=null; tombstone_failure_threshold=100000; tombstone_warn_threshold=1000; tracetype_query_ttl=86400; tracetype_repair_ttl=604800; transparent_data_encryption_options=org.apache.cassandra.config.TransparentDataEncryptionOptions#293a5bf6; trickle_fsync=false; trickle_fsync_interval_in_kb=10240; truncate_request_timeout_in_ms=60000; unlogged_batch_across_partitions_warn_threshold=10; user_defined_function_fail_timeout=1500; user_defined_function_warn_timeout=500; user_function_timeout_policy=die; windows_timer_interval=1; write_request_timeout_in_ms=2000]
INFO [main] 2020-02-12 21:48:55,591 DatabaseDescriptor.java:381 - DiskAccessMode 'auto' determined to be mmap, indexAccessMode is mmap
INFO [main] 2020-02-12 21:48:55,591 DatabaseDescriptor.java:439 - Global memtable on-heap threshold is enabled at 503MB
INFO [main] 2020-02-12 21:48:55,591 DatabaseDescriptor.java:443 - Global memtable off-heap threshold is enabled at 503MB
INFO [main] 2020-02-12 21:48:55,752 RateBasedBackPressure.java:123 - Initialized back-pressure with high ratio: 0.9, factor: 5, flow: FAST, window size: 2000.
INFO [main] 2020-02-12 21:48:55,753 DatabaseDescriptor.java:773 - Back-pressure is disabled with strategy org.apache.cassandra.net.RateBasedBackPressure{high_ratio=0.9, factor=5, flow=FAST}.
WARN [main] 2020-02-12 21:48:56,210 WindowsFailedSnapshotTracker.java:88 - Failed to open C:\Program Files\apache-cassandra-3.11.5\.toDelete. Obsolete snapshots from previous runs will not be deleted.
java.nio.file.AccessDeniedException: C:\Program Files\apache-cassandra-3.11.5\.toDelete
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:83) ~[na:1.8.0_73]
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) ~[na:1.8.0_73]
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) ~[na:1.8.0_73]
at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269) ~[na:1.8.0_73]
at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) ~[na:1.8.0_73]
at java.nio.file.Files.delete(Files.java:1126) ~[na:1.8.0_73]
at org.apache.cassandra.db.WindowsFailedSnapshotTracker.deleteOldSnapshots(WindowsFailedSnapshotTracker.java:84) ~[apache-cassandra-3.11.5.jar:3.11.5]
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:186) [apache-cassandra-3.11.5.jar:3.11.5]
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:620) [apache-cassandra-3.11.5.jar:3.11.5]
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:742) [apache-cassandra-3.11.5.jar:3.11.5]
Exception (java.lang.RuntimeException) encountered during startup: Failed to create failed snapshot tracking file [C:\Program Files\apache-cassandra-3.11.5\.toDelete]. Aborting
java.lang.RuntimeException: Failed to create failed snapshot tracking file [C:\Program Files\apache-cassandra-3.11.5\.toDelete]. Aborting
at org.apache.cassandra.db.WindowsFailedSnapshotTracker.deleteOldSnapshots(WindowsFailedSnapshotTracker.java:98)
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:186)
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:620)
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:742)
ERROR [main] 2020-02-12 21:48:56,223 CassandraDaemon.java:759 - Exception encountered during startup
java.lang.RuntimeException: Failed to create failed snapshot tracking file [C:\Program Files\apache-cassandra-3.11.5\.toDelete]. Aborting
at org.apache.cassandra.db.WindowsFailedSnapshotTracker.deleteOldSnapshots(WindowsFailedSnapshotTracker.java:98) ~[apache-cassandra-3.11.5.jar:3.11.5]
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:186) [apache-cassandra-3.11.5.jar:3.11.5]
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:620) [apache-cassandra-3.11.5.jar:3.11.5]
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:742) [apache-cassandra-3.11.5.jar:3.11.5]
Per the Cassandra installation guide here you need to run the Command Prompt as an Administrator. To do this go Start -> Command Prompt -> Right Click -> Run as administrator.

WireMock unable to set log4j level to INFO instead of DEBUG

I'm running JUnit testcases with WireMock. Embedded Jetty Server is configured as follows.
#Before
public void setup() {
final ResponseTemplateTransformer theTemplateTransformer =
new ResponseTemplateTransformer(false);
templateTransformerName = theTemplateTransformer.getName();
mWireMockServer = new WireMockServer(
WireMockConfiguration
.options()
.notifier(new ConsoleNotifier(false))
.extensions(theTemplateTransformer));
mWireMockServer.start();
}
The output of the setup() method alone is very verbose, about 200 lines long. It starts like this:
> Task :processResources
> Task :classes
> Task :compileTestJava
> Task :processTestResources
> Task :testClasses
> Task :test
log4j: Threshold ="null".
log4j: Level value for root is [DEBUG].
log4j: root level set to DEBUG
log4j: Class name: [org.apache.log4j.ConsoleAppender]
log4j: Setting property [immediateFlush] to [true].
log4j: Setting property [threshold] to [ALL].
log4j: Setting property [target] to [System.out].
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [%d{yyyy-MM-dd HH:mm:ss.SSS} [%5p] [%t] [%c{1}] [%F:%L] [%X{uuid}] - %m%n].
log4j: Adding appender named [ConsoleAppender] to category [root].
2019-12-09 11:28:06.813 [DEBUG] [Test worker] [log] [Log.java:159] [] - Logging to org.slf4j.impl.Log4jLoggerAdapter(wiremock.org.eclipse.jetty.util.log) via wiremock.org.eclipse.jetty.util.log.Slf4jLog
2019-12-09 11:28:06.820 [ INFO] [Test worker] [log] [Log.java:169] [] - Logging initialized #1394ms to wiremock.org.eclipse.jetty.util.log.Slf4jLog
2019-12-09 11:28:06.841 [DEBUG] [Test worker] [ContainerLifeCycle] [ContainerLifeCycle.java:412] [] - Server#2173e69b{STOPPED}[9.4.20.v20190813] added {QueuedThreadPool[qtp547179568]#209d4c30{STOPPED,8<=0<=14,i=0,r=-1,q=0}[NO_TRY],AUTO}
2019-12-09 11:28:06.856 [DEBUG] [Test worker] [ContainerLifeCycle] [ContainerLifeCycle.java:412] [] - HttpConnectionFactory#4f25c098[HTTP/1.1] added {HttpConfiguration#613f727b{32768/8192,8192/8192,https://:0,[]},POJO}
2019-12-09 11:28:06.864 [DEBUG] [Test worker] [ContainerLifeCycle] [ContainerLifeCycle.java:412] [] - NetworkTrafficServerConnector#5a238421{null,[]}{0.0.0.0:0} added {Server#2173e69b{STOPPED}[9.4.20.v20190813],UNMANAGED}
2019-12-09 11:28:06.865 [DEBUG] [Test worker] [ContainerLifeCycle] [ContainerLifeCycle.java:412] [] - NetworkTrafficServerConnector#5a238421{null,[]}{0.0.0.0:0} added {QueuedThreadPool[qtp547179568]#209d4c30{STOPPED,8<=0<=14,i=0,r=-1,q=0}[NO_TRY],AUTO}
2019-12-09 11:28:06.865 [DEBUG] [Test worker] [ContainerLifeCycle] [ContainerLifeCycle.java:412] [] - NetworkTrafficServerConnector#5a238421{null,[]}{0.0.0.0:0} added {ScheduledExecutorScheduler#5839ea4{STOPPED},AUTO}
2019-12-09 11:28:06.866 [DEBUG] [Test worker] [ContainerLifeCycle] [ContainerLifeCycle.java:412] [] - NetworkTrafficServerConnector#5a238421{null,[]}{0.0.0.0:0} added {wiremock.org.eclipse.jetty.io.ArrayByteBufferPool#f73022f,POJO}
I do not want to print out DEBUG logs, just INFO level stuff. I tried to do this by changing the WireMock Configuration as follows. What I'm doing is described in the official documentation, section Notification (logging), so feel free to have a look.
.notifier(new ConsoleNotifier(false)) //attribute verbose is set to false
Also tried to solve this by adding a log4j.properties file under src/test/resources/
log4j.rootLogger=INFO, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
log4j.logger.org.apache.http.wire=INFO
Can someone help me please?
This worked in my case (Spring, Logback) - src/test/resources/logback-test.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml" />
<!-- Decrease amount of logs from Jetty started by WireMock -->
<logger name="org.eclipse.jetty" level="info"/>
<logger name="org.eclipse.jetty.server.handler.ContextHandler" level="warn"/>
</configuration>

logback.xml missing in project created with STS and Spring boot

I created a Spring boot web project within STS, used last version
I am getting error that logback.xml is missing, but I created on src/main/resources
03:37:08,276 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
03:37:08,276 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
03:37:08,277 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/D:/Sites/sts/GoogleCustomSearchBoot/target/classes/logback.xml]
03:37:08,385 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
03:37:08,388 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
03:37:08,396 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
03:37:08,445 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
03:37:08,446 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
03:37:08,447 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
03:37:08,448 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator#61a485d2 - Registering current configuration as safe fallback point
Logging system failed to initialize using configuration from 'classpath:/logback.xml'
java.io.FileNotFoundException: class path resource [/logback.xml] cannot be resolved to URL because it does not exist
at org.springframework.util.ResourceUtils.getURL(ResourceUtils.java:135)
at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:307)
at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:276)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:239)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:212)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:73)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:336)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151)
at com.example.GoogleCustomSearchBootApplication.main(GoogleCustomSearchBootApplication.java:10)
03:37:08.825 [main] DEBUG o.s.b.l.ClasspathLoggingApplicationListener - Application failed to start with classpath: [file:/D:/Sites/sts/GoogleCustomSearchBoot/target/classes/, file:/D:/java/m2/org/springframework/boot/spring-boot-starter-web/1.5.3.RELEASE/spring-boot-starter-web-1.5.3.RELEASE.jar, file:/D:/java/m2/org/springframework/boot/spring-boot-starter/1.5.3.RELEASE/spring-boot-starter-1.5.3.RELEASE.jar, file:/D:/java/m2/org/springframework/boot/spring-boot/1.5.3.RELEASE/spring-boot-1.5.3.RELEASE.jar, file:/D:/java/m2/org/springframework/boot/spring-boot-autoconfigure/1.5.3.RELEASE/spring-boot-autoconfigure-1.5.3.RELEASE.jar, file:/D:/java/m2/org/springframework/boot/spring-boot-starter-logging/1.5.3.RELEASE/spring-boot-starter-logging-1.5.3.RELEASE.jar, file:/D:/java/m2/ch/qos/logback/logback-classic/1.1.11/logback-classic-1.1.11.jar, file:/D:/java/m2/ch/qos/logback/logback-core/1.1.11/logback-core-1.1.11.jar, file:/D:/java/m2/org/slf4j/jcl-over-slf4j/1.7.25/jcl-over-slf4j-1.7.25.jar, file:/D:/java/m2/org/slf4j/jul-to-slf4j/1.7.25/jul-to-slf4j-1.7.25.jar, file:/D:/java/m2/org/slf4j/log4j-over-slf4j/1.7.25/log4j-over-slf4j-1.7.25.jar, file:/D:/java/m2/org/yaml/snakeyaml/1.17/snakeyaml-1.17.jar, file:/D:/java/m2/org/springframework/boot/spring-boot-starter-tomcat/1.5.3.RELEASE/spring-boot-starter-tomcat-1.5.3.RELEASE.jar, file:/D:/java/m2/org/apache/tomcat/embed/tomcat-embed-core/8.5.14/tomcat-embed-core-8.5.14.jar, file:/D:/java/m2/org/apache/tomcat/embed/tomcat-embed-el/8.5.14/tomcat-embed-el-8.5.14.jar, file:/D:/java/m2/org/apache/tomcat/embed/tomcat-embed-websocket/8.5.14/tomcat-embed-websocket-8.5.14.jar, file:/D:/java/m2/org/hibernate/hibernate-validator/5.3.5.Final/hibernate-validator-5.3.5.Final.jar, file:/D:/java/m2/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar, file:/D:/java/m2/org/jboss/logging/jboss-logging/3.3.1.Final/jboss-logging-3.3.1.Final.jar, file:/D:/java/m2/com/fasterxml/classmate/1.3.3/classmate-1.3.3.jar, file:/D:/java/m2/com/fasterxml/jackson/core/jackson-databind/2.8.8/jackson-databind-2.8.8.jar, file:/D:/java/m2/com/fasterxml/jackson/core/jackson-annotations/2.8.0/jackson-annotations-2.8.0.jar, file:/D:/java/m2/com/fasterxml/jackson/core/jackson-core/2.8.8/jackson-core-2.8.8.jar, file:/D:/java/m2/org/springframework/spring-web/4.3.8.RELEASE/spring-web-4.3.8.RELEASE.jar, file:/D:/java/m2/org/springframework/spring-aop/4.3.8.RELEASE/spring-aop-4.3.8.RELEASE.jar, file:/D:/java/m2/org/springframework/spring-beans/4.3.8.RELEASE/spring-beans-4.3.8.RELEASE.jar, file:/D:/java/m2/org/springframework/spring-context/4.3.8.RELEASE/spring-context-4.3.8.RELEASE.jar, file:/D:/java/m2/org/springframework/spring-webmvc/4.3.8.RELEASE/spring-webmvc-4.3.8.RELEASE.jar, file:/D:/java/m2/org/springframework/spring-expression/4.3.8.RELEASE/spring-expression-4.3.8.RELEASE.jar, file:/D:/java/m2/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar, file:/D:/java/m2/org/springframework/spring-core/4.3.8.RELEASE/spring-core-4.3.8.RELEASE.jar, file:/D:/java/m2/org/springframework/boot/spring-boot-configuration-processor/1.5.3.RELEASE/spring-boot-configuration-processor-1.5.3.RELEASE.jar, file:/D:/java/m2/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1.jar, file:/D:/java/m2/joda-time/joda-time/2.9.9/joda-time-2.9.9.jar]
03:37:08.830 [main] ERROR o.s.boot.SpringApplication - Application startup failed
java.lang.IllegalStateException: java.io.FileNotFoundException: class path resource [/logback.xml] cannot be resolved to URL because it does not exist
at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:315)
at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:276)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:239)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:212)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:73)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:336)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151)
at com.example.GoogleCustomSearchBootApplication.main(GoogleCustomSearchBootApplication.java:10)
Caused by: java.io.FileNotFoundException: class path resource [/logback.xml] cannot be resolved to URL because it does not exist
at org.springframework.util.ResourceUtils.getURL(ResourceUtils.java:135)
at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:307)
... 13 common frames omitted
I am attaching the project structure, I am including logback.xml
EDIT: I added debug="true" into my logback.xml file and logs show more things now, I just updated also. I can see logback.xml is found first, but in some point it is required again, but this time is not found.
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="debug">
<appender-ref ref="STDOUT" />
</root>
</configuration>
I run into this same problem. In my case, the pom.xml was filtering files so it didn't see the .xml logback file.
<resource>
<directory>src/main/resources/</directory>
<filtering>true</filtering>
<includes>
<include>**/*.jpg</include>
<include>**/*.properties</include>
</includes>
</resource>
You can include the .xml to includes session.
You have configured the logging.config property with the value classpath:logback.xml but there's no logback.xml file on the classpath.
You either need to provide a logback.xml configuration file or remove the configuration of logging.config and allow Boot to use its default Logback configuration.
Last version working seem to be 1.2.8.
Spring boot 1.3 and 1.4 don't work at all, in my windows machine.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.8.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
If you are using Maven to build your application you need to make sure that you tell Maven to include the resources folder in your jar.
I ran into this problem and wrote an article in our tech blog called Switching logging to logback. blog(dot)artifact-software(dot)com(slash)tech is the website.
<testResources>
<testResource>
<directory>${project.basedir}/src/test/resources</directory>
</testResource>
</testResources>
needs to be in the build section to get test resources into your test setup.
A similar section needs to be added to get it into your production jar.

Jenkins build fails with "Could NOT find resource"

I am trying to run this jar file from jenkins using this simple Windows Batch Command:
cd "c:\bitbucket-backup-client"
"C:\Program Files\Java\jdk1.8.0_91\bin\java.exe" -jar bitbucket-backup-client.jar
and keep getting this error:
Started by user anonymous
Building in workspace C:\Program Files (x86)\Jenkins\workspace\GitNightlyBackup
[GitNightlyBackup] $ cmd /c call C:\Windows\TEMP\hudson5635751839942755496.bat
C:\Program Files (x86)\Jenkins\workspace\GitNightlyBackup>cd "c:\bitbucket-backup-client"
c:\bitbucket-backup-client>"C:\Program Files\Java\jdk1.8.0_91\bin\java" -jar bitbucket-backup-client.jar
12:32:33,501 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
12:32:33,501 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
12:32:33,501 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/C:/bitbucket-backup-client/lib/bitbucket-backup-core-3.2.0.jar!/logback.xml]
12:32:33,517 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList#76b1e9b8 - URL [jar:file:/C:/bitbucket-backup-client/lib/bitbucket-backup-core-3.2.0.jar!/logback.xml] is not of type file
12:32:33,829 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
12:32:34,032 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word pcComplete with class [com.atlassian.bitbucket.internal.backup.client.logback.PercentCompleteConverter]
12:32:34,032 |-INFO in ch.qos.logback.core.joran.action.DefinePropertyAction - About to instantiate property definer of type [com.atlassian.bitbucket.internal.backup.client.logback.ConsoleFormatPropertyDefiner]
12:32:34,048 |-INFO in ch.qos.logback.core.joran.action.DefinePropertyAction - Popping property definer for property named [console.format] from the object stack
12:32:34,048 |-INFO in ch.qos.logback.core.joran.action.DefinePropertyAction - About to instantiate property definer of type [com.atlassian.bitbucket.internal.backup.client.logback.LogDirectoryPropertyDefiner]
12:32:34,126 |-INFO in ch.qos.logback.core.joran.action.DefinePropertyAction - Popping property definer for property named [log.dir] from the object stack
12:32:34,189 |-INFO in ch.qos.logback.core.joran.action.DefinePropertyAction - About to instantiate property definer of type [com.atlassian.bitbucket.internal.backup.client.logback.LogFormatPropertyDefiner]
12:32:34,204 |-INFO in ch.qos.logback.core.joran.action.DefinePropertyAction - Popping property definer for property named [log.format] from the object stack
12:32:34,204 |-INFO in ch.qos.logback.core.joran.action.DefinePropertyAction - About to instantiate property definer of type [com.atlassian.bitbucket.internal.backup.client.logback.LogTimestampPropertyDefiner]
12:32:34,204 |-INFO in ch.qos.logback.core.joran.action.DefinePropertyAction - Popping property definer for property named [log.timestamp] from the object stack
12:32:34,360 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
12:32:34,376 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [console]
12:32:34,376 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
12:32:34,485 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
12:32:34,485 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [log]
12:32:34,485 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
12:32:34,485 |-INFO in ch.qos.logback.core.FileAppender[log] - File property is set to [R:\Mobile\GitBackup\log/atlassian-sbc-2016-06-10-1232.log]
12:32:34,501 |-ERROR in ch.qos.logback.core.FileAppender[log] - Failed to create parent directories for [R:\Mobile\GitBackup\log\atlassian-sbc-2016-06-10-1232.log]
12:32:34,501 |-ERROR in ch.qos.logback.core.FileAppender[log] - openFile(R:\Mobile\GitBackup\log/atlassian-sbc-2016-06-10-1232.log,true) call failed. java.io.FileNotFoundException: R:\Mobile\GitBackup\log\atlassian-sbc-2016-06-10-1232.log (The system cannot find the path specified)
at java.io.FileNotFoundException: R:\Mobile\GitBackup\log\atlassian-sbc-2016-06-10-1232.log (The system cannot find the path specified)
at at java.io.FileOutputStream.open0(Native Method)
at at java.io.FileOutputStream.open(FileOutputStream.java:270)
at at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at at ch.qos.logback.core.recovery.ResilientFileOutputStream.<init>(ResilientFileOutputStream.java:28)
at at ch.qos.logback.core.FileAppender.openFile(FileAppender.java:149)
at at ch.qos.logback.core.FileAppender.start(FileAppender.java:108)
at at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:96)
at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:140)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:119)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:328)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:280)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:301)
at at org.slf4j.LoggerFactory$getLogger.call(Unknown Source)
at at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at at com.atlassian.bitbucket.internal.backup.client.BackupMain.<clinit>(BackupMain.groovy:22)
at at java.lang.Class.forName0(Native Method)
at at java.lang.Class.forName(Class.java:264)
at at com.atlassian.bitbucket.internal.backup.client.JavaVersionCheckingShim.invokeClientClassMain(JavaVersionCheckingShim.java:64)
at at com.atlassian.bitbucket.internal.backup.client.JavaVersionCheckingShim.run(JavaVersionCheckingShim.java:85)
at at com.atlassian.bitbucket.internal.backup.client.JavaVersionCheckingShim.access$000(JavaVersionCheckingShim.java:14)
at at com.atlassian.bitbucket.internal.backup.client.JavaVersionCheckingShim$BackupMain.main(JavaVersionCheckingShim.java:32)
12:32:34,986 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to WARN
12:32:34,986 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [console] to Logger[ROOT]
12:32:34,986 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [log] to Logger[ROOT]
12:32:34,986 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.atlassian.bitbucket] to INFO
12:32:34,986 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.atlassian.bitbucket.internal.backup.client.spring.SpringMain$ClassPathXmlWithSingletonsApplicationContext] to WARN
12:32:34,986 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [liquibase] to OFF
12:32:34,986 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.springframework] to WARN
12:32:34,986 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.springframework.beans.factory.config.PropertiesFactoryBean] to ERROR
12:32:34,986 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.springframework.web.client.RestTemplate] to ERROR
12:32:35,001 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
12:32:35,001 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator#248e319b - Registering current configuration as safe fallback point
2016-06-10 12:32:35,079 INFO Initializing
2016-06-10 12:32:36,423 WARN Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'backupHome' defined in class path resource [META-INF/spring/common-spring.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.bitbucket.internal.backup.client.layout.DefaultBackupHome]: Constructor threw exception; nested exception is java.lang.IllegalStateException: Could not create R:\Mobile\GitBackup
2016-06-10 12:32:36,439 ERROR The application could not be started. An unexpected error prevented the Spring
ApplicationContext from being created. Details of the error follow.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'backupHome' defined in class path resource [META-INF/spring/common-spring.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.bitbucket.internal.backup.client.layout.DefaultBackupHome]: Constructor threw exception; nested exception is java.lang.IllegalStateException: Could not create R:\Mobile\GitBackup
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:275) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1143) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
... 14 more frames available in the log file
c:\bitbucket-backup-client>exit 2
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE
I have added my JAVA_HOME in Config section and the batch commands work fine when I execute them in my machine.
EDIT :
Still not sure what's the problem with that approach but I got it work simply by calling start:
start "C:\path\to\file.jar"

Categories

Resources