메뉴 건너뛰기

Bigdata, Semantic IoT, Hadoop, NoSQL

Bigdata, Hadoop ecosystem, Semantic IoT등의 프로젝트를 진행중에 습득한 내용을 정리하는 곳입니다.
필요한 분을 위해서 공개하고 있습니다. 문의사항은 gooper@gooper.com로 메일을 보내주세요.


* 참조 : https://www.lagomframework.com/documentation/1.3.x/java/GettingStartedMaven.html#Generate-a-project-with-the-Lagom-archetype


1. 특정 위치에 폴더 생성및 이동
mkdir c:tmpHello
cd c:tmpHello


2. Hello 샘플 프로젝트 자동생성 실행
mvn archetype:generate -Dfilter=com.lightbend.lagom:maven-archetype-lagom-java


3. 진행화면
C:tmpHello>mvn archetype:generate -Dfilter=com.lightbend.lagom:maven-archetype-lagom-java
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.0.1:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.0.1:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:3.0.1:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: remote -> com.lightbend.lagom:maven-archetype-lagom-java (maven-archetype-lagom-java)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1
Choose com.lightbend.lagom:maven-archetype-lagom-java version:
1: 1.1.0-RC1
2: 1.1.0
3: 1.2.0-RC1
4: 1.2.0-RC2
5: 1.2.0
6: 1.2.1
7: 1.2.2
8: 1.2.3
9: 1.3.0-M1
10: 1.3.0-RC1
11: 1.3.0-RC2
12: 1.3.0
13: 1.3.1
14: 1.3.2
15: 1.3.3
16: 1.3.4
17: 1.3.5
18: 1.3.6
19: 1.3.7-RC1
20: 1.3.7
21: 1.3.8-M1
22: 1.3.8
23: 1.3.9
24: 1.3.10-M1
25: 1.3.10
26: 1.4.0-M1
27: 1.4.0-M2
28: 1.4.0-M3
29: 1.4.0-RC1
Choose a number: 29: 29
Downloading: https://repo.maven.apache.org/maven2/com/lightbend/lagom/maven-archetype-lagom-java/1.4.0-RC1/maven-archetype-lagom-java-1.4.0-RC1.pom
Downloaded: https://repo.maven.apache.org/maven2/com/lightbend/lagom/maven-archetype-lagom-java/1.4.0-RC1/maven-archetype-lagom-java-1.4.0-RC1.pom (2 KB at 3.8 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/com/lightbend/lagom/maven-archetype-lagom-java/1.4.0-RC1/maven-archetype-lagom-java-1.4.0-RC1.jar
Downloaded: https://repo.maven.apache.org/maven2/com/lightbend/lagom/maven-archetype-lagom-java/1.4.0-RC1/maven-archetype-lagom-java-1.4.0-RC1.jar (35 KB at 101.2 KB/sec)
Define value for property 'groupId': com.example.hello
Define value for property 'artifactId': my-first-system
Define value for property 'version' 1.0-SNAPSHOT: : Enter
Define value for property 'package' com.example.hello: : Enter
[INFO] Using property: scala-binary-version = 2.12
[INFO] Using property: service1ClassName = Hello
[INFO] Using property: service1Name = hello
[INFO] Using property: service2ClassName = Stream
[INFO] Using property: service2Name = stream
Confirm properties configuration:
groupId: com.example.hello
artifactId: my-first-system
version: 1.0-SNAPSHOT
package: com.example.hello
scala-binary-version: 2.12
service1ClassName: Hello
service1Name: hello
service2ClassName: Stream
service2Name: stream
  Y: : Y
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: maven-archetype-lagom-java:1.4.0-RC1
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.example.hello
[INFO] Parameter: artifactId, Value: my-first-system
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.example.hello
[INFO] Parameter: packageInPathFormat, Value: com/example/hello
[INFO] Parameter: service2Name, Value: stream
[INFO] Parameter: service1Name, Value: hello
[INFO] Parameter: groupId, Value: com.example.hello
[INFO] Parameter: service1ClassName, Value: Hello
[INFO] Parameter: scala-binary-version, Value: 2.12
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.example.hello
[INFO] Parameter: service2ClassName, Value: Stream
[INFO] Parameter: artifactId, Value: my-first-system
[INFO] Project created from Archetype in dir: C:tmpHellomy-first-system
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:50 min
[INFO] Finished at: 2018-01-19T15:31:56+09:00
[INFO] Final Memory: 17M/217M
[INFO] ------------------------------------------------------------------------


*컴파일시 getName(), getMessage()가 정의되지 않았다는 오류가 발생하면 https://www.gooper.com/ss/index.php?mid=bigdata&category=2825&document_srl=3572 를 참고하여 조치하고 재 컴파일 해준다.


4. 프로젝트 구조

my-first-system
 └ hello-api/             → hello world api project dir
 └ hello-impl/            → hello world implementation dir
 └ integration-tests/
 └ stream-api/            → stream api project dir
 └ stream-impl/           → stream implementation project dir
 └ pom.xml                → Project group build file


5. Hello 서비스 실행

cd my-first-system

mvn lagom:runAll

...
[info] Starting embedded Cassandra server
..........
[info] Cassandra server running at 127.0.0.1:4000
[info] Service locator is running at http://localhost:8000
[info] Service gateway is running at http://localhost:9000
...
[info] Service hello-impl listening for HTTP on 0:0:0:0:0:0:0:0:24266
[info] Service stream-impl listening for HTTP on 0:0:0:0:0:0:0:0:26230
(Services started, press enter to stop and go back to the console...)


6.hello 서비스 수행확인(HTTP client의 endpoint를 이용하여 확인)

http://localhost:9000/api/hello/World



번호 제목 글쓴이 날짜 조회 수
» Lagom에서 제공하는 Maven을 이용한 Hello프로젝트 자동생성 및 실행 총관리자 2018.01.19 81
478 lagom에서 제공하는 초기 생성기능을 이용하여 생성한 프로젝트의 소스 파악 총관리자 2018.01.16 111
477 spark stream처리할때 두개의 client프로그램이 동일한 checkpoint로 접근할때 발생하는 오류 내용 총관리자 2018.01.16 1115
476 shard3가 있는 서버에 문제가 있는 상태에서 solr query를 요청하는 경우 "no servers hosting shard: shard3" 오류가 발생하는 경우 조치사항 총관리자 2018.01.04 174
475 solr 데몬이 떠있는 동안 hadoop이 다운되는 경우 Index dir 'hdfs://mycluster/user/../core_node2/data/index/' of core 'gc_shard1_replica2' is already locked라논 오류가 발생하는데 이에 대한 조치사항 총관리자 2018.01.04 268
474 [Decommission]시 시간이 많이 걸리면서(수일) Decommission이 완료되지 않는 경우 조치 총관리자 2018.01.03 5292
473 [2.7.2] distribute-exclude.sh사용할때 ssh 포트변경에 따른 오류발생시 조치사항 총관리자 2018.01.02 89
472 hadoop cluster에 포함된 노드중에서 문제있는 decommission하는 방법및 절차 file 총관리자 2017.12.28 660
471 windows7에서 lagom의 hello world를 빌드하여 실행하는 경우의 로그(mvn lagom:runAll -Dscala.binary.version=2.11) 총관리자 2017.12.22 152
470 Lagom프레임웍에서 제공하는 HelloWorld 테스트를 수행시 [unknown-version]오류가 발생하면서 빌드가 되지 않는 경우 조치사항 총관리자 2017.12.22 56
469 [DBeaver 4.3.0]import/export시 "Client home is not specified for connection" 오류발생시 조치사항 총관리자 2017.12.21 753
468 전체 컨택스트 내용 file 총관리자 2017.12.19 66
467 [gson]mongodb의 api를 이용하여 데이타를 가져올때 "com.google.gson.stream.MalformedJsonException: Unterminated object at line..." 오류발생시 조치사항 총관리자 2017.12.11 4389
466 컴퓨터 무한 재부팅 원인및 조치방법 file 총관리자 2017.12.05 105
465 권한회수 및 권한부여 명령 몇가지 총관리자 2017.11.16 63
464 db를 통째로 새로운 이름의 db로 복사하는 방법/절차 총관리자 2017.11.14 428
463 oneM2M Specification(Draft Release 3, 2, 1), Draft Technical Reports 총관리자 2017.10.25 81
462 Windows7 64bit 환경에서 ElasticSearch 5.6.3설치하기 총관리자 2017.10.13 63
461 windows 혹은 mac에서 docker설치하기 위한 파일 총관리자 2017.10.13 42
460 lagom-windows용 build.sbt파일 내용 총관리자 2017.10.12 60

A personal place to organize information learned during the development of such Hadoop, Hive, Hbase, Semantic IoT, etc.
We are open to the required minutes. Please send inquiries to gooper@gooper.com.

위로