I am trying to use the Google Api for Calendar (https://developers.google.com/calendar/quickstart/java) but, when I include the dependencies in my spring boot project I get an error.
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Tomcat]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.28.jar:8.5.28]
... 15 common frames omitted
It looks like it is related to the fact that google api uses Jetty.
These are my build.gradle dependencies:
dependencies {
compile "com.google.api-client:google-api-client:1.23.0"
compile 'com.google.oauth-client:google-oauth-client-jetty:1.23.0'
compile 'com.google.apis:google-api-services-calendar:v3-rev305-1.23.0'
compile 'javax.persistence:javax.persistence-api:2.2'
compile 'javax.inject:javax.inject:1'
compile 'javax.validation:validation-api:2.0.1.Final'
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-data-jpa'
compile 'com.h2database:h2'
compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
gradleLint.ignore('unused-dependency') {
compileOnly 'org.projectlombok:lombok:1.16.20'
}
}
Related
I have a spring boot 2.3 app which I want to compile as a native image.
I'm using GraalVM 20.1.0.r11-grl as the SDK/JDK and my application compiles and runs fine.
I'm using Gradle for my build tool, and am using https://github.com/ayltai/spring-graalvm-native-plugin to access Native Image functionality - it works well.
When I try to compile a native image, I get the following stack trace (the original is about 900 lines long in verbose mode so I'm trying to pick out the relevant bits):
WARNING: Could not register reflection metadata for org.springframework.boot.actuate.autoconfigure.endpoint.web.reactive.WebFluxEndpointManagementContextConfiguration. Reason: java.lang.NoClassDefFoundError: org/springframework/web/reactive/result/method/annotation/RequestMappingHandlerMapping.
WARNING: Could not register reflection metadata for org.springframework.boot.actuate.autoconfigure.web.jersey.JerseySameManagementContextConfiguration. Reason: java.lang.NoClassDefFoundError: org/glassfish/jersey/server/ResourceConfig.
[valuable-api:14937] analysis: 53,754.65 ms, 3.98 GB
Fatal error:com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing org.springframework.hateoas.config.WebFluxHateoasConfiguration$WebFluxCodecs.getDecoder(com.fasterxml.jackson.databind.ObjectMapper, java.util.List)
Parsing context:
parsing com.oracle.svm.reflect.WebFluxHateoasConfiguration$WebFluxCodecs_getDecoder_ebe8383216b03b797b6e4dde145c81aea1634443_11905.invoke(Unknown Source)
parsing java.lang.reflect.Method.invoke(Method.java:566)
parsing org.springframework.core.convert.support.ObjectToObjectConverter.convert(ObjectToObjectConverter.java:102)
parsing org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:41)
parsing org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:191)
parsing org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:174)
parsing org.springframework.core.env.AbstractPropertyResolver.convertValueIfNecessary(AbstractPropertyResolver.java:265)
parsing org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:91)
parsing org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:62)
parsing org.springframework.core.env.AbstractPropertyResolver.getProperty(AbstractPropertyResolver.java:169)
parsing org.springframework.core.env.AbstractEnvironment.getProperty(AbstractEnvironment.java:540)
parsing org.springframework.boot.SpringApplicationBannerPrinter.createStringFromBanner(SpringApplicationBannerPrinter.java:116)
parsing org.springframework.boot.SpringApplicationBannerPrinter.print(SpringApplicationBannerPrinter.java:61)
parsing org.springframework.boot.SpringApplication.printBanner(SpringApplication.java:556)
parsing org.springframework.boot.SpringApplication.run(SpringApplication.java:310)
parsing org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
parsing org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
parsing nz.ringfence.valuable.api.ValuableApiApplication.main(ValuableApiApplication.java:11)
parsing com.oracle.svm.core.JavaMainWrapper.runCore(JavaMainWrapper.java:149)
parsing com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:184)
parsing com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(generated:0)
at com.oracle.graal.pointsto.util.AnalysisError.parsingError(AnalysisError.java:138)
at com.oracle.graal.pointsto.flow.MethodTypeFlow.doParse(MethodTypeFlow.java:336)
at com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureParsed(MethodTypeFlow.java:311)
at com.oracle.graal.pointsto.flow.MethodTypeFlow.addContext(MethodTypeFlow.java:112)
at com.oracle.graal.pointsto.flow.StaticInvokeTypeFlow.update(InvokeTypeFlow.java:437)
at com.oracle.graal.pointsto.BigBang$2.run(BigBang.java:530)
at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:173)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Caused by: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: java.lang.NoClassDefFoundError: org/reactivestreams/Publisher
at parsing org.springframework.hateoas.config.WebFluxHateoasConfiguration$WebFluxCodecs.getDecoder(WebFluxHateoasConfiguration.java:123)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.throwParserError(BytecodeParser.java:2590)
at com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.throwParserError(SharedGraphBuilderPhase.java:94)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3428)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3230)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1088)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:982)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:84)
at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:214)
at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:225)
at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:352)
at com.oracle.graal.pointsto.flow.MethodTypeFlow.doParse(MethodTypeFlow.java:322)
... 11 more
Caused by: java.lang.NoClassDefFoundError: org/reactivestreams/Publisher
at jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVM.getDeclaredMethods(Native Method)
at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotResolvedObjectTypeImpl.getDeclaredMethods(HotSpotResolvedObjectTypeImpl.java:958)
at com.oracle.svm.hosted.classinitialization.ClassInitializationFeature.declaresDefaultMethods(ClassInitializationFeature.java:385)
at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.processInterfaces(ConfigurableClassInitialization.java:606)
at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.computeInitKindAndMaybeInitializeClass(ConfigurableClassInitialization.java:565)
at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.computeInitKindAndMaybeInitializeClass(ConfigurableClassInitialization.java:132)
at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.maybeInitializeHosted(ConfigurableClassInitialization.java:160)
at com.oracle.svm.hosted.SVMHost.registerType(SVMHost.java:223)
at com.oracle.graal.pointsto.meta.AnalysisUniverse.createType(AnalysisUniverse.java:264)
at com.oracle.graal.pointsto.meta.AnalysisUniverse.lookupAllowUnresolved(AnalysisUniverse.java:205)
at com.oracle.graal.pointsto.meta.AnalysisUniverse.lookup(AnalysisUniverse.java:182)
at com.oracle.graal.pointsto.meta.AnalysisType.convertTypes(AnalysisType.java:209)
at com.oracle.graal.pointsto.meta.AnalysisType.<init>(AnalysisType.java:169)
at com.oracle.graal.pointsto.meta.AnalysisUniverse.createType(AnalysisUniverse.java:263)
at com.oracle.graal.pointsto.meta.AnalysisUniverse.lookupAllowUnresolved(AnalysisUniverse.java:205)
at com.oracle.graal.pointsto.meta.AnalysisUniverse.lookup(AnalysisUniverse.java:182)
at com.oracle.graal.pointsto.meta.AnalysisType.<init>(AnalysisType.java:168)
at com.oracle.graal.pointsto.meta.AnalysisUniverse.createType(AnalysisUniverse.java:263)
at com.oracle.graal.pointsto.meta.AnalysisUniverse.lookupAllowUnresolved(AnalysisUniverse.java:205)
at com.oracle.graal.pointsto.infrastructure.WrappedConstantPool.lookupType(WrappedConstantPool.java:155)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.lookupType(BytecodeParser.java:4274)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genNewInstance(BytecodeParser.java:4545)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5343)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3423)
... 22 more
Caused by: java.lang.ClassNotFoundException: org.reactivestreams.Publisher
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 46 more
Error: Image build request failed with exit status 1
com.oracle.svm.driver.NativeImage$NativeImageError: Image build request failed with exit status 1
at com.oracle.svm.driver.NativeImage.showError(NativeImage.java:1541)
at com.oracle.svm.driver.NativeImage.build(NativeImage.java:1299)
at com.oracle.svm.driver.NativeImage.performBuild(NativeImage.java:1260)
at com.oracle.svm.driver.NativeImage.main(NativeImage.java:1219)
at com.oracle.svm.driver.NativeImage$JDK9Plus.main(NativeImage.java:1722)
So this error appears to be happening because Native Image thinks I have a WebFlux component on my classpath, and when it tried to process that component, it can't find it, hence the ClassNotFoundException at the bottom of the trace.
Here are my dependencies:
// Spring Boot
implementation('org.springframework.boot:spring-boot-starter-actuator')
implementation('org.springframework.boot:spring-boot-starter-data-jpa')
implementation('org.springframework.hateoas:spring-hateoas:1.1.1.RELEASE')
implementation('org.springframework.boot:spring-boot-starter-web')
implementation('org.springframework.boot:spring-boot-starter-security')
implementation('org.springframework.boot:spring-boot-starter-aop')
implementation('org.springframework.boot:spring-boot-starter-validation')
runtimeOnly('org.springframework.boot:spring-boot-devtools')
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
// Native Image
implementation('org.springframework:spring-context-indexer')
implementation('org.springframework.experimental:spring-graalvm-native:0.7.1')
// Testing
testImplementation('org.junit.jupiter:junit-jupiter-api:5.3.1')
testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.3.1')
testImplementation('org.springframework.boot:spring-boot-starter-test')
testImplementation("org.assertj:assertj-core:3.12.0")
testImplementation 'org.mockito:mockito-core:2.+'
testImplementation "org.springframework.security:spring-security-test"
testImplementation 'com.intuit.karate:karate-junit5:0.9.5'
testImplementation 'com.intuit.karate:karate-apache:0.9.5'
testImplementation "net.masterthought:cucumber-reporting:3.8.0"
// Persistence
implementation('com.h2database:h2')
implementation('org.postgresql:postgresql')
implementation('org.springframework.boot:spring-boot-starter-jdbc')
implementation "org.flywaydb:flyway-core"
// Swagger
implementation 'org.springdoc:springdoc-openapi-ui:1.3.0'
// Observability
implementation 'io.sentry:sentry-spring:1.7.30'
implementation 'io.honeycomb.beeline:beeline-spring-boot-starter:1.2.0'
implementation 'nl.basjes.parse.useragent:yauaa:5.18'
// Security
implementation 'com.auth0:auth0-spring-security-api:1.3.1'
implementation 'org.springframework.security:spring-security-oauth2-resource-server'
implementation 'org.springframework.security:spring-security-oauth2-jose'
implementation 'org.springframework.security:spring-security-config'
// Outgoing Email
implementation 'com.sendgrid:sendgrid-java:4.0.1'
There are no reactive components there. The only thing I can think of is that there is a transitive dependency somewhere, but it doesn't make sense that a non-reactive component would have a transitive dependency?
Has anyone had this issue before? How can I debug and fix this?
In a simple REST service built with Quarkus, a ClassNotFoundException is thrown if the service is run in development mode. With the uber-jar, it works correctly.
How can I get the service working in development mode too?
The missing class belongs to a transitive dependency of a QR bill generator library, which is declared build.gradle:
dependencies {
...
implementation 'net.codecrete.qrbill:qrbill-generator:2.2.2'
...
}
The error occurs in development mode (gradle quarkusDev) only. It is triggered if a REST request would need to use the qrbill:qrbill-generator library:
2020-05-03 12:11:49,463 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-1) HTTP Request to /xxx/yyy failed, error id: 89c5b7f8-c762-4f7f-959b-67f16b2bc120-1: org.jboss.resteasy.spi.UnhandledException: java.lang.NoClassDefFoundError: io/nayuki/qrcodegen/QrCode$Ecc
at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:106)
at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:372)
at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:216)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:515)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:259)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:160)
[several lines omitted]
Caused by: java.lang.NoClassDefFoundError: io/nayuki/qrcodegen/QrCode$Ecc
at net.codecrete.qrbill.generator.QRCode.draw(QRCode.java:49)
at net.codecrete.qrbill.generator.BillLayout.drawPaymentPart(BillLayout.java:131)
at net.codecrete.qrbill.generator.BillLayout.draw(BillLayout.java:94)
[several lines omitted]
Caused by: java.lang.ClassNotFoundException: io.nayuki.qrcodegen.QrCode$Ecc
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:341)
at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:294)
... 44 more
When analyzing the dependencies, I can see that io.nayuki:qrcodegen:1.6.0 is part of the runtimeClasspath but not part of the compileClasspath. This looks ok.
Could it be that Quarkus dev mode uses the wrong classpath?
I"m using Java 8 and Spring Boot. Trying to build a simple REST application that sits on a MongoDB. I have this in my Gradle build file
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb:2.1.5.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-web:2.1.5.RELEASE'
implementation 'org.springframework.boot:spring-boot-dependencies:2.1.5.RELEASE'
}
but when I go to start my app I get an error about not being able to find a class, "org/springframework/data/mapping/context/MappingContext":
localhost:todoapp-backend davea$ java -jar ./build/libs/spring-data-mongodb-example-1.0.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/data/mapping/context/MappingContext
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethod(Class.java:2128)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:47)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.lang.ClassNotFoundException: org.springframework.data.mapping.context.MappingContext
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:94)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
What other dependency I'm I supposed to include to get the missing class found?
You should use Springboot Gradle plugin. It will solve all your dependecies issues .
plugins {
id 'java
id 'org.springframework.boot' version '2.1.5.RELEASE'
}
apply plugin: 'io.spring.dependency-management'
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
implementation 'org.springframework.boot:spring-boot-starter-web'
}
The project spring boot 1..5.7 release. I am using Intellij IDEA 2017.2.4 and gradle for dependency management. When i build the project it builds successfully with no error. When I run the application with bootRun gradle task it shows the following error.
Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.boot.SpringApplicationRunListener : org.springframework.boot.context.event.EventPublishingRunListener
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:413)
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:392)
at org.springframework.boot.SpringApplication.getRunListeners(SpringApplication.java:378)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:291)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
at com.kifiya.lmanagement.LmanagementApplication.main(LmanagementApplication.java:13)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.context.event.EventPublishingRunListener]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.aop.framework.AopProxyUtils.getSingletonTarget(Ljava/lang/Object;)Ljava/lang/Object;
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:154)
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:409)
... 6 more
Caused by: java.lang.NoSuchMethodError: org.springframework.aop.framework.AopProxyUtils.getSingletonTarget(Ljava/lang/Object;)Ljava/lang/Object;
at org.springframework.context.event.AbstractApplicationEventMulticaster.addApplicationListener(AbstractApplicationEventMulticaster.java:105)
at org.springframework.boot.context.event.EventPublishingRunListener.(EventPublishingRunListener.java:56)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142)
... 7 more
It seems like a dependency problem within Spring, as it's mentioned above. The easiest way IMHO is to check your POM file.
Check out here for more info: https://docs.gradle.org/current/userguide/introduction_dependency_management.html
It looks like spring-aop doesn't match the rest of your libraries. Try running gradle dependencies and check that all Spring dependencies are in the same version. More on inspecting dependencies in Gradle User Manual.
Old question, but I had the same error after converting a Spring application to Spring Boot. Using the spring-boot-starter-aop instead of a direct dependency on a specific version of spring-aop resolved it for me, e.g. in build.gradle:
plugins {
id 'org.springframework.boot' version '1.5.17.RELEASE'
}
apply plugin: 'io.spring.dependency-management'
dependencies {
compile 'org.springframework.boot:spring-boot-starter-aop'
}
instead of
dependencies {
compile 'org.springframework:spring-aop:4.2.4.RELEASE'
}
I have a standalone java application which uses jcifs library for doing SMB operations. The standalone application uses spring boot. This application works fine and is able to meet the requirements.
I have to convert this standalone application to a restful service. I thus used spring boot starter with embedded tomcat. The converted application compiles fine but when I start the application, the embedded tomcat doesn't start and gives below error.
I have narrowed the problem to inclusion of jcifs library. when I remove it the embedded tomcat starts fine and when I include it then get the below error.
The jcifs dependency is as follows:
compile group: 'jcifs', name: 'jcifs', version: '1.3.17'
Please let me know what could be the problem or any any pointers. I am running against a very tight timeline and thus any help/pointers will be very much appreciated.
The error is:
2017-10-09 22:50:50.189 INFO 1780 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.5
2017-10-09 22:50:50.470 ERROR 1780 --- [cat-startStop-1] org.apache.catalina.core.ContainerBase : A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
at java.util.concurrent.FutureTask.report(FutureTask.java:122) [na:1.8.0_144]
at java.util.concurrent.FutureTask.get(FutureTask.java:192) [na:1.8.0_144]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:911) ~[tomcat-embed-core-8.5.5.jar:8.5.5]
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:890) [tomcat-embed-core-8.5.5.jar:8.5.5]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.5.jar:8.5.5]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1403) [tomcat-embed-core-8.5.5.jar:8.5.5]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393) [tomcat-embed-core-8.5.5.jar:8.5.5]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_144]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_144]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_144]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_144]
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) [tomcat-embed-core-8.5.5.jar:8.5.5]
... 6 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to start component [Pipeline[StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) [tomcat-embed-core-8.5.5.jar:8.5.5]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5099) ~[tomcat-embed-core-8.5.5.jar:8.5.5]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.5.jar:8.5.5]
... 6 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.authenticator.NonLoginAuthenticator[]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) [tomcat-embed-core-8.5.5.jar:8.5.5]
at org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:170) ~[tomcat-embed-core-8.5.5.jar:8.5.5]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.5.jar:8.5.5]
... 8 common frames omitted
Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String;
at org.apache.catalina.authenticator.AuthenticatorBase.startInternal(AuthenticatorBase.java:1122) ~[tomcat-embed-core-8.5.5.jar:8.5.5]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.5.jar:8.5.5]
... 10 common frames omitted
Below is the gradle file. I am using gradle 2.10.0 version.
buildscript {
repositories {
mavenCentral()
maven { url "http://repo1.maven.org/maven2" }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.1.RELEASE")
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.2.1"
}
}
// Apply the java plugin to add support for Java
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'
apply plugin: "org.sonarqube"
apply plugin: 'jacoco'
jar {
baseName = 'connectorservice'
version = '0.1.0'
manifest {
attributes 'Main-Class': 'com.uu.ff.connectorservice.main.Application'
}
}
repositories {
mavenCentral()
maven { url "http://repo1.maven.org/maven2" }
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
// In this section you declare the dependencies for your production and test code
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-aop')
compile('org.springframework:spring-aspects')
compile("org.springframework.boot:spring-boot-starter-data-mongodb")
compile group: 'commons-io', name: 'commons-io', version: '2.5'
compile group: 'org.apache.commons', name: 'commons-vfs2', version: '2.1'
compile group: 'de.odysseus.staxon', name: 'staxon', version: '1.3'
testCompile("junit:junit")
testCompile group: 'org.powermock', name: 'powermock-module-junit4', version: '1.6.4'
testCompile group: 'org.powermock', name: 'powermock-api-mockito', version: '1.6.4'
compile('org.springframework.boot:spring-boot-starter-test')
compile group: 'commons-dbcp', name: 'commons-dbcp', version: '1.4'
compile group: 'jcifs', name: 'jcifs', version: '1.3.17'
}
You just have do exclude the "servlet-api" dependency from jcifs library, it is conflicting with tomcat default servlet api.
In maven it would be something like:
<dependency>
<groupId>org.codelibs</groupId>
<artifactId>jcifs</artifactId>
<version>1.3.18.2</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
The exclusion serves well also when using spring-integration-smb library.