While learning spring MVC building with spring, I tried making a Eureka client and server using a tutorial, its a simple tutorial with a client and server main classes with just annotations and adding application properties. But even after following the tutorial the application wont run the tomcat. I can still run other projects i done in spring boot with tomcat at local server.
The tutorial i followed is,
https://dzone.com/articles/microservice-spring-cloud-eureka-server-configurat
2018-08-06 18:18:33.710 INFO 17919 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at : http://localhost:8888
2018-08-06 18:18:33.810 INFO 17919 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Connect Timeout Exception on Url - http://localhost:8888. Will be trying the next url if available
2018-08-06 18:18:33.810 WARN 17919 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/tuto-server/default": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)
2018-08-06 18:18:33.811 INFO 17919 --- [ main] c.t.eurekatuto.EurekaTutoApplication : No active profile set, falling back to default profiles: default
2018-08-06 18:18:33.819 INFO 17919 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#15515c51: startup date [Mon Aug 06 18:18:33 IST 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext#34f7234e
2018-08-06 18:18:34.426 INFO 17919 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=a5669830-fb3a-3b16-b157-1f80a6f9cbf9
2018-08-06 18:18:34.439 INFO 17919 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2018-08-06 18:18:34.488 INFO 17919 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$39babf2e] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-08-06 18:18:34.681 INFO 17919 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2018-08-06 18:18:34.695 INFO 17919 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-08-06 18:18:34.695 INFO 17919 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.32
2018-08-06 18:18:34.698 INFO 17919 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib]
2018-08-06 18:18:34.759 INFO 17919 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-08-06 18:18:34.760 INFO 17919 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 941 ms
2018-08-06 18:18:34.846 WARN 17919 --- [ost-startStop-1] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2018-08-06 18:18:34.846 INFO 17919 --- [ost-startStop-1] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2018-08-06 18:18:34.851 INFO 17919 --- [ost-startStop-1] c.netflix.config.DynamicPropertyFactory : DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration#7c8e8b8f
2018-08-06 18:18:35.812 INFO 17919 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-08-06 18:18:35.812 INFO 17919 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'webMvcMetricsFilter' to: [/*]
2018-08-06 18:18:35.812 INFO 17919 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-08-06 18:18:35.812 INFO 17919 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-08-06 18:18:35.812 INFO 17919 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-08-06 18:18:35.812 INFO 17919 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpTraceFilter' to: [/*]
2018-08-06 18:18:35.812 INFO 17919 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'servletContainer' to urls: [/eureka/*]
2018-08-06 18:18:35.812 INFO 17919 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-08-06 18:18:35.847 INFO 17919 --- [ost-startStop-1] c.s.j.s.i.a.WebApplicationImpl : Initiating Jersey application, version 'Jersey: 1.19.1 03/11/2016 02:08 PM'
2018-08-06 18:18:35.879 ERROR 17919 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Exception starting filter [servletContainer]
java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present
at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:117) ~[na:na]
at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125) ~[na:na]
at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[na:na]
at java.base/sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68) ~[na:na]
at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138) ~[na:na]
at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[na:na]
at java.base/sun.reflect.generics.repository.ClassRepository.computeSuperInterfaces(ClassRepository.java:117) ~[na:na]
at java.base/sun.reflect.generics.repository.ClassRepository.getSuperInterfaces(ClassRepository.java:95) ~[na:na]
at java.base/java.lang.Class.getGenericInterfaces(Class.java:1114) ~[na:na]
at com.sun.jersey.core.reflection.ReflectionHelper.getClass(ReflectionHelper.java:629) ~[jersey-core-1.19.1.jar:1.19.1]
at com.sun.jersey.core.reflection.ReflectionHelper.getClass(ReflectionHelper.java:625) ~[jersey-core-1.19.1.jar:1.19.1]
at com.sun.jersey.core.spi.factory.ContextResolverFactory.getParameterizedType(ContextResolverFactory.java:202) ~[jersey-core-1.19.1.jar:1.19.1]
at com.sun.jersey.core.spi.factory.ContextResolverFactory.init(ContextResolverFactory.java:89) ~[jersey-core-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1332) ~[jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:180) ~[jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:799) ~[jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:795) ~[jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193) ~[jersey-core-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:795) ~[jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:790) ~[jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:509) ~[jersey-servlet-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:339) ~[jersey-servlet-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:605) ~[jersey-servlet-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:207) ~[jersey-servlet-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:394) ~[jersey-servlet-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:744) ~[jersey-servlet-1.19.1.jar:1.19.1]
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:285) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:112) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4637) [tomcat-embed-core-8.5.32.jar:8.5.32]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5282) [tomcat-embed-core-8.5.32.jar:8.5.32]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.32.jar:8.5.32]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421) [tomcat-embed-core-8.5.32.jar:8.5.32]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411) [tomcat-embed-core-8.5.32.jar:8.5.32]
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) [na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135) [na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [na:na]
at java.base/java.lang.Thread.run(Thread.java:844) [na:na]
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBContext
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499) ~[na:na]
at java.base/java.lang.Class.forName0(Native Method) ~[na:na]
at java.base/java.lang.Class.forName(Class.java:374) ~[na:na]
at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114) ~[na:na]
... 36 common frames omitted
2018-08-06 18:18:35.880 ERROR 17919 --- [ost-startStop-1] o.apache.catalina.core.StandardContext : One or more Filters failed to start. Full details will be found in the appropriate container log file
2018-08-06 18:18:35.880 ERROR 17919 --- [ost-startStop-1] o.apache.catalina.core.StandardContext : Context [] startup failed due to previous errors
2018-08-06 18:18:35.883 WARN 17919 --- [ost-startStop-1] o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [spring.cloud.inetutils] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.base#10.0.2/jdk.internal.misc.Unsafe.park(Native Method)
java.base#10.0.2/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
java.base#10.0.2/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2075)
java.base#10.0.2/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:435)
java.base#10.0.2/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1061)
java.base#10.0.2/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1121)
java.base#10.0.2/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
java.base#10.0.2/java.lang.Thread.run(Thread.java:844)
2018-08-06 18:18:35.887 ERROR 17919 --- [ main] o.apache.catalina.core.StandardService : Failed to start connector [Connector[HTTP/1.1-8080]]
org.apache.catalina.LifecycleException: Failed to start component [Connector[HTTP/1.1-8080]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) [tomcat-embed-core-8.5.32.jar:8.5.32]
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:440) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.32.jar:8.5.32]
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793) [tomcat-embed-core-8.5.32.jar:8.5.32]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.32.jar:8.5.32]
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:367) [tomcat-embed-core-8.5.32.jar:8.5.32]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:107) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:86) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:413) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:174) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:179) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:152) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544) [spring-context-5.0.8.RELEASE.jar:5.0.8.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:398) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:330) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1258) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at com.techgentsia.eurekatuto.EurekaTutoApplication.main(EurekaTutoApplication.java:12) [classes/:na]
Caused by: org.apache.catalina.LifecycleException: Protocol handler start failed
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1020) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.32.jar:8.5.32]
... 19 common frames omitted
Caused by: java.net.BindException: Address already in use
at java.base/sun.nio.ch.Net.bind0(Native Method) ~[na:na]
at java.base/sun.nio.ch.Net.bind(Net.java:433) ~[na:na]
at java.base/sun.nio.ch.Net.bind(Net.java:425) ~[na:na]
at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:225) ~[na:na]
at java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[na:na]
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:210) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1150) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:591) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1018) ~[tomcat-embed-core-8.5.32.jar:8.5.32]
... 20 common frames omitted
2018-08-06 18:18:35.888 INFO 17919 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2018-08-06 18:18:35.889 WARN 17919 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2018-08-06 18:18:35.896 INFO 17919 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-08-06 18:18:35.900 ERROR 17919 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:155) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544) ~[spring-context-5.0.8.RELEASE.jar:5.0.8.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:398) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:330) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1258) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at com.techgentsia.eurekatuto.EurekaTutoApplication.main(EurekaTutoApplication.java:12) [classes/:na]
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:126) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:86) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:413) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:174) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:179) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:152) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
... 8 common frames omitted
Caused by: java.lang.IllegalStateException: StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[] failed to start
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.rethrowDeferredStartupExceptions(TomcatWebServer.java:172) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:110) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
... 13 common frames omitted
Process finished with exit code 1
Try add his dependency to your pom/gradle:
Pom >>
<!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.4.0-b180725.0427</version>
</dependency>
Gradle >>
// https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api
compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.4.0-b180725.0427'
Ok, so what happened is, Java used bundle up that dependency in the older Java versions (<=8). But now they no longer bundle it from the latest version (JDK >=9) of Java going forward. I hope that solves your problem.
Checkout this solution & this one as well
Related
Following getting started at shinyproxy.io I installed shinyproxy at windows 11
docker: pulled the image: “docker pull openanalytics/shinyproxy-demo”
installed java v.15
downloaded shinyproxy-2.6.1.jar
Inserted hosts in deamon.json (located in .docker under users)
i started shinyproxy: java -jar shinyproxy-2.6.1.jar
I opened localhost:8080 in Chrome and got the message: Cannot connect
Logs:
PS C:\7.20 Shiiny proxy java> java -jar shinyproxy-2.6.1.jar
. ____ _ __ _ _*
/\ / ’ __ _ () __ __ _ \ \ \ *
*( ( )__ | '_ | '| | ’ / _` | \ \ \ *
\/ _)| |)| | | | | || (| | ) ) ) )*
’ || .__|| ||| |__, | / / / /*
=========||==============|/=///_/*
:: Spring Boot :: (v2.5.12)*
2022-05-24 07:17:14.262 INFO 12580 — [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2022-05-24 07:17:14.272 INFO 12580 — [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2022-05-24 07:17:14.352 INFO 12580 — [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 47 ms. Found 0 Redis repository interfaces.
2022-05-24 07:17:15.234 INFO 12580 — [ main] e.o.c.service.IdentifierService : ShinyProxy runtimeId: 13976d5c-4ad0-426e-ada0-d9e457cf10ef
2022-05-24 07:17:15.244 INFO 12580 — [ main] e.o.c.service.IdentifierService : ShinyProxy instanceID (hash of config): unknown-instance-id
2022-05-24 07:17:16.021 WARN 12580 — [ main] io.undertow.websockets.jsr : UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
2022-05-24 07:17:16.079 INFO 12580 — [ main] io.undertow.servlet : Initializing Spring embedded WebApplicationContext
2022-05-24 07:17:16.080 INFO 12580 — [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3340 ms
2022-05-24 07:17:16.277 INFO 12580 — [ main] o.s.boot.web.servlet.RegistrationBean : Filter orderedFormContentFilter was not registered (disabled)
2022-05-24 07:17:16.647 INFO 12580 — [ main] s.s.l.DefaultSpringSecurityContextSource : URL ‘ldap://ldap.forumsys.com:389/dc=example,dc=com’, root DN is ‘dc=example,dc=com’
2022-05-24 07:17:16.670 INFO 12580 — [ main] .s.s.l.u.DefaultLdapAuthoritiesPopulator : groupSearchBase is empty. Searches will be performed from the context source base
2022-05-24 07:17:16.794 INFO 12580 — [ main] o.s.s.web.DefaultSecurityFilterChain : Will not secure any request
2022-05-24 07:17:16.818 INFO 12580 — [ main] e.o.c.stat.StatCollectorFactory : Disabled. Usage statistics will not be processed.
2022-05-24 07:17:16.836 WARN 12580 — [ main] org.thymeleaf.templatemode.TemplateMode : [THYMELEAF][main] Template Mode ‘HTML5’ is deprecated. Using Template Mode ‘HTML’ instead.
2022-05-24 07:17:17.447 INFO 12580 — [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page template: index
2022-05-24 07:17:17.834 INFO 12580 — [ main] o.s.l.c.support.AbstractContextSource : Property ‘userDn’ not set - anonymous context will be used for read-write operations
2022-05-24 07:17:18.090 INFO 12580 — [ main] io.undertow : starting server: Undertow - 2.2.8.Final
2022-05-24 07:17:18.112 INFO 12580 — [ main] org.xnio : XNIO version 3.8.4.Final
2022-05-24 07:17:18.135 INFO 12580 — [ main] org.xnio.nio : XNIO NIO Implementation Version 3.8.4.Final
2022-05-24 07:17:18.282 INFO 12580 — [ main] org.jboss.threads : JBoss Threads version 3.1.0.Final
2022-05-24 07:17:18.376 INFO 12580 — [ main] o.s.b.w.e.undertow.UndertowWebServer : Undertow started on port(s) 8080 (http)
2022-05-24 07:17:18.501 INFO 12580 — [ main] io.undertow.servlet : Initializing Spring embedded WebApplicationContext
2022-05-24 07:17:18.502 INFO 12580 — [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 119 ms
2022-05-24 07:17:18.526 INFO 12580 — [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 1 endpoint(s) beneath base path ‘/actuator’
2022-05-24 07:17:18.619 INFO 12580 — [ main] io.undertow : starting server: Undertow - 2.2.8.Final
2022-05-24 07:17:18.641 INFO 12580 — [ main] o.s.b.w.e.undertow.UndertowWebServer : Undertow started on port(s) 9090 (http)
2022-05-24 07:17:18.679 INFO 12580 — [ main] e.o.c.service.AppRecoveryService : Recovery of running apps disabled
2022-05-24 07:17:18.680 INFO 12580 — [ main] e.o.c.util.StartupEventListener : Started ShinyProxy 2.6.1 (ContainerProxy 0.8.11)
2022-05-24 07:17:45.587 INFO 12580 — [ XNIO-1 task-1] io.undertow.servlet : Initializing Spring DispatcherServlet ‘dispatcherServlet’
2022-05-24 07:17:45.588 INFO 12580 — [ XNIO-1 task-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet ‘dispatcherServlet’
2022-05-24 07:17:45.591 INFO 12580 — [ XNIO-1 task-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 3 ms
2022-05-24 07:17:45.662 ERROR 12580 — [ XNIO-1 task-3] io.undertow.request : UT005023: Exception handling request to /
java.lang.NoClassDefFoundError: Could not initialize class org.xnio.channels.Channels
at io.undertow.servlet.spec.ServletOutputStreamImpl.close(ServletOutputStreamImpl.java:619) ~[undertow-servlet-2.2.8.Final.jar!/:2.2.8.Final]*
at io.undertow.servlet.spec.HttpServletResponseImpl.closeStreamAndWriter(HttpServletResponseImpl.java:497) ~[undertow-servlet-2.2.8.Final.jar!/:2.2.8.Final]*
at io.undertow.servlet.spec.HttpServletResponseImpl.responseDone(HttpServletResponseImpl.java:586) ~[undertow-servlet-2.2.8.Final.jar!/:2.2.8.Final]*
at io.undertow.servlet.spec.HttpServletResponseImpl.sendRedirect(HttpServletResponseImpl.java:211) ~[undertow-servlet-2.2.8.Final.jar!/:2.2.8.Final]*
at javax.servlet.http.HttpServletResponseWrapper.sendRedirect(HttpServletResponseWrapper.java:130) ~[jakarta.servlet-api-4.0.4.jar!/:4.0.4]*
at org.springframework.security.web.firewall.FirewalledResponse.sendRedirect(FirewalledResponse.java:48) ~[spring-security-web-5.5.5.jar!/:5.5.5]*
at javax.servlet.http.HttpServletResponseWrapper.sendRedirect(HttpServletResponseWrapper.java:130) ~[jakarta.servlet-api-4.0.4.jar!/:4.0.4]*
at org.springframework.security.web.util.OnCommittedResponseWrapper.sendRedirect(OnCommittedResponseWrapper.java:136) ~[spring-security-web-5.5.5.jar!/:5.5.5]*
at javax.servlet.http.HttpServletResponseWrapper.sendRedirect(HttpServletResponseWrapper.java:130) ~[jakarta.servlet-api-4.0.4.jar!/:4.0.4]*
at org.springframework.security.web.util.OnCommittedResponseWrapper.sendRedirect(OnCommittedResponseWrapper.java:136) ~[spring-security-web-5.5.5.jar!/:5.5.5]*
at org.springframework.se*
I SEE THE ERROR
java.lang.NoClassDefFoundError: Could not initialize class org.xnio.channels.Channels
Please help. What am I missing?
If you still have this problem try adding this:
-Djdk.io.File.enableADS=true
I bet the problem you've faced is similar to https://bugs.openjdk.org/browse/JDK-8285445
So you can either use jdk.io.File.enableADS=true or downgrade your JDK or download version where fix is applied :)
I am running JDK 11, Spring Boot 2.5.5 and Spring Cloud 2020.0,5 and Kafka 2.7.2.
When I have this consumer code with a Message Type of my business object:
#Bean
public Consumer<Message<MyObjectType>> process() {
return input -> {
logger.info("Message = {}", input.getPayload());
};
}
I get the error of "Failed to create topics" (see more detailed logs below), but if I changed my consumer code with String type:
public Consumer<String> consumer() {
return s -> {
logger.info("Message = {}", s);
};
}
I can see the JSON string of my business object. Why does SCS attempt to create topics in the former case and fail? Below is my properties and error logs. Would appreciate
Thanks
Properties:
spring.cloud.stream.kafka.binder.brokers=mykafka:52094
spring.cloud.stream.kafka.binder.configuration.security.protocol=SASL_PLAINTEXT
spring.cloud.stream.bindings.consumer-in-0.destination=my.topic
spring.cloud.stream.bindings.consumer-in-0.group=
spring.cloud.stream.bindings.consumer-in-0.content-type=application/json
Logs:
2022-01-17 13:14:11.614 ERROR 11256 --- [ main] o.s.c.s.b.k.p.KafkaTopicProvisioner : Failed to create topics
org.apache.kafka.common.errors.TopicAuthorizationException: Authorization failed.
2022-01-17 13:14:11.615 INFO 11256 --- [| adminclient-1] o.a.kafka.common.utils.AppInfoParser : App info kafka.admin.client for adminclient-1 unregistered
2022-01-17 13:14:11.622 WARN 11256 --- [.EXAMPLE.COM] o.a.k.c.security.kerberos.KerberosLogin : [Principal=myapp#DEV.EXAMPLE.COM]: TGT renewal thread has been interrupted and will exit.
2022-01-17 13:14:11.622 INFO 11256 --- [| adminclient-1] org.apache.kafka.common.metrics.Metrics : Metrics scheduler closed
2022-01-17 13:14:11.623 INFO 11256 --- [| adminclient-1] org.apache.kafka.common.metrics.Metrics : Closing reporter org.apache.kafka.common.metrics.JmxReporter
2022-01-17 13:14:11.623 INFO 11256 --- [| adminclient-1] org.apache.kafka.common.metrics.Metrics : Metrics reporters closed
2022-01-17 13:14:11.624 ERROR 11256 --- [ main] o.s.cloud.stream.binding.BindingService : Failed to create consumer binding; retrying in 30 seconds
org.springframework.cloud.stream.provisioning.ProvisioningException: Provisioning exception encountered for process-in-0; nested exception is org.apache.kafka.common.errors.TopicAuthorizationException: Authorization failed.
at org.springframework.cloud.stream.binder.kafka.provisioning.KafkaTopicProvisioner.createTopic(KafkaTopicProvisioner.java:347) ~[spring-cloud-stream-binder-kafka-core-3.1.6.jar:3.1.6]
at org.springframework.cloud.stream.binder.kafka.provisioning.KafkaTopicProvisioner.doProvisionConsumerDestination(KafkaTopicProvisioner.java:231) ~[spring-cloud-stream-binder-kafka-core-3.1.6.jar:3.1.6]
at org.springframework.cloud.stream.binder.kafka.provisioning.KafkaTopicProvisioner.provisionConsumerDestination(KafkaTopicProvisioner.java:197) ~[spring-cloud-stream-binder-kafka-core-3.1.6.jar:3.1.6]
at org.springframework.cloud.stream.binder.kafka.provisioning.KafkaTopicProvisioner.provisionConsumerDestination(KafkaTopicProvisioner.java:86) ~[spring-cloud-stream-binder-kafka-core-3.1.6.jar:3.1.6]
at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.doBindConsumer(AbstractMessageChannelBinder.java:421) ~[spring-cloud-stream-3.1.6.jar:3.1.6]
at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.doBindConsumer(AbstractMessageChannelBinder.java:92) ~[spring-cloud-stream-3.1.6.jar:3.1.6]
at org.springframework.cloud.stream.binder.AbstractBinder.bindConsumer(AbstractBinder.java:143) ~[spring-cloud-stream-3.1.6.jar:3.1.6]
at org.springframework.cloud.stream.binding.BindingService.doBindConsumer(BindingService.java:180) ~[spring-cloud-stream-3.1.6.jar:3.1.6]
at org.springframework.cloud.stream.binding.BindingService.bindConsumer(BindingService.java:137) ~[spring-cloud-stream-3.1.6.jar:3.1.6]
at org.springframework.cloud.stream.binding.AbstractBindableProxyFactory.createAndBindInputs(AbstractBindableProxyFactory.java:118) ~[spring-cloud-stream-3.1.6.jar:3.1.6]
at org.springframework.cloud.stream.binding.InputBindingLifecycle.doStartWithBindable(InputBindingLifecycle.java:58) ~[spring-cloud-stream-3.1.6.jar:3.1.6]
at java.base/java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:608) ~[na:na]
at org.springframework.cloud.stream.binding.AbstractBindingLifecycle.start(AbstractBindingLifecycle.java:57) ~[spring-cloud-stream-3.1.6.jar:3.1.6]
at org.springframework.cloud.stream.binding.InputBindingLifecycle.start(InputBindingLifecycle.java:34) ~[spring-cloud-stream-3.1.6.jar:3.1.6]
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:178) ~[spring-context-5.3.14.jar:5.3.14]
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54) ~[spring-context-5.3.14.jar:5.3.14]
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356) ~[spring-context-5.3.14.jar:5.3.14]
at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[na:na]
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155) ~[spring-context-5.3.14.jar:5.3.14]
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123) ~[spring-context-5.3.14.jar:5.3.14]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:935) ~[spring-context-5.3.14.jar:5.3.14]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) ~[spring-context-5.3.14.jar:5.3.14]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.8.jar:2.5.8]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:765) ~[spring-boot-2.5.8.jar:2.5.8]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:445) ~[spring-boot-2.5.8.jar:2.5.8]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) ~[spring-boot-2.5.8.jar:2.5.8]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-2.5.8.jar:2.5.8]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-2.5.8.jar:2.5.8]
at com.example.EventsConsumerApplication.main(EventsConsumerApplication.java:10) ~[classes/:na]
Caused by: org.apache.kafka.common.errors.TopicAuthorizationException: Authorization failed.
This issue is due to carelessness on my part. The method signature should be:
public Consumer<Message<MyObjectType>> consumer()
I have a CordaService implemented that connects to the external apache kafka MQ(inside init block) using kafka-client library. Kafka client producer requires access to the org.apache.kafka.common.serialization.StringSerializer object which is defined in the kafka-client library.
I have included kafka-client library in build.gradle of the cordapp module where the service is defined as below:
compile "org.apache.kafka:kafka-clients:2.0.1"
Upon corda node startup i get the below message:
[WARN ] 2019-08-30T07:04:40,551Z [main] internal.Node.installCordaService - com.example.flow.ProducerService is using legacy CordaService constructor with ServiceHub parameter. Upgrade to an AppServiceHub parameter to enable updated API features.
[ERROR] 2019-08-30T07:04:40,716Z [main] internal.Node.installCordaServices - Unable to install Corda service com.example.flow.ProducerService [errorCode=1aep02i, moreInformationAt=https://errors.corda.net/OS/4.0/1aep02i]
java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_181]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_181]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_181]
at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_181]
at net.corda.node.internal.AbstractNode.installCordaService(AbstractNode.kt:654) ~[corda-node-4.0.jar:?]
at net.corda.node.internal.AbstractNode.installCordaServices(AbstractNode.kt:577) ~[corda-node-4.0.jar:?]
at net.corda.node.internal.AbstractNode.access$installCordaServices(AbstractNode.kt:120) ~[corda-node-4.0.jar:?]
at net.corda.node.internal.AbstractNode$start$7.invoke(AbstractNode.kt:382) ~[corda-node-4.0.jar:?]
at net.corda.node.internal.AbstractNode$start$7.invoke(AbstractNode.kt:120) ~[corda-node-4.0.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.inTopLevelTransaction(CordaPersistence.kt:236) ~[corda-node-api-4.0.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:221) ~[corda-node-api-4.0.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:199) ~[corda-node-api-4.0.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:205) ~[corda-node-api-4.0.jar:?]
at net.corda.node.internal.AbstractNode.start(AbstractNode.kt:371) ~[corda-node-4.0.jar:?]
at net.corda.node.internal.Node.start(Node.kt:419) ~[corda-node-4.0.jar:?]
at net.corda.node.internal.NodeStartup.startNode(NodeStartup.kt:185) ~[corda-node-4.0.jar:?]
at net.corda.node.internal.NodeStartupCli$runProgram$2.run(NodeStartup.kt:110) ~[corda-node-4.0.jar:?]
at net.corda.node.internal.NodeStartup$initialiseAndRun$5.invoke(NodeStartup.kt:162) ~[corda-node-4.0.jar:?]
at net.corda.node.internal.NodeStartup$initialiseAndRun$5.invoke(NodeStartup.kt:117) ~[corda-node-4.0.jar:?]
at net.corda.node.internal.NodeStartupLogging$DefaultImpls.attempt(NodeStartup.kt:450) ~[corda-node-4.0.jar:?]
at net.corda.node.internal.NodeStartup.attempt(NodeStartup.kt:117) ~[corda-node-4.0.jar:?]
at net.corda.node.internal.NodeStartup.initialiseAndRun(NodeStartup.kt:160) ~[corda-node-4.0.jar:?]
at net.corda.node.internal.NodeStartupCli.runProgram(NodeStartup.kt:108) ~[corda-node-4.0.jar:?]
at net.corda.cliutils.CordaCliWrapper.call(CordaCliWrapper.kt:184) ~[corda-tools-cliutils-4.0.jar:?]
at net.corda.cliutils.CordaCliWrapper.call(CordaCliWrapper.kt:152) ~[corda-tools-cliutils-4.0.jar:?]
at picocli.CommandLine.execute(CommandLine.java:1056) ~[picocli-3.8.0.jar:3.8.0]
at picocli.CommandLine.access$900(CommandLine.java:142) ~[picocli-3.8.0.jar:3.8.0]
at picocli.CommandLine$RunLast.handle(CommandLine.java:1246) ~[picocli-3.8.0.jar:3.8.0]
at picocli.CommandLine$RunLast.handle(CommandLine.java:1214) ~[picocli-3.8.0.jar:3.8.0]
at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:1122) ~[picocli-3.8.0.jar:3.8.0]
at picocli.CommandLine.parseWithHandlers(CommandLine.java:1405) ~[picocli-3.8.0.jar:3.8.0]
at net.corda.cliutils.CordaCliWrapperKt.start(CordaCliWrapper.kt:72) ~[corda-tools-cliutils-4.0.jar:?]
at net.corda.node.Corda.main(Corda.kt:13) ~[corda-node-4.0.jar:?]
Caused by: org.apache.kafka.common.config.ConfigException: Invalid value org.apache.kafka.common.serialization.StringSerializer for configuration key.serializer: Class org.apache.kafka.common.serialization.StringSerializer could not be found.
at org.apache.kafka.common.config.ConfigDef.parseType(ConfigDef.java:724) ~[?:?]
at org.apache.kafka.common.config.ConfigDef.parseValue(ConfigDef.java:469) ~[?:?]
at org.apache.kafka.common.config.ConfigDef.parse(ConfigDef.java:462) ~[?:?]
at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:62) ~[?:?]
at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:75) ~[?:?]
at org.apache.kafka.clients.producer.ProducerConfig.<init>(ProducerConfig.java:364) ~[?:?]
at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:304) ~[?:?]
at com.example.flow.Producer.<init>(Service.kt:26) ~[?:?]
at com.example.flow.Ping.<init>(Service.kt:49) ~[?:?]
at com.example.flow.ProducerService.<init>(Service.kt:21) ~[?:?]
... 33 more
[INFO ] 2019-08-30T07:04:41,863Z [main] statemachine.SingleThreadedStateMachineManager.invoke - Node ready, info: NodeInfo(addresses=[localhost:10004], legalIdentitiesAndCerts=[O=PartyA, L=London, C=GB], platformVersion=4, serial=1567146729127)
[INFO ] 2019-08-30T07:04:42,001Z [Node thread-1] internal.Node.registerJmxReporter - Registering JMX reporter:
[INFO ] 2019-08-30T07:04:42,003Z [main] BasicInfo.printBasicNodeInfo - Loaded 2 CorDapp(s) : Contract CorDapp: CorDapp Example version 1 by vendor Corda Open Source with licence Apache License, Version 2.0, Workflow CorDapp: CorDapp Example version 1 by vendor Corda Open Source with licence Apache License, Version 2.0
[INFO ] 2019-08-30T07:04:42,004Z [Node thread-1] internal.Node.registerJolokiaReporter - Registering Jolokia JMX reporter:
[INFO ] 2019-08-30T07:04:42,009Z [main] BasicInfo.printBasicNodeInfo - Node for "PartyA" started up and registered in 51.24 sec
[INFO ] 2019-08-30T07:04:42,012Z [main] rpc.RPCServer.start - Starting RPC server with configuration RPCServerConfiguration(rpcThreadPoolSize=4, reapInterval=PT1S, deduplicationCacheExpiry=PT24H)
What could be the reason why corda node is unable to load the org.apache.kafka.common.serialization.StringSerializer class?
Resolved. Had to add `Thread.currentThread().setContextClassLoader(null); since StringSerializer class is by default loaded by application class loader
My artifactory instance has been running for months but it has completely stopped working since the last update (to 5.11).
When I try to start it up I see the following errors in the logs...
/\
/ \ ___ ___ ___ ___ ___
/ /\ \ / __/ __/ _ \/ __/ __|
/ ____ \ (_| (_| __/\__ \__ \
/_/ \_\___\___\___||___/___/
Access Version: 3.3.2
Access Revision: 30302900
2018-05-15 08:57:43.904 INFO 32571 --- [ost-startStop-1] o.j.a.s.startup.AccessHomeFinderImpl : Using JFrog Access home at '/var/opt/jfrog/artifactory/access' resolved from: System property (Artifactory)
2018-05-15 08:57:44.132 ERROR 32571 --- [ost-startStop-1] o.s.boot.SpringApplication : Application startup failed
java.lang.IllegalArgumentException: Unknown value:
at org.jfrog.access.util.EnumUtils.lambda$fromValue$0(EnumUtils.java:30) ~[access-common-api-3.3.2.jar:na]
at java.util.Optional.orElseThrow(Optional.java:290) ~[na:1.8.0_161]
at org.jfrog.access.util.EnumUtils.fromValue(EnumUtils.java:70) ~[access-common-api-3.3.2.jar:na]
at org.jfrog.access.util.EnumUtils.fromValue(EnumUtils.java:30) ~[access-common-api-3.3.2.jar:na]
at org.jfrog.access.server.home.migration.EnvironmentVersion.fromVersionString(EnvironmentVersion.java:62) ~[access-server-core-3.3.2.jar:na]
at org.jfrog.access.server.home.migration.EnvironmentConfig.readEnvVersionFile(EnvironmentConfig.java:72) ~[access-server-core-3.3.2.jar:na]
at org.jfrog.access.server.home.migration.EnvironmentConfig.getConfigVersion(EnvironmentConfig.java:46) ~[access-server-core-3.3.2.jar:na]
at org.jfrog.access.migration.ConfigMigrationRunner.migrateIfNeeded(ConfigMigrationRunner.java:37) ~[access-common-core-3.3.2.jar:na]
at org.jfrog.access.server.startup.AccessServerStartupFacadeImpl.migrateEnvironment(AccessServerStartupFacadeImpl.java:48) ~[access-server-core-3.3.2.jar:na]
at org.jfrog.access.server.startup.AccessServerStartupFacadeImpl.prepareEnvironment(AccessServerStartupFacadeImpl.java:30) ~[access-server-core-3.3.2.jar:na]
at org.jfrog.access.context.AccessApplicationContextInitializer.prepareEnvironment(AccessApplicationContextInitializer.java:48) ~[access-application-3.3.2.jar:3.3.2]
at org.jfrog.access.context.AccessApplicationContextInitializer.prepareEnvironment(AccessApplicationContextInitializer.java:26) ~[access-application-3.3.2.jar:3.3.2]
at org.jfrog.app.context.JFrogApplicationContextInitializer.initialize(JFrogApplicationContextInitializer.java:69) ~[jfrog-application-1.5.2.jar:na]
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:567) ~[spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:338) ~[spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:301) ~[spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.web.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:151) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.web.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:131) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.web.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:86) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169) [spring-web-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5196) [catalina.jar:8.5.23]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:8.5.23]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752) [catalina.jar:8.5.23]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728) [catalina.jar:8.5.23]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) [catalina.jar:8.5.23]
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630) [catalina.jar:8.5.23]
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1842) [catalina.jar:8.5.23]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_161]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_161]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_161]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_161]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_161]
May 15, 2018 8:57:44 AM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/access]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1842)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: Unknown value:
at org.jfrog.access.util.EnumUtils.lambda$fromValue$0(EnumUtils.java:30)
at java.util.Optional.orElseThrow(Optional.java:290)
at org.jfrog.access.util.EnumUtils.fromValue(EnumUtils.java:70)
at org.jfrog.access.util.EnumUtils.fromValue(EnumUtils.java:30)
at org.jfrog.access.server.home.migration.EnvironmentVersion.fromVersionString(EnvironmentVersion.java:62)
at org.jfrog.access.server.home.migration.EnvironmentConfig.readEnvVersionFile(EnvironmentConfig.java:72)
at org.jfrog.access.server.home.migration.EnvironmentConfig.getConfigVersion(EnvironmentConfig.java:46)
at org.jfrog.access.migration.ConfigMigrationRunner.migrateIfNeeded(ConfigMigrationRunner.java:37)
at org.jfrog.access.server.startup.AccessServerStartupFacadeImpl.migrateEnvironment(AccessServerStartupFacadeImpl.java:48)
at org.jfrog.access.server.startup.AccessServerStartupFacadeImpl.prepareEnvironment(AccessServerStartupFacadeImpl.java:30)
at org.jfrog.access.context.AccessApplicationContextInitializer.prepareEnvironment(AccessApplicationContextInitializer.java:48)
at org.jfrog.access.context.AccessApplicationContextInitializer.prepareEnvironment(AccessApplicationContextInitializer.java:26)
at org.jfrog.app.context.JFrogApplicationContextInitializer.initialize(JFrogApplicationContextInitializer.java:69)
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:567)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:338)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:301)
at org.springframework.boot.web.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:151)
at org.springframework.boot.web.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:131)
at org.springframework.boot.web.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:86)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5196)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
May 15, 2018 8:57:44 AM org.apache.catalina.startup.HostConfig deployDescriptor
SEVERE: Error deploying configuration descriptor [/opt/jfrog/artifactory/tomcat/conf/Catalina/localhost/access.xml]
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/access]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:756)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1842)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
May 15, 2018 8:57:44 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deployment of configuration descriptor [/opt/jfrog/artifactory/tomcat/conf/Catalina/localhost/access.xml] has finished in [6,262] ms
2018-05-15 08:57:44 [ARTIFACTORY] [INFO ] Starting Artifactory [artifactory.home=/var/opt/jfrog/artifactory].
2018-05-15 08:57:44,833 [art-init] [INFO ] (o.a.w.s.ArtifactoryContextConfigListener:265) -
This then causes Artifactory to fail because it cant find the access server
2018-05-15 08:58:03,475 [art-init] [INFO ] (o.a.s.a.ArtifactoryAccessClientConfigStore:556) - Using Access Server URL: http://localhost:8040/access (bundled) source: detected
2018-05-15 08:58:03,959 [art-init] [INFO ] (o.a.s.a.AccessServiceImpl:290) - Waiting for access server...
2018-05-15 08:58:04,678 [art-init] [WARN ] (o.j.a.c.AccessClientHttpException:39) - Unrecognized ErrorsModel by Access. Original message: Failed on executing /api/v1/system/ping, with response: Not Found
2018-05-15 08:58:06,697 [art-init] [WARN ] (o.j.a.c.AccessClientHttpException:39) - Unrecognized ErrorsModel by Access. Original message: Failed on executing /api/v1/system/ping, with response: Not Found
...
2018-05-15 08:59:35,043 [art-init] [ERROR] (o.a.w.s.ArtifactoryContextConfigListener:92) - Application could not be initialized: Waiting for access server to respond timed-out
java.lang.reflect.InvocationTargetException: null
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.artifactory.webapp.servlet.ArtifactoryContextConfigListener.configure(ArtifactoryContextConfigListener.java:207)
at org.artifactory.webapp.servlet.ArtifactoryContextConfigListener.access$200(ArtifactoryContextConfigListener.java:63)
at org.artifactory.webapp.servlet.ArtifactoryContextConfigListener$1.run(ArtifactoryContextConfigListener.java:88)
Caused by: org.springframework.beans.factory.BeanInitializationException: Failed to initialize bean 'org.artifactory.security.access.AccessService'.; nested exception is java.lang.IllegalStateException: Waiting for access server to respond timed-out
at org.artifactory.spring.ArtifactoryApplicationContext.refresh(ArtifactoryApplicationContext.java:250)
at org.artifactory.spring.ArtifactoryApplicationContext.<init>(ArtifactoryApplicationContext.java:133)
... 7 common frames omitted
Caused by: java.lang.IllegalStateException: Waiting for access server to respond timed-out
at org.artifactory.security.access.AccessServiceImpl.waitForAccessServer(AccessServiceImpl.java:305)
at org.artifactory.security.access.AccessServiceImpl.initAccessService(AccessServiceImpl.java:265)
at org.artifactory.security.access.AccessServiceImpl.initIfNeeded(AccessServiceImpl.java:250)
at org.artifactory.security.access.AccessServiceImpl.init(AccessServiceImpl.java:244)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.artifactory.storage.fs.lock.aop.LockingAdvice.invoke(LockingAdvice.java:76)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy41.init(Unknown Source)
at org.artifactory.spring.ArtifactoryApplicationContext.refresh(ArtifactoryApplicationContext.java:248)
... 8 common frames omitted
2018-05-15 09:01:16,534 [http-nio-8081-exec-1] [ERROR] (o.a.w.s.ArtifactoryFilter:213) - Artifactory failed to initialize: Context is null
I have not been able to find anything about the Access error and none of the posts similar to the Artifactory error (like this https://www.jfrog.com/jira/browse/RTFACT-14477) have helped.
Any assistance would be greatly appreciated.
What version of Artifactory have you upgraded from? Is this a Zip installation?
Have you changed/removed any content in the $ARTIFACTORY_HOME/access/ folder? Specifically the $ARTIFACTORY_HOME/access/data/access.env.version.
Can you confirm this file is there the same it was prior to the upgrade?
Looks like it was touched by someone.
Can you change the content of the file to "4" (1byte, with no space or a blank line afterwards), then restart and see if there is any change.
To resolve this issue, please delete the db.lck + dbex.lck files from the $ARTIFACTORY_HOME/data/derby/ folder.
I have been trying to send email via spring boot and i cant seem to succeed. I am been using javamail api for a long time now but want to use springboot with spring mail.
public class SendMail {
#Autowired
private JavaMailSender javaMailSender;
public void sendingMail(String to, String subject, String body) {
SimpleMailMessage message = new SimpleMailMessage();
message.setTo(to);
message.setSubject(subject);
message.setText(body);
javaMailSender.send(message);
}
}
and here is my mailer
#Controller
public class ExamPle {
#Autowired
private SendMail sendMail;
#RequestMapping("/he")
public String homePage() {
sendMail.sendingMail("bobobush007#gmail.com", "Welcome George", "Sample Message here");
return "Sent";
}
}
I already have sprint-boot-starter-mail in my pom file but i keep getting this error message. I have even watched youtube videos of tutorials on how to do this and yet it doesn't work. I am using Spring Tool Suite Version: 3.9.0.RELEASE.
Properties file
spring.mail.host=smtp.gmail.com
spring.mail.username=my-email-address
spring.mail.password=my-password
spring.mail.port=587
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.defaultEncoding=UTF-8
2017-09-14 05:25:57.811 INFO 12576 --- [ main]
com.example.demo.EmaildemoApplication : Starting
EmaildemoApplication on Georges-MacBook-Pro.local with PID 12576
(started by georgetebo in /Users/georgetebo/STS Projects/Emaildemo)
2017-09-14 05:25:57.814 INFO 12576 --- [ main]
com.example.demo.EmaildemoApplication : No active profile set,
falling back to default profiles: default 2017-09-14 05:25:57.845
INFO 12576 --- [ main]
ationConfigEmbeddedWebApplicationContext : Refreshing
org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#3d3fcdb0:
startup date [Thu Sep 14 05:25:57 WAT 2017]; root of context hierarchy
2017-09-14 05:25:58.652 INFO 12576 --- [ main]
s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with
port(s): 8080 (http) 2017-09-14 05:25:58.662 INFO 12576 --- [
main] o.apache.catalina.core.StandardService : Starting service
[Tomcat] 2017-09-14 05:25:58.662 INFO 12576 --- [ main]
org.apache.catalina.core.StandardEngine : Starting Servlet Engine:
Apache Tomcat/8.5.20 2017-09-14 05:25:58.714 INFO 12576 ---
[ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] :
Initializing Spring embedded WebApplicationContext 2017-09-14
05:25:58.714 INFO 12576 --- [ost-startStop-1]
o.s.web.context.ContextLoader : Root WebApplicationContext:
initialization completed in 871 ms 2017-09-14 05:25:58.821 INFO 12576
--- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/] 2017-09-14 05:25:58.823
INFO 12576 --- [ost-startStop-1]
o.s.b.w.servlet.FilterRegistrationBean : Mapping filter:
'characterEncodingFilter' to: [/] 2017-09-14 05:25:58.824 INFO 12576
--- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/] 2017-09-14
05:25:58.824 INFO 12576 --- [ost-startStop-1]
o.s.b.w.servlet.FilterRegistrationBean : Mapping filter:
'httpPutFormContentFilter' to: [/] 2017-09-14 05:25:58.824 INFO
12576 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean :
Mapping filter: 'requestContextFilter' to: [/] 2017-09-14
05:25:58.848 WARN 12576 --- [ main]
ationConfigEmbeddedWebApplicationContext : Exception encountered
during context initialization - cancelling refresh attempt:
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'examPle': Unsatisfied dependency
expressed through field 'sendMail'; nested exception is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No
qualifying bean of type 'com.example.demo.SendMail' available:
expected at least 1 bean which qualifies as autowire candidate.
Dependency annotations:
{#org.springframework.beans.factory.annotation.Autowired(required=true)}
2017-09-14 05:25:58.850 INFO 12576 --- [ main]
o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2017-09-14 05:25:58.861 INFO 12576 --- [ main]
utoConfigurationReportLoggingInitializer :
Error starting ApplicationContext. To display the auto-configuration
report re-run your application with 'debug' enabled. 2017-09-14
05:25:58.927 ERROR 12576 --- [ main]
o.s.b.d.LoggingFailureAnalysisReporter :
*************************** APPLICATION FAILED TO START
Description:
Field sendMail in com.example.demo.ExamPle required a bean of type
'com.example.demo.SendMail' that could not be found.
Action:
Consider defining a bean of type 'com.example.demo.SendMail' in your
configuration.
This is my Pom file
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
<groupId>com.mailsender</groupId>
<artifactId>MailSender</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>MailSender</name>
<description>ZemoPoint for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
I have uninstalled my jdk as well as STS and installed new copies.Now i get this error
This works.
#Service
public class SendMail {
#Autowired
private JavaMailSender javaMailSender;
public void sendingMail(String to, String subject, String body) {
MimeMessage message=javaMailSender.createMimeMessage();
MimeMessageHelper helper;
helper=new MimeMessageHelper(message,true);
helper.setTo(to);
helper.setSubject(subject);
helper.setText(body);
javaMailSender.send(message);
}}
Have you tried adding javax.mail to your pom ? Spring email sender has a dependency to JavaMail.
I think the password you should use is the Generated app password for gmail, it shouldn't be just any password i guess.
Seems your properties is not fetched properly, for example:
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
You should try to use other way like this:
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
mailSender.setHost(emailProperties.getHost());
mailSender.setPort(Integer.parseInt(emailProperties.getPort()));
mailSender.setUsername(emailProperties.getUsername());
mailSender.setPassword(emailProperties.getPassword());
Properties javaMailProperties = new Properties();
javaMailProperties.put("mail.smtp.starttls.enable", "true");
javaMailProperties.put("mail.smtp.auth", "true");
javaMailProperties.put("mail.transport.protocol", "smtp");
javaMailProperties.put("mail.debug", "true");
mailSender.setJavaMailProperties(javaMailProperties);
See more this way from the post Spring Boot Freemarker Email Template
Hope this help!