Spring + @Lazy

Posted at 2019.08.05 00:46 | Posted in Framework/Spring

https://github.com/antop-dev/spring-lazy

요즘 MSA를 공부하면서 아래와 같은 문구를 보았다.

마이크로서비스에서는 완전 자동화를 달성하기 위해 초소한의 시동/종료 시간을 갖도록 애플리케이션의 크기를 가능한 한 작게 유지하는 것이 극단적으로 아주 중요하다.
이를 위해 마이크로서비스에서는 객체와 데이터의 지연 로딩lazy loading에 대해서도 고려해봐야 한다.

이 때 떠오른 단어는 Spring@Lazy이다.

스프링 빈 설정시 @Lazy 애노테이션만 달아주면 이 빈을 가져오는 시점에 생성하기 때문에 모든 빈을 처음 초기화시에 만들지 않는다.

그런데 약간의 의문사항이 있어서 테스트 해봤다... 구글링을 대충 해도 나오는 자료이지만 직접 해봤다.

등장 클래스

아래와 같이 3개의 클래스를 빈으로 등록했다. 패턴은 다 같고 First, Second, Third 만 바뀐다.

@Component
public class First {
    @Autowired
    private Second second;

    public First() {
        System.out.println("first class constructor");
    }

    public void go() {
        System.out.println("Hello first!");
        second.go();
    }
}

테스트 코드는 아래와 같다.

public class LazyApplicationTests {
    @Test
    public void lazy() {
        ApplicationContext context = new AnnotationConfigApplicationContext(LazyApplication.class);
        System.out.println("call first.go()");
        First first = context.getBean(First.class);
        first.go();
    }
}

일반적인 빈 설정

먼저 위와 같이 @Lazy를 사용하지 않는 일반 적인 설정이다. 후에 스프링 컨텍스트에서 First 인스턴스를 꺼내서 go() 메서드를 수행할 것이다.

예상한 대로 빈이 전부 생성 된 후(①) FIrst.go() 이후의 작업이 수행된다(②).

first class constructor
second class constructor
third class constructor
Spring context loaded call
first.go()
Hello first!
Hello second
Hello third!

하지만 좀 이상한 점이 있는데 예상은 ThridSecondFirst 순으로 생성될 줄 알았지만 반대로 생성된다. 생성자를 사용하지 않고 @Autowired나 세터setter를 사용하면 스프링이 이 클래스를 까서(?) 적용을 하게 된다.

@Autowired를 사용하지 않고 생성자constructor를 사용하면 예상한 순서대로 빈이 만들어진다.

@Component
public class First {
    private final Second second;

    public First(Second second) {
        this.second = second;
        System.out.println("first class constructor");
    }

    public void go() {
        System.out.println("Hello first!");
        second.go();
    }
}
third class constructor second class constructor first class constructor Spring context loaded call first.go() Hello first! Hello second Hello third!

@Lazy 적용

</p||_##]

First, Second, Thrid 클래스에 @Lazy를 적용해보자.

예상한대로 스프링 초기화시에는 빈을 생성하지 않고 있다가 First 인스턴스를 처음 가져올 때 생성하게 된다.

Spring context loaded
call first.go()
third class constructor
second class constructor
first class constructor
Hello first!
Hello second
Hello third!

@Lazy 사용시 주의사항

위와 같이 First 빈을 @Lazy로 하지 않을 경우 뒤에 참조하게 되는 모든 클래스의 @Lazy이 무용지물된다.

가장 처음 했던 @Lazy를 적용 하지 않은 설정과 같은 결과다.

third class constructor
second class constructor
first class constructor
Spring context loaded
call first.go()
Hello first!
Hello second
Hello third!

아래와 같다면?

Thrid, Second, Fourth 는 스프링 초기화시 생성되고 First는 지연 로딩이 적용된다.

third class constructor
second class constructor
fourth class constructor
Spring context loaded
call first.go()
first class constructor
Hello first!
Hello second
Hello third!

동시성 concurrency

First 빈이 생성 되는데 3초가 걸린다고 가정해보자.

@Component
@Lazy
public class First {
    private final Second second;

    public First(Second second) {
        this.second = second;
        // 인스턴스를 생성하는데 3초가 걸린다.
        System.out.println("It takes 3 seconds to create an instance");
        try {
            for (int i = 0; i < 3; i++) {
                System.out.println((3 - i) + "..");
                Thread.sleep(1000);
            }
        } catch (InterruptedException e) {
            System.out.println(e.getMessage());
        }
        System.out.println("first class constructor");
    }

    public void go() {
        System.out.println("Hello first!");
        second.go();
    }
}

First 인스턴스를 사용하는 다른 인스턴스에서 동시에(거의 동시에?) 요청이 들어온다면?

테스트 코드는 아래와 같다.

@Test
    public void concurrency() throws Exception {
        ApplicationContext context = new AnnotationConfigApplicationContext(LazyApplication.class);
        System.out.println("Spring context loaded");

        for (int i = 0; i < 3; i++) {
            Thread thread = new Thread(() -> {
                System.out.println("call first.go()");
                First first = context.getBean(First.class);
                first.go();
            });

            thread.start();
            System.out.println(thread.getName() + " started.");
            Thread.sleep(100);
        }

        // 결과를 보기 위해 5초 대기
        Thread.sleep(5000);
    }

걱정과는 다르게 매우 잘 작동한다! 스프링 구욷!

third class constructor
second class constructor
fourth class constructor
Spring context loaded
Thread-2 started.
Thread-2 call first.go()
It takes 3 seconds to create an instance
3..
Thread-3 started.
Thread-3 call first.go()
Thread-4 started.
Thread-4 call first.go()
2..
1..
first class constructor
Thread-2 Hello first!
Thread-4 Hello first!
Thread-2 Hello second
Thread-4 Hello second
Thread-4 Hello third!
Thread-3 Hello first!
Thread-3 Hello second
Thread-3 Hello third!
Thread-2 Hello third!

'Framework > Spring' 카테고리의 다른 글

Spring + @Lazy  (0) 2019.08.05
Twelve Best Practices For Spring XML Configurations  (0) 2010.06.23

댓글 (Comment)

Name*

Password*

Link (Your Website)

Comment

SECRET | 비밀글로 남기기

[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 | 비밀글로 남기기

Installation Vue.js (Eclipse)

Posted at 2018.05.24 21:32 | Posted in Study/Vue.js

Introduction


Eclipse 에서 Vue.js 개발 환경을 구축해보자.




Preparation


이클립스는 JavaScript and Web Developers 패키지로 받았다.




npm을 어디서든사용할 수 있도록 nodejs를 받아서 Path 환경 변수에 등록하자.





Install CodeMix Plugin


Eclipse Marketplace(Help - Eclipse Marketplace...)에서 vue를 검색하면 플러그인이 나온다. (하나만 있는듯? -_-)


With CodeMix, unlock a wide array of technologies from Visual Studio Code and add-on extensions built for Code OSS directly inside your Eclipse IDE.


- First class JavaScript coding & debugging

- Vastly improved HTML and CSS editing

- New languages including TypeScript, PHP and Python

- New frameworks from React and Vue.js to Angular

- New UX patterns like the Quick Open shortcuts

- As-you-type content assist




라이선스.. 네네...




설치 후 재시작 해준다.




재시작 하면 CodeMix 에 대한 설명+설정이 나온다.







Create Vue project


File - New - Project




프로젝트 이름 입력 후 Finish




아래와 같은 구조로 프로젝트가 만들어진다.




프로젝트에서 마우스 오른쪽 버튼 - Run As - npm Install 클릭.




프로젝트에 필요한 모듈들을 설치하게 된다.


Microsoft Windows [Version 10.0.16299.309]
(c) 2017 Microsoft Corporation. All rights reserved.

D:\dev\workspace\vue.js>npm install

> node-sass@4.9.0 install D:\dev\workspace\vue.js\node_modules\node-sass
> node scripts/install.js

Cached binary found at C:\Users\Antop\AppData\Roaming\npm-cache\node-sass\4.9.0\win32-x64-57_binding.node

> uglifyjs-webpack-plugin@0.4.6 postinstall D:\dev\workspace\vue.js\node_modules\uglifyjs-webpack-plugin
> node lib/post_install.js


> node-sass@4.9.0 postinstall D:\dev\workspace\vue.js\node_modules\node-sass
> node scripts/build.js

Binary found at D:\dev\workspace\vue.js\node_modules\node-sass\vendor\win32-x64-57\binding.node
Testing binary
Binary is fine
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 891 packages in 151.496s

D:\dev\workspace\vue.js>exit


node_modules 라는 디렉터리가 생성되고 하위에 필요한 모듈들이 들어있다. (이 디렉터리는 VCS에 포함시키지 말자!)




package.json - dev 에서 마우스 오른쪽 버튼. Run As - npm Script




아래와 같이 Console이 나오게 된다.


Microsoft Windows [Version 10.0.16299.309]
(c) 2017 Microsoft Corporation. All rights reserved.

D:\dev\workspace\vue.js>npm run-script dev

> vue-hello-world@1.0.0 dev D:\dev\workspace\vue.js
> cross-env NODE_ENV=development webpack-dev-server --open --hot

Project is running at http://localhost:8080/
webpack output is served from /dist/
404s will fallback to /index.html



브라우저가 자동으로 실행되고 아래와 같이 나온다면 성공!



'Study > Vue.js' 카테고리의 다른 글

Installation Vue.js (Eclipse)  (0) 2018.05.24
Installation Vue.js (WebStorm + Vue CLI)  (0) 2018.05.21

댓글 (Comment)

Name*

Password*

Link (Your Website)

Comment

SECRET | 비밀글로 남기기

Installation Vue.js (WebStorm + Vue CLI)

Posted at 2018.05.21 13:22 | Posted in Study/Vue.js

Introduction


WebStorm + Vue CLI를 이용해서 Vue.js 개발 환경을 구축해보자.


Vue.js는 단일 페이지 응용 프로그램을 빠르게 스캐폴딩하기 위한 공식 CLI를 제공합니다. 현대적인 프론트엔드 워크플로우를 위해 잘 구성된 빌드 설정을 제공합니다. 핫 리로드, lint-on-save 및 프로덕션 준비가 된 빌드로 시작하고 실행하는데 몇 분 밖에 걸리지 않습니다.


처음 CLI 를 접하기 전에 사전 지식을 필요로 하니 당장 Vue.js 만 공부하려면 순수 HTML, CSS, Javascript 로 구성해서 학습하는 것도 괜찮을 것 같다. (난 사전 지식 없는데 왜 이걸로 하고 있지... ㅠㅠ)


CLI는 Node.js 및 관련 빌드 도구에 대한 사전 지식을 필요로 합니다. Vue 또는 프런트엔드 빌드 도구를 처음 사용하는 경우 CLI를 사용하기 전에 빌드 도구없이 가이드를 읽어 보시기 바랍니다.




Preparation


Node.js가 필요하다. 다운로드 받은 후 환경변수 PATH 등록 해두자.



vue-cli 를 설치한다.


D:\>npm install --global vue-cli
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
D:\develoment\tools\node-v8.11.2-win-x64\vue-list -> D:\develoment\tools\node-v8.11.2-win-x64\node_modules\vue-cli\bin\vue-list
D:\develoment\tools\node-v8.11.2-win-x64\vue -> D:\develoment\tools\node-v8.11.2-win-x64\node_modules\vue-cli\bin\vue
D:\develoment\tools\node-v8.11.2-win-x64\vue-init -> D:\develoment\tools\node-v8.11.2-win-x64\node_modules\vue-cli\bin\vue-init
+ vue-cli@2.9.3
added 258 packages in 27.115s




Create Vue.js Project


WebStorm 실행 후 프로젝트를 새로 생성한다.




Location: 프로젝트의 디렉터리

Node interpreter : node.exe 파일의 위치

vue-cli or @vue/cli: vue-cli 모듈의 위치. 위에서 vue-cli 를 설치 했으면 자동으로 인식 된다.

Project template: 만들어질 프로젝트 기본 템플릿 6가지

  • browserify : hot-reload, linting 및 단위 테스팅 등 대부분의 기능을 갖춘 Browserify + vueify 설정.
  • browserify-simple : 단순히 Browserify와 vueify만 포함. 빠르게 프로토타입을 만들 때 사용한다.
  • pwa : ot-reload, linting, 테스트 및 CSS 추출 기능을 갖춘 대부분의 기능을 갖추고 있는 Webpack + PWA 템플릿.
  • simple : 가장 단순하게 한 HTML 파일에 Vue 설정을 담고 있다.
  • webpack : hot-reload, linting, 테스트 및 CSS 추출 기능을 갖춘 대부분의 기능을 갖추고 있는 Webpack + vue-loader 설정.
  • webpack-simple : 단순히 Webpack과 vue-loader만 포함한다. 빠르게 프로토타입을 만들 때 사용한다.




프로젝트 이름...




프로젝트 설명...




작성자 이름...




Vue build

  • Runtime + Compiler : 일반 적인 대부분 사용자에게 권한다.
  • Runtime-only : 약 6KB 안되는 용량. 하지만 템플릿(.vue)만 사용할 수 있다.

개발 중에는 최소화 버전을 사용하지 마십시오. 일반적인 실수에 대한 모든 훌륭한 경고를 놓치게됩니다!


현재는 개발(공부) 용도이기 때문에 Runtime + Compiler 선택...




해시(#) URL이나 HTML5 History 등을 이용하여 SPA에서 페이지 네비게이션 기능을 vue.js에서 사용하고 싶을 때 쓰는 vue-router 모듈을 설치할 것인지 여부이다.




자바스크립트 코딩 스타일과 에러를 체크하는 ESLint를 사용할 지 여부.




ESLint 를 사용한다면 어떤 코딩 스타일 세팅(preset)을 사용할지 선택하는 단계이다.




단위 테스트를 사용할 지 여부.




어떤 테스트기(test runner)를 사용할 지 선택한다.




Nightwatch를 이용하여 e2e(End-to-End) 테스트를 할 수 있도록 설정할 것인지 여부.




프로젝트가 생성된 후에 NPM 을 사용할 것인지 물어본다...




이제 프로젝트가 만들어졌다.


IDE 우측 하단의 알람을 보면 종속 모듈을 설치해야 한다고 한다. Run 'npm install' 을 클릭 하거나 Terminal 에서 직접 커맨드를 입력해서 설치하면 된다.



Terminal 에서 직접 npm install 했을 때 내용은 대충... 아래와 같다.


>npm install
npm WARN deprecated socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
npm WARN notice [SECURITY] mime has 1 moderate vulnerability. Go here for more details: https://nodesecurity.io/advisories?search=mime&version=1.3.6 - Run `npm i npm@latest -g` to upgrade your npm version, and then `
npm audit` to get more info.
npm WARN notice [SECURITY] https-proxy-agent has 1 high vulnerability. Go here for more details: https://nodesecurity.io/advisories?search=https-proxy-agent&version=1.0.0 - Run `npm i npm@latest -g` to upgrade your n
pm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] http-proxy-agent has 1 high vulnerability. Go here for more details: https://nodesecurity.io/advisories?search=http-proxy-agent&version=1.0.0 - Run `npm i npm@latest -g` to upgrade your npm
 version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] debug has 1 low vulnerability. Go here for more details: https://nodesecurity.io/advisories?search=debug&version=2.2.0 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm
 audit` to get more info.
npm WARN notice [SECURITY] macaddress has 1 critical vulnerability. Go here for more details: https://nodesecurity.io/advisories?search=macaddress&version=0.2.8 - Run `npm i npm@latest -g` to upgrade your npm version
, and then `npm audit` to get more info.
npm WARN notice [SECURITY] growl has 1 critical vulnerability. Go here for more details: https://nodesecurity.io/advisories?search=growl&version=1.9.2 - Run `npm i npm@latest -g` to upgrade your npm version, and then
 `npm audit` to get more info.

> chromedriver@2.38.3 install D:\dev\projects\vue\node_modules\chromedriver
> node install.js

Downloading https://chromedriver.storage.googleapis.com/2.38/chromedriver_win32.zip
Saving to C:\Users\Antop\AppData\Local\Temp\chromedriver\chromedriver_win32.zip
Received 781K...
Received 1568K...
Received 2352K...
Received 3136K...
Received 3299K total.
Extracting zip contents
Copying to target path D:\dev\projects\vue\node_modules\chromedriver\lib\chromedriver
Done. ChromeDriver binary available at D:\dev\projects\vue\node_modules\chromedriver\lib\chromedriver\chromedriver.exe

> uglifyjs-webpack-plugin@0.4.6 postinstall D:\dev\projects\vue\node_modules\webpack\node_modules\uglifyjs-webpack-plugin
> node lib/post_install.js

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 1555 packages in 321.2s




Run Server


Terminal 에서 npm run dev 명령어 입력.


D:\develoment\projects\vue.js>npm run dev

> vue.js@1.0.0 dev D:\develoment\projects\vue.js
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

 90% chunk assets processing


% 진행 되다가 아래와 같이 나오면 성공!


 DONE  Compiled successfully in 15419ms                                                                                                                                                                            12:50:43

 I  Your application is running here: https://localhost:8080


브라우저로 접속 시 화면이 나온다면 성공!





Reference


https://kr.vuejs.org/v2/guide/installation.html

https://www.jetbrains.com/help/webstorm/vue-js.html

https://github.com/vuejs-kr/vue-cli

'Study > Vue.js' 카테고리의 다른 글

Installation Vue.js (Eclipse)  (0) 2018.05.24
Installation Vue.js (WebStorm + Vue CLI)  (0) 2018.05.21
tag: Vue.js

댓글 (Comment)

Name*

Password*

Link (Your Website)

Comment

SECRET | 비밀글로 남기기

Install VMware Tools in CentOS 7

Posted at 2018.03.25 09:28 | Posted in Server/VMware ESXi
yum install -y perl
yum install -y open-vm-tools
mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
tar xzvf /mnt/cdrom/VMwareTools-9.4.10-2092844.tar.gz -C /tmp
/tmp/vmware-tools-distrib/vmware-install.pl -d


http://partnerweb.vmware.com/GOSIG/CentOS_7.html

'Server > VMware ESXi' 카테고리의 다른 글

Install VMware Tools in CentOS 7  (0) 2018.03.25
Install VMware Tools in CentOS  (0) 2016.06.05
UEFI BIOS using USB Boot  (0) 2014.11.04
Install Driver for VMware ESXi Installer  (0) 2014.11.04
Install VMware Tools in Ubuntu  (0) 2014.11.03
Create a VMware ESXi Bootable Flash Drive (USB)  (0) 2014.11.02
tag: VMware, VSphere

댓글 (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 | 비밀글로 남기기

Disable automatic updates kernel on Ubuntu

Posted at 2017.12.20 11:40 | Posted in Server/Ubuntu

우분투 설치 후 가만히 냅두면 자동으로 커널이 업그레이드 된다.


우분투 SSH 로그인 했을 때 아래와 같이 재부팅 하라는 메세지가 나오면 커널이 업그레이드 되었을 확률이 있다.


Using username "root".
root@192.168.20.13's password:
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-45-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

78 packages can be updated.
0 updates are security updates.


*** System restart required ***
Last login: ..... from .....
# _


문제는 이것이 계속 업그레이드 되먼서 이전 커널 파일이 /boot 에 쌓인다.


계속 쌓이다가 /boot 가 100%가 되어버리면 문제가 된다.


주기적으로 관리를 해줘야 하지만 그것도 싫다고 하면... 커널 자동 업그레이드를 비활성화 하자.


# apt-mark hold linux-image-generic linux-headers-generic
linux-image-generic set on hold.
linux-headers-generic set on hold.


출처: https://askubuntu.com/questions/678630/how-can-i-avoid-kernel-updates

'Server > Ubuntu' 카테고리의 다른 글

Disable automatic updates kernel on Ubuntu  (1) 2017.12.20
Installation Redmine on Ubuntu  (0) 2014.03.26
Installation Maven 3 on Ubuntu  (0) 2014.03.25
Using Xmanager to Ubuntu 10.10  (0) 2011.04.13
Subversion  (0) 2010.08.16
Openfire  (0) 2010.05.25
Webmin  (0) 2009.11.18
Squirrelmail  (0) 2009.11.12
SparkWeb  (0) 2009.11.12
Cacti  (0) 2009.11.12
Apache + SSL  (0) 2009.11.12
tag: apt, Kernel, ubuntu

댓글 (Comment)

Name*

Password*

Link (Your Website)

Comment

SECRET | 비밀글로 남기기

https://github.com/antop-dev/example/tree/master/mybatis-rowbounds-example


Mybatis에 RowBounds 클래스를 이용해서 페이징 처리를 할 수 있다.

package org.antop.mybatis.mapper;

import org.antop.mybatis.model.Employee;
import org.apache.ibatis.session.RowBounds;

import java.util.List;

public interface EmployeeMapper {
	List<Employee> select(RowBounds rowBounds);
}

<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.antop.mybatis.mapper.EmployeeMapper">
    <resultMap id="BaseResultMap" type="org.antop.mybatis.model.Employee">
        <id property="no" column="emp_no" />
        <result property="gender" column="gender" typeHandler="org.antop.mybatis.handler.GenderTypeHandler" />
        <association property="name" javaType="org.antop.mybatis.model.Name">
            <result property="first" column="first_name" />
            <result property="last" column="last_name" />
        </association>
    </resultMap>

    <select id="select" resultMap="BaseResultMap">
        select
          *
        from
          employees
        order by
          emp_no asc
    </select>
</mapper>

위와 같이 맵퍼와 XML 이 있다.

RowBounds rowBounds = new RowBounds(5, 10);
// 15건을 가져와서 앞에 5건 건너띔
List select = mapper.select(rowBounds);

결과는 10건이 나왔지만 어떻게 동작할까?

여기저기 찾아보고 소스도 대충(?) 보면 offset + limit 만큼 가져와서 offset 만큼 건너띤다.

페이징이 뒤로 갈 수록 느려지게 된다.

RowBounds rowBounds = new RowBounds(29990, 10);
// 30000건을 가져와서 앞에 29990건 건너띔
List select = mapper.select(rowBounds);

데이터의 양이 적다면 쿼리에서 페이징을 하지 않고 RowBouns를 이용하면 빠르게 개발할 수 있을 것이다.

하긴 요즘 수천만건의 데이터를 페이징에서 마지막 페이지를 볼 일이 많을까? -_-/


XML 쿼리문에 페이징을 넣지 않고 RowBounds 클래스를 사용하면 자동으로 페이징 쿼리가 실행되게 할 수 없을까?

방법이 있다! Mybatis Intercepter를 이용하면 된다. (인터셉터의 자세한 사용법은 다루지 않겠다 ㅠㅠ)

  1. Mybatis에서 쿼리를 날리기 전에 가로챈다.
  2. RowBounds가 있으면 쿼리에 페이징 문장를 적용한다.
  3. RowBounds를 제거하여 Mybatis에서 페이징 처리를 하지 않도록 한다.

아래 소스는 쿼리에 MySQL용으로 limit 문을 붙여준다.

package org.antop.mybatis.intercepter;

import org.apache.ibatis.executor.statement.StatementHandler;
import org.apache.ibatis.plugin.*;
import org.apache.ibatis.reflection.DefaultReflectorFactory;
import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.reflection.ReflectorFactory;
import org.apache.ibatis.reflection.factory.DefaultObjectFactory;
import org.apache.ibatis.reflection.factory.ObjectFactory;
import org.apache.ibatis.reflection.wrapper.DefaultObjectWrapperFactory;
import org.apache.ibatis.reflection.wrapper.ObjectWrapperFactory;
import org.apache.ibatis.session.RowBounds;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.sql.Connection;
import java.util.Properties;

@Intercepts({@Signature(type = StatementHandler.class, method = "prepare", args = {Connection.class, Integer.class})})
public class MysqlRowBoundsInterceptor implements Interceptor {
	private static final Logger logger = LoggerFactory.getLogger(MysqlRowBoundsInterceptor.class);

	private static final ObjectFactory DEFAULT_OBJECT_FACTORY = new DefaultObjectFactory();
	private static final ObjectWrapperFactory DEFAULT_OBJECT_WRAPPER_FACTORY = new DefaultObjectWrapperFactory();
	private static final ReflectorFactory DEFAULT_REFLECTOR_FACTORY = new DefaultReflectorFactory();

	public Object intercept(Invocation invocation) throws Throwable {
		StatementHandler statementHandler = (StatementHandler) invocation.getTarget();
		MetaObject metaStatementHandler = MetaObject.forObject(statementHandler, DEFAULT_OBJECT_FACTORY, DEFAULT_OBJECT_WRAPPER_FACTORY, DEFAULT_REFLECTOR_FACTORY);
		String originalSql = (String) metaStatementHandler.getValue("delegate.boundSql.sql");
		RowBounds rb = (RowBounds) metaStatementHandler.getValue("delegate.rowBounds");

		logger.debug("originalSql = {}", originalSql);
		logger.debug("RowBounds = {}", rb);

		if (rb == null || rb == RowBounds.DEFAULT) {
			// RowBounds가 없으면 그냥 실행
			return invocation.proceed();
		}

		// RowBounds가 있다!
		// 원래 쿼리에 limit 문을 붙여준다.
		StringBuffer sb = new StringBuffer();
		sb.append(originalSql);
		sb.append(" limit ");
		sb.append(rb.getOffset());
		sb.append(", ");
		sb.append(rb.getLimit());

		logger.debug("sql = {}", sb.toString());

		// RowBounds 정보 제거
		metaStatementHandler.setValue("delegate.rowBounds.offset", RowBounds.NO_ROW_OFFSET);
		metaStatementHandler.setValue("delegate.rowBounds.limit", RowBounds.NO_ROW_LIMIT);
		// 변경된 쿼리로 바꿔치기
		metaStatementHandler.setValue("delegate.boundSql.sql", sb.toString());

		return invocation.proceed();
	}

	public Object plugin(Object target) {
		return Plugin.wrap(target, this);
	}

	public void setProperties(Properties properties) {

	}

}

SqlSessionFactory 설정하는 부분에 인터셉터를 적용하면 된다.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:mybatis="http://mybatis.org/schema/mybatis-spring"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://mybatis.org/schema/mybatis-spring http://mybatis.org/schema/mybatis-spring.xsd">

    <mybatis:scan base-package="org.antop.mybatis"/>

    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <property name="mapperLocations" value="classpath*:mybatis/*.xml"/>
        <property name="plugins">
            <list>
                <!-- 인터셉터 설정 -->
                <bean class="org.antop.mybatis.intercepter.MysqlRowBoundsInterceptor"/>
            </list>
        </property>
    </bean>

    <bean id="dataSource" ... />
</beans>

실행시켜 보면 쿼리문에 페이징이 적용되서 쿼리가 날라가는 것을 확인할 수 있다.

select * from employees order by emp_no asc limit 29990, 10


출처

http://www.programering.com/a/MTM5gTNwATQ.html

http://hjw1456.tistory.com/10

'Framework > Mybatis' 카테고리의 다른 글

Mybatis Interceptor + RowBounds 를 이용한 페이징 처리  (0) 2017.12.12

댓글 (Comment)

Name*

Password*

Link (Your Website)

Comment

SECRET | 비밀글로 남기기

Eclipse JVM 경로 지정하기

Posted at 2016.09.13 11:00 | Posted in Tools/Eclipse

eclipse.ini 파일 수정


-startup
plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.400.v20160518-1444
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.defaultAction
openFile
--launcher.appendVmargs
# 여기
-vm
D:\develoment\jvm\jdk-8u101\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.8
-XX:+UseG1GC
-XX:+UseStringDeduplication
-Dosgi.requiredJavaVersion=1.8
-Xms256m
-Xmx1024m


'Tools > Eclipse' 카테고리의 다른 글

Eclipse JVM 경로 지정하기  (0) 2016.09.13
Eclipse + SVN Plugin  (1) 2012.03.29
Maven Integration for Eclipse  (0) 2012.02.20
Eclipse + TPTP Remote  (1) 2012.01.20
Eclipse + TPTP (Eclipse Test & Performance Tools Platform)  (4) 2012.01.01
Eclipse + MyBatis Generator  (1) 2011.07.04
installation Oracle Enterprise Pack for Eclipse  (2) 2011.05.22
Eclipse + STS (SpringSource Tool Suite)  (1) 2011.01.16
Eclipse Plugins for JBoss technology  (1) 2011.01.11
Properties Editor  (1) 2009.11.17
UTF-8 설정  (0) 2009.11.16
tag: Eclipse, jdk, JVM

댓글 (Comment)

Name*

Password*

Link (Your Website)

Comment

SECRET | 비밀글로 남기기

Install Ambari and Deploy HDP in CentOS

Posted at 2016.06.05 11:41 | Posted in Study/Hadoop

소개


스터디를 위해서 Ambari를 이용하여 하둡 환경을 구성하면서 기록을 남긴다.


 Host

 IP 

 CPU/RAM/HDD

 Service

 hadoop-00

 192.168.20.20

 4vCPU / 4GB / 16GB

 Ambari

 hadoop-01

 192.168.20.21

 4vCPU / 4GB / 120GB 

 NameNode

 hadoop-02

 192.168.20.22

 4vCPU / 4GB / 120GB

 Hive / DataNode

 hadoop-03

 192.168.20.23

 4vCPU / 4GB / 120GB

 DataNode

 hadoop-04

 192.168.20.24

 4vCPU / 4GB / 120GB

 DataNode




환경 준비


아래 항목들은 모든 서버에 공통적으로 적용해야 할 것들이다.



FQDN[각주:1] 및 호스트네임 설정


호스트들 등록 x N


# vi /etc/hosts

# 추가한다.

192.168.20.20   hadoop-00 hadoop-00.antop.org

192.168.20.21   hadoop-01 hadoop-01.antop.org

192.168.20.22   hadoop-02 hadoop-02.antop.org

192.168.20.23   hadoop-03 hadoop-03.antop.org

192.168.20.24   hadoop-04 hadoop-04.antop.org


호스트네임 설정값 변경


각각 서버에 맞는 번호로 이름 변경 x N


# hostname hadoop-00.antop.org

# hostname -f

hadoop-00


# hostname

hadoop-00.antop.org


네트워크 설정 쪽에도 호스트네임이 들어가 있다. 이것도 변경 x N


# vi /etc/sysconfig/network


NETWORKING=yes

HOSTNAME=hadoop-00.antop.org

GATEWAY=192.168.20.1



Password-less SSH 설정


비밀번호를 물어보지 않는 SSH를 사용할 수 있도록 설정


Ambari 쪽에서 다른 각각의 서버로만 뚫으면 된다.


공개키/개인키 생성


[root@hadoop-00 ~]# ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa

Generating public/private dsa key pair.

Created directory '/root/.ssh'.

Your identification has been saved in /root/.ssh/id_dsa.

Your public key has been saved in /root/.ssh/id_dsa.pub.

The key fingerprint is:

de:3a:1a:9b:cb:5d:ee:b4:a1:b6:e3:8a:64:a9:d2:54 root@hadoop-00.antop.org

The key's randomart image is:

.. 중략 ..


인증 심어놓기(?)


# 나 자신 서버에도 한다.

[root@hadoop-00 ~]# ssh-copy-id -i ~/.ssh/id_dsa.pub root@hadoop-00.antop.org

The authenticity of host 'hadoop-00.antop.org (192.168.20.20)' can't be established.

RSA key fingerprint is 93:02:94:19:21:aa:99:a8:94:87:75:36:06:08:3f:12.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added 'hadoop-00.antop.org,192.168.20.20' (RSA) to the list of known hosts.

root@hadoop-00.antop.org's password:

Now try logging into the machine, with "ssh 'root@hadoop-00.antop.org'", and check in:


  .ssh/authorized_keys


to make sure we haven't added extra keys that you weren't expecting.


[root@hadoop-00 ~]# ssh-copy-id -i ~/.ssh/id_dsa.pub root@hadoop-01.antop.org

[root@hadoop-00 ~]# ssh-copy-id -i ~/.ssh/id_dsa.pub root@hadoop-02.antop.org

[root@hadoop-00 ~]# ssh-copy-id -i ~/.ssh/id_dsa.pub root@hadoop-03.antop.org

[root@hadoop-00 ~]# ssh-copy-id -i ~/.ssh/id_dsa.pub root@hadoop-04.antop.org


Ambari 쪽에서 다른 서버들로 SSH 접속시 비밀번호를 물어보지 않고 접속이 잘 되어야 한다.


[root@hadoop-00 ~]# ssh root@hadoop-01.antop.org 'ls /'

# 비밀번호를 물어보지 않고 정상적으로 디렉터리 목록이 나와야함...


※ hadoop-00(Ambari)에 생성된 /root/.ssh/id_dsa 파일을 다운로드 받아놓자. Ambari Web UI에서 클러스터 생성시에 필요하다.



NTP[각주:2] 서비스 설치 및 실행


NTP 가 안깔려 있으면 설치하자.


# yum -y install ntp

# service ntpd start

# chkconfig ntpd on



방화벽 해제


하둡은 상당히 많은 포트를 사용한다. 철저하게 관리하면 좋겠지만..... 전부 해제!


# chkconfig iptables off

# /etc/init.d/iptables stop



SELinux 비활성화


# setenforce 0

vi /etc/selinux/config


# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

#     enforcing - SELinux security policy is enforced.

#     permissive - SELinux prints warnings instead of enforcing.

#     disabled - No SELinux policy is loaded.

SELINUX=disabled

# SELINUXTYPE= can take one of these two values:

#     targeted - Targeted processes are protected,

#     mls - Multi Level Security protection.

SELINUXTYPE=targeted



THP[각주:3] 비활성화


CentOS에서 THP가  활성화 되어있으면 성능 이슈가 발생할 수 있다고 경고가 나오게 된다.


HDP 가 설치되는 호스트들에 적용한다. (hadoop-01 ~ hadoop-04)


[root@hadoop-01 ~]# vi /etc/rc.local


#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

# 추가된 부분
if test -f /sys/kernel/mm/redhat_transparent_hugepage/enabled; then
   echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled; fi
if test -f /sys/kernel/mm/redhat_transparent_hugepage/defrag; then
   echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag; fi


재부팅 후 값 확인


[root@hadoop-01 ~]#  cat /sys/kernel/mm/transparent_hugepage/enabled


※ 이렇게 하는게 맞는지는 확실히 모르겠슴.. 어찌어찌 하다가 경고 없어짐... 여기 참조



unmask 값 변경


/etc/profile 파일을 열어서 umask 설정 로직 하단에 umask 값을 강제로 변경하는 부분을 추가해 주도록 하자.


# vi /etc/profile


# 중략

# By default, we want umask to get set. This sets it for login shell

# Current threshold for system reserved uid/gids is 200

# You could check uidgid reservation validity in

# /usr/share/doc/setup-*/uidgid file

if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then

    umask 002

else

    umask 022

fi


# 추가

umask 022



JDK 설치


여기선 1.7을 설치 하자.


# wget 없다면 설치

# yum install -y wget


# 다른 종류의 JDK 있으면 삭제

# yum remove -y java-1.6.0-openjdk

# yum remove -y java-1.7.0-openjdk


# RPM 파일 다운로드

# cd ~

# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.rpm"


# 설치

# yum localinstall -y jdk-7u80-linux-x64.rpm

# rm -f ~/jdk-7u80-linux-x64.rpm


# 환경 변수 설정

# echo 'export JAVA_HOME=/usr/java/jdk1.7.0_80' >> /etc/profile

# echo 'export PATH=$PATH:$JAVA_HOME/bin' >> /etc/profile


# 설치 확인

# java -version




Ambari Server 설치



Public Repositories[각주:4] 등록


yum 으로 설치될 수 있도록 저장소를 등록한다.


[root@hadoop-00 ~]# cd /etc/yum.repos.d/

[root@hadoop-00 yum.repos.d]# wget http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.2.2.0/ambari.repo



설치


[root@hadoop-00 ~]# yum install ambari-server



설정


[root@hadoop-00 ~]# ambari-server setup

Using python  /usr/bin/python

Setup ambari-server

Checking SELinux...

SELinux status is 'disabled'

Customize user account for ambari-server daemon [y/n] (n)? n

Adjusting ambari-server permissions and ownership...

Checking firewall status...

Checking JDK...

[1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8

[2] Oracle JDK 1.7 + Java Cryptography Extension (JCE) Policy Files 7

[3] Custom JDK

==============================================================================

Enter choice (1): 3

WARNING: JDK must be installed on all hosts and JAVA_HOME must be valid on all hosts.

WARNING: JCE Policy files are required for configuring Kerberos security. If you plan to use Kerberos,please make sure JCE Unlimited Strength Jurisdiction Policy Files are valid on all hosts.

Path to JAVA_HOME: /usr/java/jdk1.7.0_80

Validating JDK on Ambari Server...done.

Completing setup...

Configuring database...

Enter advanced database configuration [y/n] (n)? n

Configuring database...

Default properties detected. Using built-in database.

Configuring ambari database...

Checking PostgreSQL...

Running initdb: This may take upto a minute.

Initializing database: [  OK  ]


About to start PostgreSQL

Configuring local database...

Connecting to local database...done.

Configuring PostgreSQL...

Restarting PostgreSQL

Extracting system views...

.....ambari-admin-2.2.2.0.460.jar

.

Adjusting ambari-server permissions and ownership...

Ambari Server 'setup' completed successfully.



시작


[root@hadoop-00 ~]# ambari-server start

Using python  /usr/bin/python

Starting ambari-server

Ambari Server running with administrator privileges.

Organizing resource files at /var/lib/ambari-server/resources...

Server PID at: /var/run/ambari-server/ambari-server.pid

Server out at: /var/log/ambari-server/ambari-server.out

Server log at: /var/log/ambari-server/ambari-server.log

Waiting for server start....................

Ambari Server 'start' completed successfully.




Deploy CLuster using Ambari Web UI


브라우저로 http://<hostname>:8080 에 접속하자.


최초 로그인 아이디는 admin/admin



중앙 Create a Cluster 항목의 Launch Install Wizard 버튼 클릭!



클러스터 이름을 설정한다. 나는 MicroscopeHadoop 으로 하였다.



서비스 스택 버전을 선택한다.


최신 버전인 2.4 해도 되고, 나의 경우 Toad for Hadoop 1.5.0 버전에서 HDP 2.3 을 지원 한다고 하여 2.3 으로 설치한다. 



설치할 호스트를 지정한다. FQDN을 줄줄이 써주면 된다.


위에서 다운로드 받아놓은 id_dsa 파일을 여기서 첨부 파일로 넣어준다.



각 호스트에 Ambari Agent 설치 및 이것저것 검사를 한다.


※ 위에 THP 처리를 안하면 아래와 같이 경고가 나오게 된다.



서비스를 선택한다. (항목이 너무 많아서 스크린샷을 편집함...)


나는 Hive 만을 사용하기 위한 최소 항목만 선택 하였다. 나중에 추가 설치 가능하다.



어느 호스트에 무엇을 설치할 것인지 설정한다.


이 부분은 경험과 노하우가 필요하겠다...


나의 경우 서버가 4대라서... 1번에 다 몰고... 2번에 하이브.. 2,3,4 를 데이터 노드로 사용하려고 하였다.



DataNode 로 쓸 호스트를 선택하자.



설정값을 조정하는 부분이다.


특별히 변경 할 건 없는거 같고... -_-/... 아래 처럼 탭 부분에 빨간색 숫자 뜨는 부분 찾아가서 채워 주자.



설치(Deploy) 전 마지막 확인!



설치 시작 그리고 테스트


설치 완료!



설치 완료 요약



완료... 된 것인가 ㅠ_ㅠ





추가로 HTTP 포트 변경하기


https://ambari.apache.org/1.2.3/installing-hadoop-using-ambari/content/ambari-chap2-2a.html



참조

https://ambari.apache.org/1.2.2/installing-hadoop-using-ambari

http://guruble.com/?p=147

  1. https://wiki.kldp.org/KoreanDoc/html/PoweredByDNS-KLDP/fqdn.html [본문으로]
  2. http://www.terms.co.kr/NTP.htm [본문으로]
  3. Transparent Huge Pages [본문으로]
  4. https://cwiki.apache.org/confluence/display/AMBARI/Install+Ambari+2.2.2+from+Public+Repositories [본문으로]

'Study > Hadoop' 카테고리의 다른 글

Install Ambari and Deploy HDP in CentOS  (0) 2016.06.05
Installing Hive(Hadoop 1) + MySQL on CentOS 6.7  (0) 2016.01.05
Installing Hadoop 1 on Ubuntu 14.04  (0) 2015.11.12

댓글 (Comment)

Name*

Password*

Link (Your Website)

Comment

SECRET | 비밀글로 남기기