Giter VIP home page Giter VIP logo

lagom-hands-on-development's Introduction

Lagom Hands-On-Development

Lagom のサンプルプロジェクト Chirper(Twitterライクなアプリケーション) に「お気に入り」機能を追加実装するハンズオンです。

Gitter

このハンズオンで必要なもの

最小動作環境

  • CPU: 2Core
  • RAM: 4GB

事前準備

本番までに必ず実施しておいてください。

必要時間の目安

  • 1時間

途中、ファイルのダウンロードが行われるため、ネットワークの状況によってはこれ以上の時間がかかる場合があります。

ダウンロードされるのは開発環境(Activator UI)とハンズオン用プロジェクトが依存するライブラリです。 これらは activator uiactivator runAll のコマンドを実行したときにダウンロードされます。

手順

  • Java のバージョンが1.8系になっているか確認してください

    $ java -version
    java version "1.8.0_74"
    Java(TM) SE Runtime Environment (build 1.8.0_74-b02)
    Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode)
    $ javac -version
    javac 1.8.0_74

    JDK8をインストールしたにも関わらず、1.8系になっていない場合はJDK8にパスが通っているか確認してください。

  • ターミナルで任意のディレクトリの移動し、リポジトリをクローンします

    $ cd ~/workspace
    $ git clone https://github.com/negokaz/lagom-hands-on-development.git
  • プロジェクトのディレクトリに移動し、開発環境を起動します

    ※ Windows の場合、パスの区切り文字は\です。(例: bin\activator)

    $ cd lagom-hands-on-development
    $ bin/activator ui # bin には移動せず実行してください

    自動的に http://localhost:8888 が開き、コードが閲覧できるようになります。(例: FavoriteService.java)

    確認できたらターミナル上でCtrl + Cを押して終了します。


    ※ 依存ライブラリのダウンロードがバックグラウンドで行われるため、ブラウザが開くまで時間がかかる場合があります。(最大30分程度) ダウンロード中はログなどが出力されないため、フリーズしているように見えますが、少し待ってみてください。



    ※ ここでURLが http://localhost:8888/app/lagom-hands-on-development/ で始まっていない場合は対処が必要です。 ページ下部の「Activator UI へのリンクが使えない場合」を確認して対処してください。


  • 別のターミナルを開き、アプリケーションを起動します

    $ cd lagom-hands-on-development
    $ bin/activator runAll
    ....
    # ↓ のログが表示されると起動完了です
    [info] (Services started, use Ctrl+D to stop and go back to the console...)

    http://localhost:9000 に移動し、下記のような画面が表示されると起動成功です。

    確認できたらターミナル上でCtrl + Dを押して終了します。

ハンズオンを始める

  • Activator UI を起動します

    $ cd lagom-hands-on-development
    $ bin/activator ui
  • チュートリアル を確認し、スタッフの指示を待って下さい。

Activator UI が起動しない場合

下記のようなメッセージがターミナルに表示されていますか?

This application is already running (Or delete ../lagom-hands-on-development/RUNNING_PID file).

表示されている場合は RUNNING_PID ファイルを削除してから再度 Activator UI を起動しなおしてください。

rm RUNNING_PID

Activator UI へのリンクが使えない場合

activator ui を実行した後、表示されるページのURLを確認してください。 lagom-hands-on-developmentの後に-1などが付いていますか?

http://127.0.0.1:8888/app/lagom-hands-on-development-1/

付いている場合は、activtor のメタファイルの修正が必要です。 ホームディレクトリにある下記のファイルを編集してください。

.activator/1.0/config.json

URLの/app/の一つ後ろのパスがプロジェクトのIDになっています。

上記ファイルの中でそのIDが記載されている部分があるはずなので、その部分をlagom-hands-on-developmentに変更してください。

"id":"lagom-hands-on-development-1"

"id":"lagom-hands-on-development"

lagom-hands-on-development's People

Contributors

negokaz avatar

Stargazers

 avatar Satoshi Kurokawa avatar Shiho ASA avatar Koji Shiraishi avatar

Watchers

James Cloos avatar  avatar

lagom-hands-on-development's Issues

Windows PC で runAll すると OutOfMemoryError: Metaspace

java.lang.OutOfMemoryError: Metaspace が出て途中でフリーズしてしまう

> bin\activator runAll
[info] Loading global plugins from C:\Users\xxxxx\.sbt\0.13\plugins
[info] Loading project definition from C:\Users\xxxxx\Workspace\lagom-hands-on-development\project
[info] Set current project to lagom-hands-on-development (in build file:/C:/Users/xxxxx/Workspace/lagom-hands-on-development/)
[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] p.c.s.NettyServer - Listening for HTTP on /0:0:0:0:0:0:0:0:28118
SLF4J: The following set of substitute loggers may have been accessed
SLF4J: during the initialization phase. Logging calls during this
SLF4J: phase were not honored. However, subsequent logging calls to these
SLF4J: loggers will work as normally expected.
SLF4J: See also http://www.slf4j.org/codes.html#substituteLogger
SLF4J: com.google.inject.internal.util.Stopwatch
SLF4J: The following set of substitute loggers may have been accessed
SLF4J: during the initialization phase. Logging calls during this
SLF4J: phase were not honored. However, subsequent logging calls to these
SLF4J: loggers will work as normally expected.
SLF4J: See also http://www.slf4j.org/codes.html#substituteLogger
SLF4J: com.google.inject.internal.util.Stopwatch
11:42:05.426 [ForkJoinPool-2-worker-1] DEBUG c.g.inject.internal.util.Stopwatch - Interceptors creation: 134ms
11:42:05.438 [ForkJoinPool-2-worker-1] DEBUG c.g.inject.internal.util.Stopwatch - TypeListeners & ProvisionListener creation: 56ms
11:42:05.443 [ForkJoinPool-2-worker-1] DEBUG c.g.inject.internal.util.Stopwatch - Scopes creation: 6ms
11:42:05.447 [ForkJoinPool-2-worker-1] DEBUG c.g.inject.internal.util.Stopwatch - Converters creation: 4ms
[info] play.api.Play - Application started (Dev)
Exception in thread "ForkJoinPool-6-worker-1" java.lang.OutOfMemoryError: Metaspace
Exception in thread "ForkJoinPool-5-worker-1" java.lang.OutOfMemoryError: Metaspace

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.