[Kotlin + Spring] Maven configuration

Posted at 2019.05.26 11:55 | Posted in Java+/Trouble Shooting

Problem

Kotlin 1.3 이상을 사용하면서 스프링 부트 메인 클래스는 open 키워드를 넣어줘야 하는 가벼운(?) 이슈가 있었었다...

이번에는 spring-data + Mongodb를 공부하면서 다시 이 이슈가 등장하였다.

Kotlin + Spring 하면서 코틀린의 class 가 final로 되는 부분과 스프링에서 빈을 처리하기위해 클래스를 까발리는(?) 부분에서 문제가 생긴다. final class 는 조작이 안되기 때문에!?

> mvn spring-boot:run

[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< com.microservices:chapter5 >---------------------
[INFO] Building chapter5 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:2.1.5.RELEASE:run (default-cli) > test-compile @ chapter5 >>>
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ chapter5 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ chapter5 ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- kotlin-maven-plugin:1.3.31:compile (compile) @ chapter5 ---
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (compile) @ chapter5 ---
[INFO] Changes detected - recompiling the module!
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ chapter5 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\dev\projects\kotlin-micro-service\chapter5\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ chapter5 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to D:\dev\projects\kotlin-micro-service\chapter5\target\test-classes
[INFO]
[INFO] --- kotlin-maven-plugin:1.3.31:test-compile (test-compile) @ chapter5 ---
[WARNING] No sources found skipping Kotlin compile
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (testCompile) @ chapter5 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to D:\dev\projects\kotlin-micro-service\chapter5\target\test-classes
[INFO]
[INFO] <<< spring-boot-maven-plugin:2.1.5.RELEASE:run (default-cli) < test-compile @ chapter5 <<<
[INFO]
[INFO]
[INFO] --- spring-boot-maven-plugin:2.1.5.RELEASE:run (default-cli) @ chapter5 ---

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.1.5.RELEASE)

0000-00-00 00:00:46.552  INFO 5708 --- [           main] c.m.chapter5.Chapter5ApplicationKt       : Starting Chapter5ApplicationKt on ANTOP-GRAM with PID 5708 (D:\dev\projects\kotlin-micro-service\chapter5\target\classes started by antop in D:\dev\projects\kotlin-m
icro-service\chapter5)
0000-00-00 00:00:46.556  INFO 5708 --- [           main] c.m.chapter5.Chapter5ApplicationKt       : No active profile set, falling back to default profiles: default
0000-00-00 00:00:46.739  WARN 5708 --- [kground-preinit] o.s.h.c.j.Jackson2ObjectMapperBuilder    : For Jackson Kotlin classes support please add "com.fasterxml.jackson.module:jackson-module-kotlin" to the classpath
0000-00-00 00:00:47.090  INFO 5708 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
0000-00-00 00:00:47.126  INFO 5708 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 29ms. Found 0 repository interfaces.
0000-00-00 00:00:47.132  INFO 5708 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
0000-00-00 00:00:47.137  INFO 5708 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 4ms. Found 0 repository interfaces.
0000-00-00 00:00:48.799  INFO 5708 --- [           main] org.mongodb.driver.cluster               : Cluster created with settings {hosts=[localhost:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
0000-00-00 00:00:49.003  INFO 5708 --- [           main] org.mongodb.driver.cluster               : Cluster created with settings {hosts=[localhost:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
0000-00-00 00:00:49.056  INFO 5708 --- [localhost:27017] org.mongodb.driver.connection            : Opened connection [connectionId{localValue:2, serverValue:16}] to localhost:27017
0000-00-00 00:00:49.063  INFO 5708 --- [localhost:27017] org.mongodb.driver.cluster               : Monitor thread successfully connected to server with description ServerDescription{address=localhost:27017, type=STANDALONE, state=CONNECTED, ok=true, version=Server
Version{versionList=[4, 0, 9]}, minWireVersion=0, maxWireVersion=7, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=4861938}
0000-00-00 00:00:49.491  INFO 5708 --- [localhost:27017] org.mongodb.driver.connection            : Opened connection [connectionId{localValue:1, serverValue:17}] to localhost:27017
0000-00-00 00:00:49.493  INFO 5708 --- [localhost:27017] org.mongodb.driver.cluster               : Monitor thread successfully connected to server with description ServerDescription{address=localhost:27017, type=STANDALONE, state=CONNECTED, ok=true, version=Server
Version{versionList=[4, 0, 9]}, minWireVersion=0, maxWireVersion=7, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=2452559}
0000-00-00 00:00:49.643  INFO 5708 --- [ntLoopGroup-2-2] org.mongodb.driver.connection            : Opened connection [connectionId{localValue:3, serverValue:18}] to localhost:27017
0000-00-00 00:00:49.643  INFO 5708 --- [ntLoopGroup-2-3] org.mongodb.driver.connection            : Opened connection [connectionId{localValue:4, serverValue:19}] to localhost:27017
0000-00-00 00:00:49.645  INFO 5708 --- [ntLoopGroup-2-4] org.mongodb.driver.connection            : Opened connection [connectionId{localValue:5, serverValue:20}] to localhost:27017
0000-00-00 00:00:49.652  WARN 5708 --- [           main] onfigReactiveWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating be
an with name 'customerHandler' defined in file [D:\dev\projects\kotlin-micro-service\chapter5\target\classes\com\microservices\chapter5\CustomerHandler.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework
.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customerServiceImpl': Unsatisfied dependency expressed through field 'customerRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean
 with name 'customerRepository' defined in file [D:\dev\projects\kotlin-micro-service\chapter5\target\classes\com\microservices\chapter5\CustomerRepository.class]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigExcepti
on: Could not generate CGLIB subclass of class com.microservices.chapter5.CustomerRepository: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Cannot subclass final class com.m
icroservices.chapter5.CustomerRepository
0000-00-00 00:00:49.665  WARN 5708 --- [ntLoopGroup-2-3] org.mongodb.driver.connection            : Got socket exception on connection [connectionId{localValue:4, serverValue:19}] to localhost:27017. All connections to localhost:27017 will be closed.
0000-00-00 00:00:49.665  WARN 5708 --- [ntLoopGroup-2-4] org.mongodb.driver.connection            : Got socket exception on connection [connectionId{localValue:5, serverValue:20}] to localhost:27017. All connections to localhost:27017 will be closed.
0000-00-00 00:00:49.665  WARN 5708 --- [ntLoopGroup-2-2] org.mongodb.driver.connection            : Got socket exception on connection [connectionId{localValue:3, serverValue:18}] to localhost:27017. All connections to localhost:27017 will be closed.
0000-00-00 00:00:49.672 ERROR 5708 --- [ntLoopGroup-2-2] org.mongodb.driver.connection            : Callback onResult call produced an error

java.lang.IllegalStateException: state should be: open
        at com.mongodb.assertions.Assertions.isTrue(Assertions.java:70) ~[mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.DefaultServer.invalidate(DefaultServer.java:125) ~[mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.DefaultServer.handleThrowable(DefaultServer.java:163) ~[mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.DefaultServer.access$600(DefaultServer.java:45) ~[mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor$2.onResult(DefaultServer.java:223) ~[mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.CommandProtocolImpl$1.onResult(CommandProtocolImpl.java:83) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection$1.onResult(DefaultConnectionPool.java:461) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.UsageTrackingInternalConnection$2.onResult(UsageTrackingInternalConnection.java:111) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection$2$1.onResult(InternalStreamConnection.java:361) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection$2$1.onResult(InternalStreamConnection.java:356) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback.onResult(InternalStreamConnection.java:603) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback.onResult(InternalStreamConnection.java:593) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection$5.failed(InternalStreamConnection.java:500) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.connection.netty.NettyStream.readAsync(NettyStream.java:232) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.connection.netty.NettyStream.handleReadResponse(NettyStream.java:266) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.connection.netty.NettyStream.access$600(NettyStream.java:66) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.connection.netty.NettyStream$2$1.operationComplete(NettyStream.java:153) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.connection.netty.NettyStream$2$1.operationComplete(NettyStream.java:150) [mongodb-driver-core-3.8.2.jar:na]
        at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:502) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:476) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:415) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:540) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:529) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:101) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannel$CloseFuture.setClosed(AbstractChannel.java:1183) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.doClose0(AbstractChannel.java:769) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:745) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:616) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.nio.NioEventLoop.closeAll(NioEventLoop.java:730) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:509) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:906) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191-1-ojdkbuild]

0000-00-00 00:00:49.672 ERROR 5708 --- [ntLoopGroup-2-3] org.mongodb.driver.connection            : Callback onResult call produced an error

java.lang.IllegalStateException: state should be: open
        at com.mongodb.assertions.Assertions.isTrue(Assertions.java:70) ~[mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.DefaultServer.invalidate(DefaultServer.java:125) ~[mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.DefaultServer.handleThrowable(DefaultServer.java:163) ~[mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.DefaultServer.access$600(DefaultServer.java:45) ~[mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor$2.onResult(DefaultServer.java:223) ~[mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.CommandProtocolImpl$1.onResult(CommandProtocolImpl.java:83) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection$1.onResult(DefaultConnectionPool.java:461) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.UsageTrackingInternalConnection$2.onResult(UsageTrackingInternalConnection.java:111) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection$2$1.onResult(InternalStreamConnection.java:361) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection$2$1.onResult(InternalStreamConnection.java:356) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback.onResult(InternalStreamConnection.java:603) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback.onResult(InternalStreamConnection.java:593) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection$5.failed(InternalStreamConnection.java:500) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.connection.netty.NettyStream.readAsync(NettyStream.java:232) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.connection.netty.NettyStream.handleReadResponse(NettyStream.java:266) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.connection.netty.NettyStream.access$600(NettyStream.java:66) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.connection.netty.NettyStream$2$1.operationComplete(NettyStream.java:153) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.connection.netty.NettyStream$2$1.operationComplete(NettyStream.java:150) [mongodb-driver-core-3.8.2.jar:na]
        at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:502) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:476) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:415) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:540) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:529) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:101) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannel$CloseFuture.setClosed(AbstractChannel.java:1183) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.doClose0(AbstractChannel.java:769) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:745) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:616) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.nio.NioEventLoop.closeAll(NioEventLoop.java:730) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:509) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:906) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191-1-ojdkbuild]

0000-00-00 00:00:49.672 ERROR 5708 --- [ntLoopGroup-2-4] org.mongodb.driver.connection            : Callback onResult call produced an error

java.lang.IllegalStateException: state should be: open
        at com.mongodb.assertions.Assertions.isTrue(Assertions.java:70) ~[mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.DefaultServer.invalidate(DefaultServer.java:125) ~[mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.DefaultServer.handleThrowable(DefaultServer.java:163) ~[mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.DefaultServer.access$600(DefaultServer.java:45) ~[mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor$2.onResult(DefaultServer.java:223) ~[mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.CommandProtocolImpl$1.onResult(CommandProtocolImpl.java:83) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection$1.onResult(DefaultConnectionPool.java:461) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.UsageTrackingInternalConnection$2.onResult(UsageTrackingInternalConnection.java:111) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection$2$1.onResult(InternalStreamConnection.java:361) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection$2$1.onResult(InternalStreamConnection.java:356) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback.onResult(InternalStreamConnection.java:603) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback.onResult(InternalStreamConnection.java:593) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.internal.connection.InternalStreamConnection$5.failed(InternalStreamConnection.java:500) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.connection.netty.NettyStream.readAsync(NettyStream.java:232) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.connection.netty.NettyStream.handleReadResponse(NettyStream.java:266) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.connection.netty.NettyStream.access$600(NettyStream.java:66) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.connection.netty.NettyStream$2$1.operationComplete(NettyStream.java:153) [mongodb-driver-core-3.8.2.jar:na]
        at com.mongodb.connection.netty.NettyStream$2$1.operationComplete(NettyStream.java:150) [mongodb-driver-core-3.8.2.jar:na]
        at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:502) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:476) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:415) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:540) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:529) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:101) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannel$CloseFuture.setClosed(AbstractChannel.java:1183) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.doClose0(AbstractChannel.java:769) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:745) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:616) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.nio.NioEventLoop.closeAll(NioEventLoop.java:730) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:509) [netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:906) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.36.Final.jar:4.1.36.Final]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191-1-ojdkbuild]

0000-00-00 00:00:51.886  INFO 5708 --- [           main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
0000-00-00 00:00:51.892 ERROR 5708 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customerHandler' defined in file [D:\dev\projects\kotlin-micro-service\chapter5\target\classes\com\microservices\chapter5\CustomerHandler.class]: Unsatisfied dependency
 expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customerServiceImpl': Unsatisfied dependency expressed through field 'customerRepository'; nested except
ion is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerRepository' defined in file [D:\dev\projects\kotlin-micro-service\chapter5\target\classes\com\microservices\chapter5\CustomerRepository.class]: Initialization of
bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class com.microservices.chapter5.CustomerRepository: Common causes of this problem include using a final class or a non-visible class; nested
 exception is java.lang.IllegalArgumentException: Cannot subclass final class com.microservices.chapter5.CustomerRepository
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:769) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:218) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1341) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1187) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:843) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:67) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE]
        at com.microservices.chapter5.Chapter5ApplicationKt.main(Chapter5Application.kt:12) [classes/:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_191-1-ojdkbuild]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_191-1-ojdkbuild]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_191-1-ojdkbuild]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_191-1-ojdkbuild]
        at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:558) [spring-boot-maven-plugin-2.1.5.RELEASE.jar:2.1.5.RELEASE]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191-1-ojdkbuild]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customerServiceImpl': Unsatisfied dependency expressed through field 'customerRepository'; nested exception is org.springframework.beans.factory.BeanCreation
Exception: Error creating bean with name 'customerRepository' defined in file [D:\dev\projects\kotlin-micro-service\chapter5\target\classes\com\microservices\chapter5\CustomerRepository.class]: Initialization of bean failed; nested exception is org.springframework.
aop.framework.AopConfigException: Could not generate CGLIB subclass of class com.microservices.chapter5.CustomerRepository: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Can
not subclass final class com.microservices.chapter5.CustomerRepository
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:596) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:374) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1411) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1248) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1168) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:857) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:760) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        ... 25 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerRepository' defined in file [D:\dev\projects\kotlin-micro-service\chapter5\target\classes\com\microservices\chapter5\CustomerRepository.class]: Initialization
 of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class com.microservices.chapter5.CustomerRepository: Common causes of this problem include using a final class or a non-visible class; ne
sted exception is java.lang.IllegalArgumentException: Cannot subclass final class com.microservices.chapter5.CustomerRepository
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1248) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1168) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:593) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        ... 39 common frames omitted
Caused by: org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class com.microservices.chapter5.CustomerRepository: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lan
g.IllegalArgumentException: Cannot subclass final class com.microservices.chapter5.CustomerRepository
        at org.springframework.aop.framework.CglibAopProxy.getProxy(CglibAopProxy.java:208) ~[spring-aop-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:110) ~[spring-aop-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor.postProcessAfterInitialization(AbstractAdvisingBeanPostProcessor.java:92) ~[spring-aop-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:429) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1782) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        ... 48 common frames omitted
Caused by: java.lang.IllegalArgumentException: Cannot subclass final class com.microservices.chapter5.CustomerRepository
        at org.springframework.cglib.proxy.Enhancer.generateClass(Enhancer.java:657) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.cglib.transform.TransformingClassGenerator.generateClass(TransformingClassGenerator.java:33) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.aop.framework.CglibAopProxy$ClassLoaderAwareUndeclaredThrowableStrategy.generate(CglibAopProxy.java:1007) ~[spring-aop-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:358) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.cglib.proxy.Enhancer.generate(Enhancer.java:582) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:110) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:108) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_191-1-ojdkbuild]
        at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:134) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:319) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.cglib.proxy.Enhancer.createHelper(Enhancer.java:569) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.cglib.proxy.Enhancer.createClass(Enhancer.java:416) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.aop.framework.ObjenesisCglibAopProxy.createProxyClassAndInstance(ObjenesisCglibAopProxy.java:57) ~[spring-aop-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.aop.framework.CglibAopProxy.getProxy(CglibAopProxy.java:205) ~[spring-aop-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        ... 53 common frames omitted

[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:558)
    at java.lang.Thread.run (Thread.java:748)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customerHandler' defined in file [D:\dev\projects\kotlin-micro-service\chapter5\target\classes\com\microservices\chapter5\CustomerHandler.class]: Unsatisfied
 dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customerServiceImpl': Unsatisfied dependency expressed through field 'customerRepository'; ne
sted exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerRepository' defined in file [D:\dev\projects\kotlin-micro-service\chapter5\target\classes\com\microservices\chapter5\CustomerRepository.class]: Initial
ization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class com.microservices.chapter5.CustomerRepository: Common causes of this problem include using a final class or a non-visible cl
ass; nested exception is java.lang.IllegalArgumentException: Cannot subclass final class com.microservices.chapter5.CustomerRepository
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray (ConstructorResolver.java:769)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor (ConstructorResolver.java:218)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor (AbstractAutowireCapableBeanFactory.java:1341)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance (AbstractAutowireCapableBeanFactory.java:1187)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:555)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:515)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0 (AbstractBeanFactory.java:320)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:318)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons (DefaultListableBeanFactory.java:843)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization (AbstractApplicationContext.java:877)
    at org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:549)
    at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh (ReactiveWebServerApplicationContext.java:67)
    at org.springframework.boot.SpringApplication.refresh (SpringApplication.java:775)
    at org.springframework.boot.SpringApplication.refreshContext (SpringApplication.java:397)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:316)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:1260)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:1248)
    at com.microservices.chapter5.Chapter5ApplicationKt.main (Chapter5Application.kt:12)
    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:558)
    at java.lang.Thread.run (Thread.java:748)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customerServiceImpl': Unsatisfied dependency expressed through field 'customerRepository'; nested exception is org.springframework.beans.factory.BeanCreation
Exception: Error creating bean with name 'customerRepository' defined in file [D:\dev\projects\kotlin-micro-service\chapter5\target\classes\com\microservices\chapter5\CustomerRepository.class]: Initialization of bean failed; nested exception is org.springframework.
aop.framework.AopConfigException: Could not generate CGLIB subclass of class com.microservices.chapter5.CustomerRepository: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Can
not subclass final class com.microservices.chapter5.CustomerRepository
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject (AutowiredAnnotationBeanPostProcessor.java:596)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject (InjectionMetadata.java:90)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties (AutowiredAnnotationBeanPostProcessor.java:374)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean (AbstractAutowireCapableBeanFactory.java:1411)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:592)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:515)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0 (AbstractBeanFactory.java:320)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:318)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate (DependencyDescriptor.java:277)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency (DefaultListableBeanFactory.java:1248)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency (DefaultListableBeanFactory.java:1168)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument (ConstructorResolver.java:857)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray (ConstructorResolver.java:760)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor (ConstructorResolver.java:218)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor (AbstractAutowireCapableBeanFactory.java:1341)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance (AbstractAutowireCapableBeanFactory.java:1187)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:555)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:515)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0 (AbstractBeanFactory.java:320)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:318)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons (DefaultListableBeanFactory.java:843)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization (AbstractApplicationContext.java:877)
    at org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:549)
    at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh (ReactiveWebServerApplicationContext.java:67)
    at org.springframework.boot.SpringApplication.refresh (SpringApplication.java:775)
    at org.springframework.boot.SpringApplication.refreshContext (SpringApplication.java:397)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:316)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:1260)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:1248)
    at com.microservices.chapter5.Chapter5ApplicationKt.main (Chapter5Application.kt:12)
    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:558)
    at java.lang.Thread.run (Thread.java:748)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerRepository' defined in file [D:\dev\projects\kotlin-micro-service\chapter5\target\classes\com\microservices\chapter5\CustomerRepository.class]: Initialization
 of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class com.microservices.chapter5.CustomerRepository: Common causes of this problem include using a final class or a non-visible class; ne
sted exception is java.lang.IllegalArgumentException: Cannot subclass final class com.microservices.chapter5.CustomerRepository
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:601)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:515)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0 (AbstractBeanFactory.java:320)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:318)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate (DependencyDescriptor.java:277)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency (DefaultListableBeanFactory.java:1248)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency (DefaultListableBeanFactory.java:1168)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject (AutowiredAnnotationBeanPostProcessor.java:593)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject (InjectionMetadata.java:90)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties (AutowiredAnnotationBeanPostProcessor.java:374)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean (AbstractAutowireCapableBeanFactory.java:1411)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:592)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:515)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0 (AbstractBeanFactory.java:320)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:318)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate (DependencyDescriptor.java:277)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency (DefaultListableBeanFactory.java:1248)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency (DefaultListableBeanFactory.java:1168)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument (ConstructorResolver.java:857)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray (ConstructorResolver.java:760)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor (ConstructorResolver.java:218)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor (AbstractAutowireCapableBeanFactory.java:1341)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance (AbstractAutowireCapableBeanFactory.java:1187)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:555)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:515)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0 (AbstractBeanFactory.java:320)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:318)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons (DefaultListableBeanFactory.java:843)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization (AbstractApplicationContext.java:877)
    at org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:549)
    at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh (ReactiveWebServerApplicationContext.java:67)
    at org.springframework.boot.SpringApplication.refresh (SpringApplication.java:775)
    at org.springframework.boot.SpringApplication.refreshContext (SpringApplication.java:397)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:316)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:1260)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:1248)
    at com.microservices.chapter5.Chapter5ApplicationKt.main (Chapter5Application.kt:12)
    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:558)
    at java.lang.Thread.run (Thread.java:748)
Caused by: org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class com.microservices.chapter5.CustomerRepository: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lan
g.IllegalArgumentException: Cannot subclass final class com.microservices.chapter5.CustomerRepository
    at org.springframework.aop.framework.CglibAopProxy.getProxy (CglibAopProxy.java:208)
    at org.springframework.aop.framework.ProxyFactory.getProxy (ProxyFactory.java:110)
    at org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor.postProcessAfterInitialization (AbstractAdvisingBeanPostProcessor.java:92)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization (AbstractAutowireCapableBeanFactory.java:429)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean (AbstractAutowireCapableBeanFactory.java:1782)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:593)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:515)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0 (AbstractBeanFactory.java:320)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:318)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate (DependencyDescriptor.java:277)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency (DefaultListableBeanFactory.java:1248)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency (DefaultListableBeanFactory.java:1168)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject (AutowiredAnnotationBeanPostProcessor.java:593)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject (InjectionMetadata.java:90)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties (AutowiredAnnotationBeanPostProcessor.java:374)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean (AbstractAutowireCapableBeanFactory.java:1411)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:592)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:515)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0 (AbstractBeanFactory.java:320)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:318)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate (DependencyDescriptor.java:277)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency (DefaultListableBeanFactory.java:1248)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency (DefaultListableBeanFactory.java:1168)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument (ConstructorResolver.java:857)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray (ConstructorResolver.java:760)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor (ConstructorResolver.java:218)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor (AbstractAutowireCapableBeanFactory.java:1341)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance (AbstractAutowireCapableBeanFactory.java:1187)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:555)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:515)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0 (AbstractBeanFactory.java:320)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:318)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons (DefaultListableBeanFactory.java:843)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization (AbstractApplicationContext.java:877)
    at org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:549)
    at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh (ReactiveWebServerApplicationContext.java:67)
    at org.springframework.boot.SpringApplication.refresh (SpringApplication.java:775)
    at org.springframework.boot.SpringApplication.refreshContext (SpringApplication.java:397)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:316)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:1260)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:1248)
    at com.microservices.chapter5.Chapter5ApplicationKt.main (Chapter5Application.kt:12)
    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:558)
    at java.lang.Thread.run (Thread.java:748)
Caused by: java.lang.IllegalArgumentException: Cannot subclass final class com.microservices.chapter5.CustomerRepository
    at org.springframework.cglib.proxy.Enhancer.generateClass (Enhancer.java:657)
    at org.springframework.cglib.transform.TransformingClassGenerator.generateClass (TransformingClassGenerator.java:33)
    at org.springframework.cglib.core.DefaultGeneratorStrategy.generate (DefaultGeneratorStrategy.java:25)
    at org.springframework.aop.framework.CglibAopProxy$ClassLoaderAwareUndeclaredThrowableStrategy.generate (CglibAopProxy.java:1007)
    at org.springframework.cglib.core.AbstractClassGenerator.generate (AbstractClassGenerator.java:358)
    at org.springframework.cglib.proxy.Enhancer.generate (Enhancer.java:582)
    at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply (AbstractClassGenerator.java:110)
    at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply (AbstractClassGenerator.java:108)
    at org.springframework.cglib.core.internal.LoadingCache$2.call (LoadingCache.java:54)
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    at org.springframework.cglib.core.internal.LoadingCache.createEntry (LoadingCache.java:61)
    at org.springframework.cglib.core.internal.LoadingCache.get (LoadingCache.java:34)
    at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get (AbstractClassGenerator.java:134)
    at org.springframework.cglib.core.AbstractClassGenerator.create (AbstractClassGenerator.java:319)
    at org.springframework.cglib.proxy.Enhancer.createHelper (Enhancer.java:569)
    at org.springframework.cglib.proxy.Enhancer.createClass (Enhancer.java:416)
    at org.springframework.aop.framework.ObjenesisCglibAopProxy.createProxyClassAndInstance (ObjenesisCglibAopProxy.java:57)
    at org.springframework.aop.framework.CglibAopProxy.getProxy (CglibAopProxy.java:205)
    at org.springframework.aop.framework.ProxyFactory.getProxy (ProxyFactory.java:110)
    at org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor.postProcessAfterInitialization (AbstractAdvisingBeanPostProcessor.java:92)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization (AbstractAutowireCapableBeanFactory.java:429)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean (AbstractAutowireCapableBeanFactory.java:1782)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:593)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:515)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0 (AbstractBeanFactory.java:320)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:318)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate (DependencyDescriptor.java:277)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency (DefaultListableBeanFactory.java:1248)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency (DefaultListableBeanFactory.java:1168)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject (AutowiredAnnotationBeanPostProcessor.java:593)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject (InjectionMetadata.java:90)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties (AutowiredAnnotationBeanPostProcessor.java:374)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean (AbstractAutowireCapableBeanFactory.java:1411)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:592)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:515)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0 (AbstractBeanFactory.java:320)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:318)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate (DependencyDescriptor.java:277)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency (DefaultListableBeanFactory.java:1248)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency (DefaultListableBeanFactory.java:1168)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument (ConstructorResolver.java:857)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray (ConstructorResolver.java:760)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor (ConstructorResolver.java:218)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor (AbstractAutowireCapableBeanFactory.java:1341)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance (AbstractAutowireCapableBeanFactory.java:1187)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:555)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:515)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0 (AbstractBeanFactory.java:320)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:318)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons (DefaultListableBeanFactory.java:843)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization (AbstractApplicationContext.java:877)
    at org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:549)
    at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh (ReactiveWebServerApplicationContext.java:67)
    at org.springframework.boot.SpringApplication.refresh (SpringApplication.java:775)
    at org.springframework.boot.SpringApplication.refreshContext (SpringApplication.java:397)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:316)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:1260)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:1248)
    at com.microservices.chapter5.Chapter5ApplicationKt.main (Chapter5Application.kt:12)
    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:558)
    at java.lang.Thread.run (Thread.java:748)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  17.050 s
[INFO] Finished at: 2019-05-26T11:40:53+09:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.5.RELEASE:run (default-cli) on project chapter5: An exception occurred while running. null: InvocationTargetException: Error creating bean with name 'customerHandler' defined in fi
le [D:\dev\projects\kotlin-micro-service\chapter5\target\classes\com\microservices\chapter5\CustomerHandler.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyExceptio
n: Error creating bean with name 'customerServiceImpl': Unsatisfied dependency expressed through field 'customerRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerRepository' defined in f
ile [D:\dev\projects\kotlin-micro-service\chapter5\target\classes\com\microservices\chapter5\CustomerRepository.class]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of cla
ss com.microservices.chapter5.CustomerRepository: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Cannot subclass final class com.microservices.chapter5.CustomerRepository ->
[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

이런다고 CustomerRepositroy 클리스에 open 을 달아주면?

@Repository
open class CustomerRepository(private val template: ReactiveMongoTemplate) {

}

런타임에 아래와 같이 NullPointException이 발생하게 된다.

java.lang.NullPointerException: null
        at com.microservices.chapter5.CustomerRepository.findCustomer(CustomerRepository.kt:48) ~[classes/:na]
        at com.microservices.chapter5.CustomerServiceImpl.searchCustomers(CustomerServiceImpl.kt:21) ~[classes/:na]
        at com.microservices.chapter5.CustomerHandler.search(CustomerHandler.kt:32) ~[classes/:na]
        at com.microservices.chapter5.CustomerRouter$customerRoutes$1$2$1.invoke(CustomerRouter.kt:17) ~[classes/:na]
        at com.microservices.chapter5.CustomerRouter$customerRoutes$1$2$1.invoke(CustomerRouter.kt:8) ~[classes/:na]
        at org.springframework.web.reactive.function.server.RouterFunctionDsl$GET$1.handle(RouterFunctionDsl.kt:158) ~[spring-webflux-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.web.reactive.function.server.support.HandlerFunctionAdapter.handle(HandlerFunctionAdapter.java:61) ~[spring-webflux-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.web.reactive.DispatcherHandler.invokeHandler(DispatcherHandler.java:166) ~[spring-webflux-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at org.springframework.web.reactive.DispatcherHandler.lambda$handle$1(DispatcherHandler.java:151) ~[spring-webflux-5.1.7.RELEASE.jar:5.1.7.RELEASE]
        at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:118) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:76) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.innerNext(FluxConcatMap.java:275) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.FluxConcatMap$ConcatMapInner.onNext(FluxConcatMap.java:849) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:114) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:192) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:204) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2066) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.request(FluxPeekFuseable.java:138) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:1874) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:1748) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onSubscribe(FluxPeekFuseable.java:172) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoPeekFuseable.subscribe(MonoPeekFuseable.java:74) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.Mono.subscribe(Mono.java:3710) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onComplete(FluxSwitchIfEmpty.java:75) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.Operators.complete(Operators.java:131) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoEmpty.subscribe(MonoEmpty.java:45) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoSwitchIfEmpty.subscribe(MonoSwitchIfEmpty.java:44) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoPeek.subscribe(MonoPeek.java:71) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoMap.subscribe(MonoMap.java:55) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.Mono.subscribe(Mono.java:3710) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.drain(FluxConcatMap.java:442) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.onSubscribe(FluxConcatMap.java:212) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:139) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:63) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.FluxConcatMap.subscribe(FluxConcatMap.java:121) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoNext.subscribe(MonoNext.java:40) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoSwitchIfEmpty.subscribe(MonoSwitchIfEmpty.java:44) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoPeekTerminal.subscribe(MonoPeekTerminal.java:61) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.Mono.subscribe(Mono.java:3710) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:172) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoPeekFuseable.subscribe(MonoPeekFuseable.java:70) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.core.publisher.MonoPeekTerminal.subscribe(MonoPeekTerminal.java:61) ~[reactor-core-3.2.9.RELEASE.jar:3.2.9.RELEASE]
        at reactor.netty.http.server.HttpServerHandle.onStateChange(HttpServerHandle.java:64) ~[reactor-netty-0.8.8.RELEASE.jar:0.8.8.RELEASE]
        at reactor.netty.tcp.TcpServerBind$ChildObserver.onStateChange(TcpServerBind.java:226) ~[reactor-netty-0.8.8.RELEASE.jar:0.8.8.RELEASE]
        at reactor.netty.http.server.HttpServerOperations.onInboundNext(HttpServerOperations.java:442) ~[reactor-netty-0.8.8.RELEASE.jar:0.8.8.RELEASE]
        at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:91) ~[reactor-netty-0.8.8.RELEASE.jar:0.8.8.RELEASE]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at reactor.netty.http.server.HttpTrafficHandler.channelRead(HttpTrafficHandler.java:161) ~[reactor-netty-0.8.8.RELEASE.jar:0.8.8.RELEASE]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:323) ~[netty-codec-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:297) ~[netty-codec-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1408) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:682) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:617) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:534) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:906) ~[netty-common-4.1.36.Final.jar:4.1.36.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.36.Final.jar:4.1.36.Final]
        at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_191-1-ojdkbuild]

Solution

kotlin-mavn-pluginconfiguration 부분부터 아래와 같이 추가

            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <version>${kotlin.version}</version>
                <executions>
                    ...
                </executions>
                <configuration>
                    <jvmTarget>1.8</jvmTarget>
                    <!-- https://stackoverflow.com/questions/52599769/spring-kotlin-bean-fields-are-null-at-runtime-despite-being-injected-during-in -->
                    <!-- https://dzone.com/articles/open-your-classes-and-methods-in-kotlin -->
                    <!-- https://blog.frankel.ch/open-your-classes-and-methods-in-kotlin/ -->
                    <compilerPlugins>
                        <plugin>spring</plugin>
                    </compilerPlugins>
                </configuration>
                <dependencies>
                    <!-- https://www.baeldung.com/kotlin-allopen-spring -->
                    <dependency>
                        <groupId>org.jetbrains.kotlin</groupId>
                        <artifactId>kotlin-maven-allopen</artifactId>
                        <version>${kotlin.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

mvn clean spring-boot:run 으로 실행했을 때 아래와 같은 로그가 나와야 한다..

[INFO] --- kotlin-maven-plugin:1.3.31:compile (compile) @ chapter5 ---
[INFO] Applied plugin: 'spring'
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.microservices:chapter5:jar:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar -> duplicate declaration of version ${kotlin.version} @ line 58, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ---------------------< com.microservices:chapter5 >---------------------
[INFO] Building chapter5 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:2.1.5.RELEASE:run (default-cli) > test-compile @ chapter5 >>>
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ chapter5 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- kotlin-maven-plugin:1.3.31:compile (compile) @ chapter5 ---
[INFO] Applied plugin: 'spring'
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (compile) @ chapter5 ---
[INFO] Changes detected - recompiling the module!
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ chapter5 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\dev\projects\kotlin-micro-service\chapter5\src\test\resources
[INFO]
[INFO] --- kotlin-maven-plugin:1.3.31:test-compile (test-compile) @ chapter5 ---
[WARNING] No sources found skipping Kotlin compile
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (testCompile) @ chapter5 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to D:\dev\projects\kotlin-micro-service\chapter5\target\test-classes
[INFO]
[INFO] <<< spring-boot-maven-plugin:2.1.5.RELEASE:run (default-cli) < test-compile @ chapter5 <<<
[INFO]
[INFO]
[INFO] --- spring-boot-maven-plugin:2.1.5.RELEASE:run (default-cli) @ chapter5 ---

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.1.5.RELEASE)

0000-00-00 00:00:48.664  INFO 18644 --- [           main] c.m.chapter5.Chapter5ApplicationKt       : Starting Chapter5ApplicationKt on ANTOP-GRAM with PID 18644 (D:\dev\projects\kotlin-micro-service\chapter5\target\classes started by antop in D:\dev\projects\kotlin
-micro-service\chapter5)
0000-00-00 00:00:48.669  INFO 18644 --- [           main] c.m.chapter5.Chapter5ApplicationKt       : No active profile set, falling back to default profiles: default
0000-00-00 00:00:48.863  WARN 18644 --- [kground-preinit] o.s.h.c.j.Jackson2ObjectMapperBuilder    : For Jackson Kotlin classes support please add "com.fasterxml.jackson.module:jackson-module-kotlin" to the classpath
0000-00-00 00:00:49.187  INFO 18644 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
0000-00-00 00:00:49.217  INFO 18644 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 25ms. Found 0 repository interfaces.
0000-00-00 00:00:49.222  INFO 18644 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
0000-00-00 00:00:49.225  INFO 18644 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 3ms. Found 0 repository interfaces.
0000-00-00 00:00:50.869  INFO 18644 --- [           main] org.mongodb.driver.cluster               : Cluster created with settings {hosts=[localhost:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
0000-00-00 00:00:51.073  INFO 18644 --- [           main] org.mongodb.driver.cluster               : Cluster created with settings {hosts=[localhost:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
0000-00-00 00:00:51.118  INFO 18644 --- [localhost:27017] org.mongodb.driver.connection            : Opened connection [connectionId{localValue:2, serverValue:1}] to localhost:27017
0000-00-00 00:00:51.124  INFO 18644 --- [localhost:27017] org.mongodb.driver.cluster               : Monitor thread successfully connected to server with description ServerDescription{address=localhost:27017, type=STANDALONE, state=CONNECTED, ok=true, version=Serve
rVersion{versionList=[4, 0, 9]}, minWireVersion=0, maxWireVersion=7, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=3995240}
0000-00-00 00:00:51.538  INFO 18644 --- [localhost:27017] org.mongodb.driver.connection            : Opened connection [connectionId{localValue:1, serverValue:2}] to localhost:27017
0000-00-00 00:00:51.545  INFO 18644 --- [localhost:27017] org.mongodb.driver.cluster               : Monitor thread successfully connected to server with description ServerDescription{address=localhost:27017, type=STANDALONE, state=CONNECTED, ok=true, version=Serve
rVersion{versionList=[4, 0, 9]}, minWireVersion=0, maxWireVersion=7, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=5762049}
0000-00-00 00:00:51.657  INFO 18644 --- [ntLoopGroup-2-4] org.mongodb.driver.connection            : Opened connection [connectionId{localValue:5, serverValue:5}] to localhost:27017
0000-00-00 00:00:51.657  INFO 18644 --- [ntLoopGroup-2-3] org.mongodb.driver.connection            : Opened connection [connectionId{localValue:4, serverValue:4}] to localhost:27017
0000-00-00 00:00:51.657  INFO 18644 --- [ntLoopGroup-2-2] org.mongodb.driver.connection            : Opened connection [connectionId{localValue:3, serverValue:3}] to localhost:27017
0000-00-00 00:00:52.261  INFO 18644 --- [           main] o.s.b.web.embedded.netty.NettyWebServer  : Netty started on port(s): 8080
0000-00-00 00:00:52.265  INFO 18644 --- [           main] c.m.chapter5.Chapter5ApplicationKt       : Started Chapter5ApplicationKt in 4.106 seconds (JVM running for 14.602)
tag: Kotlin, Open, Spring
  1. KSL
    저도 같은 에러가 나는데 어떻게 고쳐야하는지 모르겠네요 ㅠㅠ

댓글 (Comment)

Name*

Password*

Link (Your Website)

Comment

SECRET | 비밀글로 남기기

Find class in jar files

Posted at 2018.02.19 09:32 | Posted in Java+

linux 에서

- jar 파일 안에 들어있는 class 를 찾는 명령어이다.

- 원하는 class 가 들어있는 jar 파일을 찾는 명령어이다.


$ find foo/ -name "*.jar" | xargs grep Hello.class


https://www.google.co.kr/search?q=linux+find+class+in+jar

https://stackoverflow.com/questions/14373788/linux-cmd-to-search-for-a-class-file-among-jars-irrespective-of-jar-path

'Java+' 카테고리의 다른 글

Find class in jar files  (0) 2018.02.19
web.xml 서블릿 버전별 DTD  (1) 2013.03.03
Maven Repository for Oracle Library  (0) 2012.12.18
<jsp:forward page="url" /><jsp:include /> <%@ include %>  (0) 2010.04.25
TortoiseSVN 사용하기  (2) 2009.11.16
썸네일(Thumbnail) 만들기  (1) 2009.08.09
Java2Html  (0) 2009.07.19
Jad + JadClipse  (6) 2009.07.11
Java with SQLite  (1) 2009.06.29
Java Database Connectivity  (0) 2009.02.25
tag: class, find, JAR, Java

댓글 (Comment)

Name*

Password*

Link (Your Website)

Comment

SECRET | 비밀글로 남기기

후 이런 사소한거 가지고 반나절을 날려 먹었네... 기억해두자..


GWT 로 프로젝트 진행 중 jsp에 EL 태그를 사용할 일이 있어서 썻더니 그대로 나온다. ㄷㄷ;;


뭐 여러 가지 원인이 있겠지만 나의 경우는 아래와 같이 해결했다.


GWT 개발 모드시 내부적으로 Jetty 를 사용 하는데 WAS 타는듯? -_-/


jsp 파일의 상단에 아래와 같이 추가해주자..


<%@ page isELIgnored="false" %>
tag: EL, JSP

댓글 (Comment)

Name*

Password*

Link (Your Website)

Comment

SECRET | 비밀글로 남기기

LOGBack Configurator with JMX

Posted at 2014.07.20 23:11 | Posted in Java+/Example

Introduce


요즘 logback 많이 쓸꺼다... "Reasons to prefer logback over log4j"에 보면 이제는 log4j 를 버리고 logback 을 써야하는지 이유를 영어로 설명 해놓았다. ㅅㅂ -_-;;


딴건 잘 모르것고 맘에 드는걸 보자면... 

Automatic reloading of configuration files (설정 파일 자동으로 다시 로드)

- Automatic removal of old log archives (이전 로그 아카이브 자동 삭제)

- Automatic compression of archived log files (아카이브 로그 파일 자동 압축)


서버를 재시작 하지 않고 logback.xml 파일을 수정하면 바로 설정이 적용 된다고 한다. ㅎㅎ


그리고 내가 관심 있게 본 하나는 JMX 가 지원된다. JConsole 로 테스트 해보니까 로그 레벨 변경이 바로 적용 되었다.


JMX 를 통해서 할 수 있는 짓거리는 아래와 같다. 몇개 안되고 메소드명 만으로도 이해가 될꺼다.


public interface JMXConfiguratorMBean {

  

  void reloadDefaultConfiguration() throws JoranException;

  

  void reloadByFileName(String fileName) throws JoranException, FileNotFoundException;

  

  void reloadByURL(URL url) throws JoranException;

  

  void setLoggerLevel(String loggerName, String levelStr);

  

  String getLoggerLevel(String loggerName);

  

  String getLoggerEffectiveLevel(String loggerName);


  List<String> getLoggerList();

  

  List<String> getStatuses();


}


오랜만에 웹 프로젝트나 하나 만들어 볼까.. 하고 이상한거 만들어 봤다 -_-




Example


Spring Framework 4.0.5

jQuery 1.11.1

jQuery UI 1.11.0

pqGrid 1.1.3


Logback ConfiguratorLogback Configurator 화면! 매우 간단한 화면이다 ㅎㅎ.


그리드에서 로그 레벨을 클릭하면 변경 할 수 있는 콤보 박스가 나와서 수정하면 바로 반영이 된다.


그리고 아래 Test 버튼을 클릭하면 서버 에 DEBUG/INFO/WARN/ERROR 4줄의 로그를 출력하게 된다.


2014-07-20 22:50:06,375 [http-bio-8080-exec-11] DEBUG c.a.c.LogController - this is debug level log.

2014-07-20 22:50:06,375 [http-bio-8080-exec-11] INFO  c.a.c.LogController - this is info level log.

2014-07-20 22:50:06,375 [http-bio-8080-exec-11] WARN  c.a.c.LogController - this is warn level log.

2014-07-20 22:50:06,375 [http-bio-8080-exec-11] ERROR c.a.c.LogController - this is error level log.


위의 "com.antop.controller.LogController" 의 레벨을 WARN으로 바꾸고 Test 하면? 당연 WARN/ERROR 두줄만 나오게 된다.


Spring MVC 의 URL 매핑은 아래와 같아. 이걸 그림으로 표현주는 툴이 있으면 좋겠네 ㅎㅎ


스프링 MVC URL 매핑 구성도


클래스 다이어그램은 아래와 같다. 어때요? 참 쉽죠~?


Class Diagram클래스 다이어그램. 이게 전부다. -_-/


끝이다.




Download


더이상의 자세한 설명은 생략한다 -_-;; 소스 보거라.


logback.jmx.war


↑ 소스 포함 WAR 파일


logback.jmx.zip


↑ 이클립스 프로젝트 파일 (메이븐)


'Java+ > Example' 카테고리의 다른 글

LOGBack Configurator with JMX  (0) 2014.07.20
현지어로 언어명 보여주기  (0) 2014.02.09
2014년 도로명 주소 사용에 따른 우편번호 준비  (2) 2013.12.22
JSTL Custom Tag using Spring Beans  (0) 2013.12.01
Spring Message Source from Database  (1) 2013.03.03
Infinite Routing DataSource  (1) 2013.01.13
Mybatis Type Handler  (1) 2012.09.30
Using AUTO_INCREMENT keys  (0) 2011.03.01

댓글 (Comment)

Name*

Password*

Link (Your Website)

Comment

SECRET | 비밀글로 남기기

현지어로 언어명 보여주기

Posted at 2014.02.09 15:34 | Posted in Java+/Example

Introduction


다국어를 지원하는 홈페이지에서 언어 선택하는 부분을 보면 대표하는 언어로 다국어명이 나오는 것을 볼 수 있다.



이거 따라해 보자 -_-;;




Locale 에서 getDisplayCountry() 뽑아낼 때 인자로 현재 Locale 을 넣어주면 자신의 Locale 언어 그대로 나온다.


for (Locale locale : Locale.getAvailableLocales()) { if (locale.getCountry().isEmpty() == false) { System.out.println("--"); System.out.println(locale.getCountry()); // 이거 System.out.println(locale.getDisplayCountry(locale)); } }


그리고 다국어 처리를 하려면 View 부분이 UTF-8 이어야 한다. 당연한건가? -_-;




Sample


locale.war


↑ 소스 포함 WAR 파일


locale.zip


↑ 메이븐 프로젝트 파일


Spring MVC 의 인터셉터 부분에서 Locale 부분을 처리하여 ModelAndView 에 넣어주는 방식으로 해봤다.



실행해 보면 아래와 같이 나온다.





'Java+ > Example' 카테고리의 다른 글

LOGBack Configurator with JMX  (0) 2014.07.20
현지어로 언어명 보여주기  (0) 2014.02.09
2014년 도로명 주소 사용에 따른 우편번호 준비  (2) 2013.12.22
JSTL Custom Tag using Spring Beans  (0) 2013.12.01
Spring Message Source from Database  (1) 2013.03.03
Infinite Routing DataSource  (1) 2013.01.13
Mybatis Type Handler  (1) 2012.09.30
Using AUTO_INCREMENT keys  (0) 2011.03.01

댓글 (Comment)

Name*

Password*

Link (Your Website)

Comment

SECRET | 비밀글로 남기기

Intorduction


일반적으로 스프링과 com.fasterxml.jackson를 사용하여 컨트롤러 메소드에서 @ResponseBody 어노테이션을 이용하면 알아서 객체가 JSON 으로 변환되어 나가게 된다.


	@RequestMapping(value = "/file/list", method = RequestMethod.GET)
	@ResponseBody
	public ModelMap list() {
		ModelMap mm = new ModelMap();
		
		List<File> list = fileService.list();
		mm.put("list", list);
		
		return mm;
	}

만약 변환해야 하는 객체가 아래와 같이 순환 참조[각주:1]되는 객체일 경우 JSON 으로 변환을 하다가 에러가 나게 된다.



아래 소스 코드와 같이 간단하게 돌려보면 아래와 같은 에러를 볼 수 있다.


import com.fasterxml.jackson.databind.ObjectMapper;

public class JacksonTest {

	public static void main(String[] args) throws Exception {
		A a = new A();

		for (int i = 0; i < 10; i++) {
			B b = new B();
			b.setA(a);
			a.addB(b);
		}

		ObjectMapper om = new ObjectMapper();
		String json = om.writeValueAsString(a);

		System.out.println(json);
	}

}



A 객체의 bs 속성(List)을 보고 B 객체의 A 객체를 보고 다시 A 객체의 bs 속성을 보고 무한으로 반복 된다.


그러다가 최종적으로 java.lang.StackOverflowError 가 떨어지게 된다.




Solution


순환 참조를 하지 말아야 하는 속성에 @JsonBackReference 어노테이션을 달아주자.


import com.fasterxml.jackson.annotation.JsonBackReference;

public class B {

	private String name = "B";
	// 이거
	@JsonBackReference
	private A a;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public A getA() {
		return a;
	}

	public void setA(A a) {
		this.a = a;
	}

}


다시 테스트 해보면 아래와 같이 B 의 a 속성을 출력하지 않게 된다.


{
  "a": "A",
  "bs": [
    {
      "name": "B"
      // as 속성이 빠지게 된다.
      // , "as": []
    },
    {
      "name": "B"
    },
    {
      "name": "B"
    },
    {
      "name": "B"
    },
    {
      "name": "B"
    },
    {
      "name": "B"
    },
    {
      "name": "B"
    },
    {
      "name": "B"
    },
    {
      "name": "B"
    },
    {
      "name": "B"
    }
  ]
}


  1. 순환 참조(Circular reference)란, 참조하는 대상이 서로 물려 있어서 참조할 수 없게 되는 현상을 말한다. [본문으로]

댓글 (Comment)

Name*

Password*

Link (Your Website)

Comment

SECRET | 비밀글로 남기기

Intorduction


http://www.juso.go.kr


- 도로명 주소는 2014년부터 생활(법정)주소로 전면 사용됩니다.

- 도로명주소를 사용하지 않으면 은행, 카드, 보험 등 거래처의 우편물 수신에 불편함이 있을 수 있습니다.


이렇게 나와있다... Y2K[각주:1] 처럼 버그도 아니고, 그냥 체계가 바뀌는 거지만... 미리 준비하자. -_-/




데이터 입력


http://www.juso.go.kr


정보제공 게시판 쪽에 가보면 현재 11월 기준의 도로명 주소 데이터가 올라와 있다. 매월 말에 데이터가 갱신 되는듯 하다... ㅅㅂ



4개의 게시글 첨부파일을 다 다운로드 받은 후 txt 파일이 나올때까지 전부 압축을 해제하자.


 

도로명주소정보제공내용변경계획.hwp


파일을 보면 알겠지면 4개의 테이블 구조로 되어있다. 이것을 대충 ERD로 짜보면 아래와 같다. 네이밍 ㅅㅂ -_-/


road.txp



이제 텍스트 파일에서 테이블로 데이터를 넣어야 한다.


근데 이게 많은 양의 데이터라서 툴을 이용해서 넣기 번거로으므로 Java 로 만들어서 넣었다 -_-;; (템플릿 메소드 패턴 이용!)


 레이아웃

 건수

 설명

 도로명코드 (tbl_road)

356.792 

 시도 시군구 읍면동 도로명

 주소 (tbl_road_addr)

5,976,050 

 도로명코드 x 건물본번-건물부번

 지번 (tbl_addr_jibun)

7,943,977 

 주소에 해당하는 지번(옛날) 주소 (주소에 해당하는 지번 주소는 n 건)

 부가정보 (tbl_addr_info)

5,976,050 

 주소에 해당하는 부가정보 (우편번호가 여기에 있다)


zipcode.reader.zip


↑ 메이븐 프로젝트이다.




데이터 조회


안전행정부에서 도로명 주소를 검색해 가면서 분석한 결과 아래와 같은 공식(?)이 나왔다. 


 구분

 공식

 도로명 주소

 #도로명코드.시도명# [#도로명코드.시군구명#] #도로명코드.도로명# [#주소.지하여부#=="1"?"지하"]

 #주소.건물번호본번#[-#주소.건물번호부번#!="0"?#주소.건물번호부번#]

 [(#도로명코드.읍면동명#[, #부가정보.공동주택여부#=="1"?#부가정보.시군구건물명#])]

 도로명 주소 영문

 [#주소.지하여부#=="1"?"Jiha, "] #주소.건물번호본번#[-#주소.건물번호부번]

 [, #도로명코드.읍면동명영문#] [, #도로명코드.시군구명영문#], #도로명코드.시도명영문#

 지번 주소 (~2013 주소)

 #지번.시도명# #지번.시군구명# [#지번.법정읍면동명#] [#지번.법정동명#] [#지번.법정리명#]

 [#지번.산여부#=="1"?"산"] [#지번.지번본번#[-#지번.지번부번#]] [#부가정보.시군구건물명#]


음.. 어렵다.. -_-... 위 3개의 경우를 쿼리(오라클)로 뽑아보면 아래와 같다. 쿼리로 보는게 더 편할지도? ㅋㅋ


select /* 우편번호 */ t3.zipcode as zipcode /* 도로명 주소 */ , t1.sido_name || case when t1.sigun_name is not null then ' ' || t1.sigun_name end || ' ' || t1.road_name || decode(t2.base_yn, '1', ' ' || '지하') || ' ' || t2.bldg_no1 || case when t2.bldg_no2 != 0 then '-' || t2.bldg_no2 end || ' (' || t1.eup_name || case when t3.apt_yn = '1' and t3.sigun_bldg_name is not null then ', ' || t3.sigun_bldg_name end || ')' as address /* 도로명 주소 영문 */ , decode(t2.base_yn, '1', 'Jiha' || ' ') || t2.bldg_no1 || case when t2.bldg_no2 != 0 then '-' || t2.bldg_no2 end || ', ' || t1.road_name_eng || case when t1.sigun_name_eng is not null then ', ' || t1.sigun_name_eng end || ', ' || t1.sido_name_eng as address_eng /* 지번 주소 (~2013 주소) */ , t4.sido_name || case when nvl(t4.gugun_name, t1.sigun_name) is not null then ' ' || nvl(t4.gugun_name, t1.sigun_name) end || case when nvl(t4.eup_name, t1.eup_name) is not null then ' ' || nvl(t4.eup_name, t1.eup_name) end || case when t4.ri_name is not null then ' ' || t4.ri_name end || decode(t4.san_yn, '1', '산') || ' ' || t4.ji_no1 || case when t4.ji_no2 != 0 then '-' || t4.ji_no2 end || case when t3.sigun_bldg_name is not null then ' ' || t3.sigun_bldg_name end as address_jibun

/* 관리번호(PK) */ , t2.num from tbl_road t1 join tbl_road_addr t2 on t1.road_code = t2.road_code and t1.eup_seq = t2.eup_seq join tbl_road_info t3 on t2.num = t3.num join tbl_road_jibun t4 on t2.num = t4.num where t1.using_yn = '0' and t4.dele_yn = '1' and to_char(sysdate, 'YYYYMMDD') between nvl(t1.noti_date, '11110101') and nvl(t1.cancel_date, '99991231') and to_char(sysdate, 'YYYYMMDD') >= nvl(t2.noti_date, '11110101') ;


뭐 보면 대충 이렇게 나온다.





데이터 가공


데이터의 양이 너무 많다. 4개의 테이블만 덤프를 떠도 1.8GB 정도 한다.


내가 이 도로명주소 데이터를 뽑는 이유는 우편번호를 사용하기 위함이기 때문에 필요없는거 다 날리고 다른 테이블에 다시 넣어보자.


아래 ERD 는 도로명 주소를 표현할 수 있는 최소한의 데이터만 사용했을 때의 테이블이다.


zipcode_road.txp



아래는 insert select 문이다.


insert into zipcode_road (
	zipcode
    , road
    , sido
    , sigun
    , eup
    , under_yn
    , bldg_no1
    , bldg_no2
    , bldg
    , num
    , apply_date
)
select
	t3.zipcode
    , t1.road_name
	, t1.sido_name
    , t1.sigun_name
    , t1.eup_name
	, decode(t2.base_yn, '1', 'Y', 'N') as under_yn
    , t2.bldg_no1
    , decode(t2.bldg_no2, 0, null, t2.bldg_no2) as bldg_no2
    , case when t3.apt_yn = '1' and t3.sigun_bldg_name is not null then t3.sigun_bldg_name end as bldg
    , t2.num
    , to_char(sysdate, 'YYYYMMDD') as apply_date
from
	tbl_road t1
join
	tbl_road_addr t2
on
	t1.road_code = t2.road_code
    and t1.eup_seq = t2.eup_seq
join
	tbl_road_info t3
on
	t2.num = t3.num
where
	t1.using_yn = '0'
	and to_char(sysdate, 'YYYYMMDD') between nvl(t1.noti_date, '11110101') and nvl(t1.cancel_date, '99991231')
	and to_char(sysdate, 'YYYYMMDD') >= nvl(t2.noti_date, '11110101')
;


이렇게 넣으니 데이터는 5,975,824건에 650MB 정도 된다. 이래도 많다... 예전 우편번호는 5만건 정도밖에 안되는데 ㅜㅜ




Web Application


이 데이터를 기반으로 조회하는걸 한번 만들어 봤다.


http://antop.nerv.kr/zipcode


zipcode.war


zipcode.zip


↑ 메이븐 프로젝트


  1. 컴퓨터 프로그램 내에의 연도 표기 중에서 두 자리 숫자인 세기(century)를 생략한 연도 표현으로 인해 2000년에 컴퓨터 운영 체제 및 각종 업무용 응용 프로그램 등에서 2000년을 1900년과 동일하게 「00」년으로 인식함으로써 발생될 수 있는 각종 문제를 말한다. 또한 밀레니엄 버그를 Y2K 문제라고도 하는데, Y는 연도(year)의 첫 글자를 딴 것이고, K는 1000(kilo)에서 딴 것으로 2000년을 의미한다. [본문으로]

'Java+ > Example' 카테고리의 다른 글

LOGBack Configurator with JMX  (0) 2014.07.20
현지어로 언어명 보여주기  (0) 2014.02.09
2014년 도로명 주소 사용에 따른 우편번호 준비  (2) 2013.12.22
JSTL Custom Tag using Spring Beans  (0) 2013.12.01
Spring Message Source from Database  (1) 2013.03.03
Infinite Routing DataSource  (1) 2013.01.13
Mybatis Type Handler  (1) 2012.09.30
Using AUTO_INCREMENT keys  (0) 2011.03.01
  1. hona
    매우 감사... 유용하게 사용할께요....
  2. 좋은 정보 감사합니다!!

댓글 (Comment)

Name*

Password*

Link (Your Website)

Comment

SECRET | 비밀글로 남기기

JSTL Custom Tag using Spring Beans

Posted at 2013.12.01 17:37 | Posted in Java+/Example

Introduction


JSTL[각주:1] 태그를 만들어 사용할 때에 스프링 빈을 가져다 쓰는 방법이다.




Using Spring Beans


너무나도 간단하다. 


일반적으로 TagSupport 클래스를 상속 받아서 구현 하면 되는데, 스프링 빈을 사용하고 싶으면 RequestContextAwareTag 클래스를 상속 받아서 구현하면 된다.



사용법은 아래와 같다.


import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.tags.RequestContextAwareTag;

public class XXXTag extends RequestContextAwareTag {

	@Override
	protected int doStartTagInternal() throws Exception {
		// WebApplicationContext 를 얻는다.
		WebApplicationContext ctx = getRequestContext().getWebApplicationContext();
		// 빈을 가져와서 처리
		return SKIP_BODY;
	}

}




Example Source


WAR 파일 (소스 포함)


webapp.war


프로젝트 파일 (메이븐 구조)


webapp.zip




  1. 자바 서버 페이지 표준 태그 라이브러리(JavaServer Pages Standard Tag Library, 약칭 JSTL)은 Java EE 기반의 웹 애플리케이션 개발 플랫폼을 위한 컴포넌트 모음이다. [본문으로]

'Java+ > Example' 카테고리의 다른 글

LOGBack Configurator with JMX  (0) 2014.07.20
현지어로 언어명 보여주기  (0) 2014.02.09
2014년 도로명 주소 사용에 따른 우편번호 준비  (2) 2013.12.22
JSTL Custom Tag using Spring Beans  (0) 2013.12.01
Spring Message Source from Database  (1) 2013.03.03
Infinite Routing DataSource  (1) 2013.01.13
Mybatis Type Handler  (1) 2012.09.30
Using AUTO_INCREMENT keys  (0) 2011.03.01
tag: JSP, JSTL, Spring

댓글 (Comment)

Name*

Password*

Link (Your Website)

Comment

SECRET | 비밀글로 남기기

아래와 같은 jsp 소스가 있습니다.


<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>taglib</title>
</head>
<body>

</body>
</html>


네... 스프링 커스텀 태그를 사용하려고 합니다.


이 페이지를 불르면 톰켓 7에서는 아래와 같은 로그가 출력되고 정상적으로 작동됩니다. (다른 WAS는 모르겠슴 -_-/)


정보: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.


뭐... 알아서 TLD 파일 찾았다는 거죠 ㄷㄷ;;;


하지만 웹로직 환경에서 페이지를 불르면 에러가 나게 됩니다.


index.jsp:2:5: No tag library could be found with this URI. Possible causes could be that the URI is incorrect, or that there were errors during parsing of the .tld file. 


<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

        ^----^


이런 경우 tld 파일을 추출해서 적당한 곳에 넣은 후 web.xml 에 등록을 해줘야 합니다.


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	id="taglib" version="2.5">

	<welcome-file-list>
		<welcome-file>index.jsp</welcome-file>
	</welcome-file-list>

	<!-- 여기 -->
	<jsp-config>
		<taglib>
			<taglib-uri>http://www.springframework.org/tags/form</taglib-uri>
			<taglib-location>/WEB-INF/tlds/spring-form.tld</taglib-location>
		</taglib>
	</jsp-config>

</web-app>


꼭 웹로직 환경이 아니라도  tld 를 찾지 못한다고 하면 web.xml 에 위와 같이 추가해 주면 됩니다.


<taglib-location> 값에 jar 안의 경로를 직접 지정해줄 수 있으면 더 깔끔할텐데....


댓글 (Comment)

Name*

Password*

Link (Your Website)

Comment

SECRET | 비밀글로 남기기

web.xml 서블릿 버전별 DTD

Posted at 2013.03.03 21:53 | Posted in Java+

이클립스에서 메이블 프로젝트로 를 생성하면 web.xml 이 서블릿 2.3 버전으로 정의가 되더군요...


서블릿 2.5 버전으로 바꿔서 사용 했었는데 이참에 DTD[각주:1] 선언 정리합니다




Servlet 2.2


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>

</web-app>



Servlet 2.3


servlet-2_3-fcs-spec.pdf


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>

</web-app>



Servlet 2.4


DTD 에서 스키마로 바뀌었습니다.


servlet-2_4-fr-spec.pdf


<?xml version="1.0" encoding="UTF-8"?>
<web-app id="servlet-2_4" version="2.4"
	xmlns="http://java.sun.com/xml/ns/j2ee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

</web-app>



Servlet 2.5


servlet-2_5-mrel2-spec.pdf

 

web.xml.pdf

 

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="servlet-2_5" version="2.5"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

</web-app>


Servlet 3.0


servlet-3_0-final-spec.pdf


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
	version="3.0">

</web-app>


Servlet 3.1


<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
	version="3.1">

</web-app>


  1. Document Type Definition [본문으로]

'Java+' 카테고리의 다른 글

Find class in jar files  (0) 2018.02.19
web.xml 서블릿 버전별 DTD  (1) 2013.03.03
Maven Repository for Oracle Library  (0) 2012.12.18
<jsp:forward page="url" /><jsp:include /> <%@ include %>  (0) 2010.04.25
TortoiseSVN 사용하기  (2) 2009.11.16
썸네일(Thumbnail) 만들기  (1) 2009.08.09
Java2Html  (0) 2009.07.19
Jad + JadClipse  (6) 2009.07.11
Java with SQLite  (1) 2009.06.29
Java Database Connectivity  (0) 2009.02.25
  1. 감사합니다! 퍼갈게요~

댓글 (Comment)

Name*

Password*

Link (Your Website)

Comment

SECRET | 비밀글로 남기기