I've already deployed for a first test my project that validate users through firebase as an external resource server.
In local environment it's working and looks like to be ok for a test on remote environment, usually I use Heroku.
When i first hit the server (with any kind of request), it display these logs :
io.netty.channel.unix.Errors$NativeIoException: epoll_wait(..) failed: Function not implemented
2023-01-06 07:58:02.050 WARN 4 --- [or-http-epoll-5] io.netty.channel.epoll.EpollEventLoop : Unexpected exception in the selector loop.
io.netty.channel.unix.Errors$NativeIoException: epoll_wait(..) failed: Function not implemented
2023-01-06 07:58:03.053 WARN 4 --- [or-http-epoll-5] io.netty.channel.epoll.EpollEventLoop : Unexpected exception in the selector loop.
io.netty.channel.unix.Errors$NativeIoException: epoll_wait(..) failed: Function not implemented
2023-01-06 07:58:04.053 WARN 4 --- [or-http-epoll-5] io.netty.channel.epoll.EpollEventLoop : Unexpected exception in the selector loop.
io.netty.channel.unix.Errors$NativeIoException: epoll_wait(..) failed: Function not implemented
2023-01-06 07:58:05.054 WARN 4 --- [or-http-epoll-5] io.netty.channel.epoll.EpollEventLoop : Unexpected exception in the selector loop.
io.netty.channel.unix.Errors$NativeIoException: epoll_wait(..) failed: Function not implemented
2023-01-06 07:58:06.054 WARN 4 --- [or-http-epoll-5] io.netty.channel.epoll.EpollEventLoop : Unexpected exception in the selector loop.
io.netty.channel.unix.Errors$NativeIoException: epoll_wait(..) failed: Function not implemented
ter at=error code=H12 desc="Request timeout" method=POST path="/user" host=dlv-izac-user.herokuapp.com request_id=1355dcfb-ffa5-4202-ab02-171c8f799711 fwd="87.0.149.6" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=https
2023-01-06 07:58:07.055 WARN 4 --- [or-http-epoll-5] io.netty.channel.epoll.EpollEventLoop : Unexpected exception in the selector loop.
io.netty.channel.unix.Errors$NativeIoException: epoll_wait(..) failed: Function not implemented
2023-01-06 07:58:08.056 WARN 4 --- [or-http-epoll-5] io.netty.channel.epoll.EpollEventLoop : Unexpected exception in the selector loop.
io.netty.channel.unix.Errors$NativeIoException: epoll_wait(..) failed: Function not implemented
2023-01-06 07:58:09.056 WARN 4 --- [or-http-epoll-5] io.netty.channel.epoll.EpollEventLoop : Unexpected exception in the selector loop.
io.netty.channel.unix.Errors$NativeIoException: epoll_wait(..) failed: Function not implemented
2023-01-06 07:58:10.056 WARN 4 --- [or-http-epoll-5] io.netty.channel.epoll.EpollEventLoop : Unexpected exception in the selector loop.
io.netty.channel.unix.Errors$NativeIoException: epoll_wait(..) failed: Function not implemented
2023-01-06 07:58:11.057 WARN 4 --- [or-http-epoll-5] io.netty.channel.epoll.EpollEventLoop : Unexpected exception in the selector loop.
io.netty.channel.unix.Errors$NativeIoException: epoll_wait(..) failed: Function not implemented
2023-01-06 07:58:12.079 WARN 4 --- [or-http-epoll-5] r.netty.http.client.HttpClientConnect : [884b052a, L:/172.16.225.34:54424 ! R:www.googleapis.com/74.125.193.95:443] The connection observed an error
java.nio.channels.ClosedChannelException: null
at io.netty.handler.ssl.SslHandler.channelInactive(SslHandler.java:1064) ~[netty-handler-4.1.76.Final.jar!/:4.1.76.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262) ~[netty-transport-4.1.76.Final.jar!/:4.1.76.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248) ~[netty-transport-4.1.76.Final.jar!/:4.1.76.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:241) ~[netty-transport-4.1.76.Final.jar!/:4.1.76.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1405) ~[netty-transport-4.1.76.Final.jar!/:4.1.76.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262) ~[netty-transport-4.1.76.Final.jar!/:4.1.76.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248) ~[netty-transport-4.1.76.Final.jar!/:4.1.76.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:901) ~[netty-transport-4.1.76.Final.jar!/:4.1.76.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe$7.run(AbstractChannel.java:813) ~[netty-transport-4.1.76.Final.jar!/:4.1.76.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) ~[netty-common-4.1.76.Final.jar!/:4.1.76.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469) ~[netty-common-4.1.76.Final.jar!/:4.1.76.Final]
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:391) ~[netty-transport-classes-epoll-4.1.76.Final.jar!/:4.1.76.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) ~[netty-common-4.1.76.Final.jar!/:4.1.76.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.76.Final.jar!/:4.1.76.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.76.Final.jar!/:4.1.76.Final]
at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]
2023-01-06 07:58:12.089 WARN 4 --- [or-http-epoll-5] io.netty.channel.epoll.EpollEventLoop : Unexpected exception in the selector loop.
io.netty.channel.unix.Errors$NativeIoException: epoll_wait(..) failed: Function not implemented
this is my yaml:
spring:
data:
mongodb:
auto-index-creation: false
uri: mongodb+srv://izac-user?retryWrites=true
security:
oauth2:
resourceserver:
jwt:
jwk-set-uri: https://www.googleapis.com/service_accounts/v1/jwk/securetoken%40system.gserviceaccount.com
rabbitmq:
port: 5671
host: ${RABBITMQ_HOST}
username: ${RABBITMQ_USERNAME}
password: ${RABBITMQ_PASSWORD}
ssl:
enabled: true
listener:
simple:
retry:
enabled: true
initial-interval: 3s
max-attempts: 2
max-interval: 5s
multiplier: 1
external-services:
izac: https://izac-dlv.herokuapp.com
qrcode: https://dlv-qrcode-generator.herokuapp.com
firebase:
credentials : XXX.json
projectId: XX-YYY.json
and this is my pom:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.google.firebase</groupId>
<artifactId>firebase-admin</artifactId>
<version>9.1.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb-reactive</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.6.13</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
<version>3.0.0</version>
</dependency>
I rewrite my comment :
After some tests the exception looks like to be caused by this part of the yaml:
https://www.googleapis.com/service_accounts/v1/jwk/securetoken%40system.gserviceaccount.com
because of the log [884b052a, L:/172.16.225.34:54424 ! R:www.googleapis.com/74.125.193.95:443] The connection observed an error
java.nio.channels.ClosedChannelException: null
But i cannot understand why.
security:
oauth2:
resourceserver:
jwt:
jwk-set-uri: https://www.googleapis.com/service_accounts/v1/jwk/securetoken%40system.gserviceaccount.com
Still not solved the error.
Related
I am getting an error when i am trying to integrate spring data with elastic search
2020-09-09 16:14:42 - Adding transport node : 127.0.0.1:9300
2020-09-09 16:14:47 - fatal error on the network layer
at org.elasticsearch.transport.netty4.Netty4Utils.maybeDie(Netty4Utils.java:184)
at org.elasticsearch.transport.netty4.Netty4Transport.initiateChannel(Netty4Transport.java:247)
at org.elasticsearch.transport.netty4.Netty4Transport.initiateChannel(Netty4Transport.java:82)
at org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:604)
at org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:122)
and more error like this
Exception in thread "Thread-7" java.lang.NoSuchMethodError: io.netty.util.ResourceLeakDetector.addExclusions(Ljava/lang/Class;[Ljava/lang/String;)V
at io.netty.buffer.AbstractByteBufAllocator.<clinit>(AbstractByteBufAllocator.java:34)
at io.netty.buffer.ByteBufUtil.<clinit>(ByteBufUtil.java:79)
at io.netty.buffer.ByteBufAllocator.<clinit>(ByteBufAllocator.java:24)
at io.netty.channel.DefaultChannelConfig.<init>(DefaultChannelConfig.java:56)
at io.netty.channel.DefaultChannelConfig.<init>(DefaultChannelConfig.java:69)
at io.netty.channel.socket.DefaultSocketChannelConfig.<init>(DefaultSocketChannelConfig.java:46)
at io.netty.channel.socket.nio.NioSocketChannel$NioSocketChannelConfig.<init>(NioSocketChannel.java:457)
at io.netty.channel.socket.nio.NioSocketChannel$NioSocketChannelConfig.<init>(NioSocketChannel.java:455)
at io.netty.channel.socket.nio.NioSocketChannel.<init>(NioSocketChannel.java:101)
at io.netty.channel.socket.nio.NioSocketChannel.<init>(NioSocketChannel.java:90)
at io.netty.channel.socket.nio.NioSocketChannel.<init>(NioSocketChannel.java:83)
at io.netty.channel.socket.nio.NioSocketChannel.<init>(NioSocketChannel.java:76)
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 io.netty.channel.ReflectiveChannelFactory.newChannel(ReflectiveChannelFactory.java:38)
at io.netty.bootstrap.AbstractBootstrap.initAndRegister(AbstractBootstrap.java:320)
at io.netty.bootstrap.Bootstrap.doResolveAndConnect(Bootstrap.java:163)
at io.netty.bootstrap.Bootstrap.connect(Bootstrap.java:145)
my pom dependency is something like this
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
<version>2.1.15.RELEASE</version>
</dependency>
and property files like this
spring.data.elasticsearch.cluster-name=my-application
spring.data.elasticsearch.cluster-nodes=localhost:9300
spring.data.elasticsearch.repositories.enabled=true
api.elasticsearch.uri = http://localhost:9200/
api.elasticsearch.search = /_search
I am trying to work on the event driven architecture using Spring Cloud Stream and Apache Kafka as a stream binder.
Spring Boot version : 2.1.9 RELEASE
Spring Cloud Version : 2.2.1 RELEASE
I tried the same configuration with Greenwich.SR3 cloud version but same error.
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.9.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.adi</groupId>
<artifactId>ProducerKafka</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>ProducerKafka</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<spring-cloud-stream.version>2.2.1.RELEASE</spring-cloud-stream.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream</artifactId>
<version>${spring-cloud-stream.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-binder-kafka-streams</artifactId>
<version>${spring-cloud-stream.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- <dependency> -->
<!-- <groupId>org.springframework.cloud</groupId> -->
<!-- <artifactId>spring-cloud-stream-test-support</artifactId> -->
<!-- <scope>test</scope> -->
<!-- </dependency> -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
MainApplication.java
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Source;
#SpringBootApplication
#EnableBinding(Source.class)
public class ProducerKafkaApplication {
public static void main(String[] args) {
SpringApplication.run(ProducerKafkaApplication.class, args);
}
}
While running the application as Spring Boot app, getting below error at console.
2019-11-07 08:37:58.780 INFO 513 --- [ main] com.adi.ProducerKafkaApplication : No active profile set, falling back to default profiles: default
2019-11-07 08:38:01.121 INFO 513 --- [ main] o.s.c.a.ConfigurationClassEnhancer : #Bean method BinderFactoryConfiguration.implicitFunctionBinder is non-static and returns an object assignable to Spring's BeanFactoryPostProcessor interface. This will result in a failure to process annotations such as #Autowired, #Resource and #PostConstruct within the method's declaring #Configuration class. Add the 'static' modifier to this method to avoid these container lifecycle issues; see #Bean javadoc for complete details.
2019-11-07 08:38:01.193 INFO 513 --- [ main] faultConfiguringBeanFactoryPostProcessor : No bean named 'errorChannel' has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created.
2019-11-07 08:38:01.216 INFO 513 --- [ main] faultConfiguringBeanFactoryPostProcessor : No bean named 'taskScheduler' has been explicitly defined. Therefore, a default ThreadPoolTaskScheduler will be created.
2019-11-07 08:38:01.224 INFO 513 --- [ main] faultConfiguringBeanFactoryPostProcessor : No bean named 'integrationHeaderChannelRegistry' has been explicitly defined. Therefore, a default DefaultHeaderChannelRegistry will be created.
2019-11-07 08:38:01.270 INFO 513 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.kafka.annotation.KafkaBootstrapConfiguration' of type [org.springframework.kafka.annotation.KafkaBootstrapConfiguration$$EnhancerBySpringCGLIB$$a9058eff] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-07 08:38:01.318 INFO 513 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'integrationDisposableAutoCreatedBeans' of type [org.springframework.integration.config.annotation.Disposables] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-07 08:38:01.338 INFO 513 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.integration.config.IntegrationManagementConfiguration' of type [org.springframework.integration.config.IntegrationManagementConfiguration$$EnhancerBySpringCGLIB$$404538ab] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-07 08:38:01.352 INFO 513 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJmxConfiguration' of type [org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJmxConfiguration$$EnhancerBySpringCGLIB$$1bd743cb] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-07 08:38:01.365 INFO 513 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration' of type [org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration$$EnhancerBySpringCGLIB$$54beec98] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-07 08:38:01.370 INFO 513 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'mbeanServer' of type [com.sun.jmx.mbeanserver.JmxMBeanServer] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-07 08:38:01.970 INFO 513 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2019-11-07 08:38:02.020 INFO 513 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-11-07 08:38:02.021 INFO 513 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.26]
2019-11-07 08:38:02.264 INFO 513 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-11-07 08:38:02.265 INFO 513 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3328 ms
2019-11-07 08:38:03.122 INFO 513 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2019-11-07 08:38:03.808 INFO 513 --- [ main] o.s.s.c.ThreadPoolTaskScheduler : Initializing ExecutorService 'taskScheduler'
2019-11-07 08:38:03.815 WARN 513 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bindingService' defined in class path resource [org/springframework/cloud/stream/config/BindingServiceConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.stream.binding.BindingService]: Factory method 'bindingService' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/validation/Validator
2019-11-07 08:38:03.815 INFO 513 --- [ main] o.s.s.c.ThreadPoolTaskScheduler : Shutting down ExecutorService 'taskScheduler'
2019-11-07 08:38:03.818 INFO 513 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
2019-11-07 08:38:03.821 INFO 513 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2019-11-07 08:38:03.835 INFO 513 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-11-07 08:38:03.902 ERROR 513 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bindingService' defined in class path resource [org/springframework/cloud/stream/config/BindingServiceConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.stream.binding.BindingService]: Factory method 'bindingService' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/validation/Validator
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:607) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:847) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
at com.adi.ProducerKafkaApplication.main(ProducerKafkaApplication.java:15) [classes/:na]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.stream.binding.BindingService]: Factory method 'bindingService' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/validation/Validator
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
... 19 common frames omitted
Caused by: java.lang.NoClassDefFoundError: javax/validation/Validator
at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_161]
at java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[na:1.8.0_161]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.8.0_161]
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) ~[na:1.8.0_161]
at java.net.URLClassLoader.access$100(URLClassLoader.java:73) ~[na:1.8.0_161]
at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ~[na:1.8.0_161]
at java.net.URLClassLoader$1.run(URLClassLoader.java:362) ~[na:1.8.0_161]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_161]
at java.net.URLClassLoader.findClass(URLClassLoader.java:361) ~[na:1.8.0_161]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_161]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[na:1.8.0_161]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_161]
at org.springframework.cloud.stream.binding.BindingService.<init>(BindingService.java:86) ~[spring-cloud-stream-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.cloud.stream.config.BindingServiceConfiguration.bindingService(BindingServiceConfiguration.java:204) ~[spring-cloud-stream-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.cloud.stream.config.BindingServiceConfiguration$$EnhancerBySpringCGLIB$$fb550fc9.CGLIB$bindingService$1(<generated>) ~[spring-cloud-stream-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.cloud.stream.config.BindingServiceConfiguration$$EnhancerBySpringCGLIB$$fb550fc9$$FastClassBySpringCGLIB$$56848299.invoke(<generated>) ~[spring-cloud-stream-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363) ~[spring-context-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.cloud.stream.config.BindingServiceConfiguration$$EnhancerBySpringCGLIB$$fb550fc9.bindingService(<generated>) ~[spring-cloud-stream-2.2.1.RELEASE.jar:2.2.1.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
... 20 common frames omitted
Caused by: java.lang.ClassNotFoundException: javax.validation.Validator
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_161]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_161]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[na:1.8.0_161]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_161]
... 44 common frames omitted
Thanks,
Aditya
It looks like you have not added a dependency for the Validator class. Add below in your pom.xml file.
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.0.Final</version>
</dependency>
EDIT
To add all validation related dependencies add below:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<version>${spring-cloud-stream.version}</version>
</dependency>
Upgrade to the latest dependency for spring-cloud-starter-stream-rabbit.
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
I'm currently trying to implement spring boot app that as tlsv1.2 supported . Able to launch the spring boot app with eclipse ide , but if i generate snapshot and try executing it , it wont launch
Spring boot snapshot version : 2.1.10.BUILD-SNAPSHOT
command ran : java -jar <somesample-snapshot>
But ports are not busy or all the keystore & truststore required are present
this is the config of application.yml
server:
port: 8449
ssl:
key-store: classpath:keystore.jks
key-store-password: allpassword
trust-store: classpath:truststore.jks
trust-store-password: allpassword
client-auth: need
enabled: true
protocol: TLS
enabled-protocols: TLSv1.2
org.apache.catalina.LifecycleException: Protocol handler start failed
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1008)
~[tomcat-embed-core-9.0.26.jar!/:9.0.26]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
~[tomcat-embed-core-9.0.26.jar!/:9.0.26]
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:227)
[tomcat-embed-core-9.0.26.jar!/:9.0.26]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:263)
[spring-boot-2.1.10.BUILD-SNAPSHOT.jar!/:2.1.10.BUILD-SNAPSHOT]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:195)
[spring-boot-2.1.10.BUILD-SNAPSHOT.jar!/:2.1.10.BUILD-SNAPSHOT]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:297)
[spring-boot-2.1.10.BUILD-SNAPSHOT.jar!/:2.1.10.BUILD-SNAPSHOT]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:163)
[spring-boot-2.1.10.BUILD-SNAPSHOT.jar!/:2.1.10.BUILD-SNAPSHOT]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)
[spring-context-5.1.10.RELEASE.jar!/:5.1.10.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
[spring-boot-2.1.10.BUILD-SNAPSHOT.jar!/:2.1.10.BUILD-SNAPSHOT]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744)
[spring-boot-2.1.10.BUILD-SNAPSHOT.jar!/:2.1.10.BUILD-SNAPSHOT]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391)
[spring-boot-2.1.10.BUILD-SNAPSHOT.jar!/:2.1.10.BUILD-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
[spring-boot-2.1.10.BUILD-SNAPSHOT.jar!/:2.1.10.BUILD-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
[spring-boot-2.1.10.BUILD-SNAPSHOT.jar!/:2.1.10.BUILD-SNAPSHOT]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204)
[spring-boot-2.1.10.BUILD-SNAPSHOT.jar!/:2.1.10.BUILD-SNAPSHOT]
at com.ibm.RoAlliesApplication.main(RoAlliesApplication.java:10)
[classes!/:1.0-SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_221]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
~[na:1.8.0_221]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.8.0_221]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_221]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
[ro-allies-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
[ro-allies-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:51)
[ro-allies-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
[ro-allies-1.0-SNAPSHOT.jar:1.0-SNAPSHOT] Caused by:
java.lang.IllegalArgumentException: Stream closed
at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:99)
~[tomcat-embed-core-9.0.26.jar!/:9.0.26]
at org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:71)
~[tomcat-embed-core-9.0.26.jar!/:9.0.26]
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:218)
~[tomcat-embed-core-9.0.26.jar!/:9.0.26]
at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1124)
~[tomcat-embed-core-9.0.26.jar!/:9.0.26]
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1210)
~[tomcat-embed-core-9.0.26.jar!/:9.0.26]
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:585)
~[tomcat-embed-core-9.0.26.jar!/:9.0.26]
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1005)
~[tomcat-embed-core-9.0.26.jar!/:9.0.26]
... 22 common frames omitted Caused by: java.io.IOException: Stream closed
at java.util.zip.InflaterInputStream.ensureOpen(InflaterInputStream.java:67)
~[na:1.8.0_221]
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:142)
~[na:1.8.0_221]
at org.springframework.boot.loader.jar.ZipInflaterInputStream.read(ZipInflaterInputStream.java:52)
~[ro-allies-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
~[na:1.8.0_221]
at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
~[na:1.8.0_221]
at java.security.DigestInputStream.read(DigestInputStream.java:124)
~[na:1.8.0_221]
at java.io.DataInputStream.readInt(DataInputStream.java:387) ~[na:1.8.0_221]
at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:658)
~[na:1.8.0_221]
at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:56)
~[na:1.8.0_221]
at sun.security.provider.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:224)
~[na:1.8.0_221]
at sun.security.provider.JavaKeyStore$DualFormatJKS.engineLoad(JavaKeyStore.java:70)
~[na:1.8.0_221]
at java.security.KeyStore.load(KeyStore.java:1445) ~[na:1.8.0_221]
at org.apache.tomcat.util.security.KeyStoreUtil.load(KeyStoreUtil.java:69)
~[tomcat-embed-core-9.0.26.jar!/:9.0.26]
at org.apache.tomcat.util.net.SSLUtilBase.getStore(SSLUtilBase.java:217)
~[tomcat-embed-core-9.0.26.jar!/:9.0.26]
at org.apache.tomcat.util.net.SSLHostConfigCertificate.getCertificateKeystore(SSLHostConfigCertificate.java:206)
~[tomcat-embed-core-9.0.26.jar!/:9.0.26]
at org.apache.tomcat.util.net.SSLUtilBase.getKeyManagers(SSLUtilBase.java:283)
~[tomcat-embed-core-9.0.26.jar!/:9.0.26]
at org.apache.tomcat.util.net.SSLUtilBase.createSSLContext(SSLUtilBase.java:247)
~[tomcat-embed-core-9.0.26.jar!/:9.0.26]
at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:97)
~[tomcat-embed-core-9.0.26.jar!/:9.0.26]
... 28 common frames omitted
2019-10-07 23:28:42.800 INFO 3716 --- [ main]
o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2019-10-07 23:28:42.824 INFO 3716 --- [ main]
ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report
re-run your application with 'debug' enabled. 2019-10-07 23:28:42.828
ERROR 3716 --- [ main]
o.s.b.d.LoggingFailureAnalysisReporter :
*************************** APPLICATION FAILED TO START
Description:
The Tomcat connector configured to listen on port 8449 failed to
start. The port may already be in use or the connector may be
misconfigured.
Action:
Verify the connector's configuration, identify and stop any process
that's listening on port 8449, or configure this application to listen
on another port.
2019-10-07 23:28:42.836 INFO 3716 --- [ main]
o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down
ExecutorService 'applicationTaskExecutor'
I have added below tomcat 9.0.30 dependencies and it worked for me.
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-annotations-api</artifactId>
<version>9.0.30</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
<version>9.0.30</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jsp-api</artifactId>
<version>9.0.30</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>9.0.30</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-el</artifactId>
<version>9.0.30</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<version>9.0.30</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-websocket</artifactId>
<version>9.0.30</version>
</dependency>
looks like ZipInflaterInputStream as issues in unziping and stack trace is not clear , but the workaround to make it run over command line
jar xf and then execute
java org.springframework.boot.loader.JarLauncher
I have a fresh Spring Boot application setup. I'm trying to connect to MySql using Liquibase with the configuration below.
# Development DataSource #
spring:
datasource:
url: jdbc:mysql://localhost:3306/cstmngtdatabase?
autoReconnect=true&useSSL=false
username: root
password: xxxx
driver-class-name: com.mysql.jdbc.Driver
# Liquibase Configuration #
liquibase:
enabled: true
change-log: classpath:db/liquibase-changelog.xml
pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.realcomplex</groupId>
<artifactId>cstmngt</artifactId>
<version>0.0.1-SNAPSHOT</version>
<modules>
<module>domain</module>
<module>persistence</module>
<module>business-logic</module>
<module>web-ui</module>
<module>web-service</module>
</modules>
<packaging>pom</packaging>
<name>cstmngt-project</name>
<description>Real Complex's Construction Management Project.</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.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-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
But I got this error.
Error log
2018-02-15 17:39:44.407 INFO 27220 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: OrRequestMatcher [requestMatchers=[Ant [pattern='/css/**'], Ant [pattern='/js/**'], Ant [pattern='/images/**'], Ant [pattern='/webjars/**'], Ant [pattern='/**/favicon.ico'], Ant [pattern='/error']]], []
2018-02-15 17:39:44.488 INFO 27220 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: OrRequestMatcher [requestMatchers=[Ant [pattern='/**']]], [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#58f31629, org.springframework.security.web.context.SecurityContextPersistenceFilter#64502326, org.springframework.security.web.header.HeaderWriterFilter#42e4e589, org.springframework.security.web.authentication.logout.LogoutFilter#39da5e49, org.springframework.security.web.authentication.www.BasicAuthenticationFilter#2180e789, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#4a058df8, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#4ef4f627, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#124d26ba, org.springframework.security.web.session.SessionManagementFilter#63fd4dda, org.springframework.security.web.access.ExceptionTranslationFilter#794f11cd, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#19b07407]
Thu Feb 15 17:39:45 ICT 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2018-02-15 17:39:45.193 ERROR 27220 --- [ main] o.a.tomcat.jdbc.pool.ConnectionPool : Unable to create initial connections of pool.
java.sql.SQLException: Access denied for user 'root'#'localhost' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965) ~[mysql-connector-java-5.1.45.jar:5.1.45]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973) ~[mysql-connector-java-5.1.45.jar:5.1.45]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909) ~[mysql-connector-java-5.1.45.jar:5.1.45]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:873) ~[mysql-connector-java-5.1.45.jar:5.1.45]
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1710) ~[mysql-connector-java-5.1.45.jar:5.1.45]
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226) ~[mysql-connector-java-5.1.45.jar:5.1.45]
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2188) ~[mysql-connector-java-5.1.45.jar:5.1.45]
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2219) ~[mysql-connector-java-5.1.45.jar:5.1.45]
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2014) ~[mysql-connector-java-5.1.45.jar:5.1.45]
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:776) ~[mysql-connector-java-5.1.45.jar:5.1.45]
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) ~[mysql-connector-java-5.1.45.jar:5.1.45]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_121]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_121]
at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:154) [tomcat-jdbc-8.5.27.jar:na]
at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:118) [tomcat-jdbc-8.5.27.jar:na]
at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:107) [tomcat-jdbc-8.5.27.jar:na]
at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:131) [tomcat-jdbc-8.5.27.jar:na]
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:385) [liquibase-core-3.5.3.jar:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) [spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) [spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]
at com.realcomplex.WebServiceSpringBootApplication.main(WebServiceSpringBootApplication.java:20) [classes/:na]
2018-02-15 17:39:45.195 WARN 27220 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.DatabaseException: java.sql.SQLException: Access denied for user 'root'#'localhost' (using password: YES)
2018-02-15 17:39:45.196 INFO 27220 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
2018-02-15 17:39:45.198 INFO 27220 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2018-02-15 17:39:45.212 INFO 27220 --- [ main] utoConfigurationReportLoggingInitializer :
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2018-02-15 17:39:45.217 ERROR 27220 --- [ main] o.s.boot.SpringApplication : Application startup failed
I tried all of the solutions for similar problems here but none of them seem to work out. When I added #EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class}) to class WebServiceSpringBootApplication extends SpringBootServletInitializer it doesn't error, but it doesn't connect to database too. How am I supposed to fix this?
I try to setup consul service.but i just can't start it.
my project is simple. my email : keets001#gmail.com
there are little configurations on spring.io
could someone help me? thanks a lot.
pom:
<dependencies>
<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-consul-config -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-consul-config</artifactId>
<version>1.0.2.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-consul-discovery -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-consul-discovery</artifactId>
<version>1.0.0.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-bus -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-bus</artifactId>
<version>1.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-consul-ui</artifactId>
<version>1.0.0.M1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-consul-dependencies -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-consul-dependencies</artifactId>
<version>1.0.0.RELEASE</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-all</artifactId>
</dependency>
</dependencies>
application.yml:
spring:
cloud:
config:
retry:
initial-interval: 10
max-interval: 20
consul:
consul:
port: 8500
host: localhost
enabled: false
discovery:
preferIpAddress: true
enabled: true
register: true
service-name: config-server
hostname: localhost
bootstrap.yml:
spring:
application:
name: testConsulApp
bootstrap.java
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.ui.EnableConsulUi;
#SpringBootApplication
#EnableDiscoveryClient
#EnableConsulUi
#EnableAutoConfiguration
public class Bootstrap {
public static void main(String[] args) {
SpringApplication.run(Bootstrap.class, args);
}
}
error:
2016-09-02 14:45:57.124 WARN 22886 --- [ main] o.s.boot.SpringApplication : Error handling failed (ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#2054d744: startup date [Thu Jan 01 08:00:00 CST 1970]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext#2530aeb4)
2016-09-02 14:45:57.139 ERROR 22886 --- [ main] o.s.boot.SpringApplication : Application startup failed
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'configServerRetryInterceptor' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:702) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1180) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.getDelegate(AnnotationAwareRetryOperationsInterceptor.java:138) ~[spring-retry-1.1.2.RELEASE.jar:na]
at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:116) ~[spring-retry-1.1.2.RELEASE.jar:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655) ~[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$$EnhancerBySpringCGLIB$$d2da9622.locate(<generated>) ~[spring-cloud-config-client-1.1.2.RELEASE.jar:1.1.2.RELEASE]
at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:89) ~[spring-cloud-context-1.1.1.RELEASE.jar:1.1.1.RELEASE]
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:633) [spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:347) [spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) [spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185) [spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174) [spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
at consul.Bootstrap.main(Bootstrap.java:16) [classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_74]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_74]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_74]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_74]
at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:483) [spring-boot-maven-plugin-1.4.0.RELEASE.jar:1.4.0.RELEASE]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_74]
[WARNING]
java.lang.reflect.InvocationTargetException
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.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:483)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'configServerRetryInterceptor' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:702)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1180)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.getDelegate(AnnotationAwareRetryOperationsInterceptor.java:138)
at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:116)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$$EnhancerBySpringCGLIB$$d2da9622.locate(<generated>)
at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:89)
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:633)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:347)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:311)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174)
at consul.Bootstrap.main(Bootstrap.java:16)
... 6 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.346 s
[INFO] Finished at: 2016-09-02T14:45:57+08:00
[INFO] Final Memory: 44M/735M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.0.RELEASE:run (default-cli) on project consulClient: An exception occurred while running. null: InvocationTargetException: No bean named 'configServerRetryInterceptor' is defined -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
There are a few odd things about your dependencies. Nearly all of them are redundant. It should work if you remove them all except the spring-cloud-starter-consul-all.