Friday, February 16, 2018

Lagom Scala HelloWorld project

Get started with Lagom using Scala
https://www.lagomframework.com/get-started-scala.html

Create project and add it to GitHub
https://developer.lightbend.com/start/?group=lagom&project=lagom-scala-sbt

Lagom Scala project
[dave@localhost github]$ cp ~/Downloads/lagom-scala-sbt.zip .
[dave@localhost github]$ unzip -l lagom-scala-sbt.zip 
Archive:  lagom-scala-sbt.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  02-16-2018 22:19   lagom-scala-sbt/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-api/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-api/src/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-api/src/main/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-api/src/main/scala/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-api/src/main/scala/com/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-api/src/main/scala/com/example/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-api/src/main/scala/com/example/hello/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-api/src/main/scala/com/example/hello/api/
     2864  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-api/src/main/scala/com/example/hello/api/DavescalalagomService.scala
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-impl/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-impl/src/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-impl/src/main/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-impl/src/main/scala/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-impl/src/main/scala/com/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-impl/src/main/scala/com/example/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-impl/src/main/scala/com/example/hellostream/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-impl/src/main/scala/com/example/hellostream/impl/
     1345  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-impl/src/main/scala/com/example/hellostream/impl/DavescalalagomStreamLoader.scala
      551  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-impl/src/main/scala/com/example/hellostream/impl/DavescalalagomStreamServiceImpl.scala
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-impl/src/main/resources/
      685  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-impl/src/main/resources/application.conf
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-api/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-api/src/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-api/src/main/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-api/src/main/scala/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-api/src/main/scala/com/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-api/src/main/scala/com/example/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-api/src/main/scala/com/example/hellostream/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-api/src/main/scala/com/example/hellostream/api/
      648  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-stream-api/src/main/scala/com/example/hellostream/api/DavescalalagomStreamService.scala
       61  02-16-2018 22:19   lagom-scala-sbt/.sbtopts
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/main/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/main/scala/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/main/scala/com/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/main/scala/com/example/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/main/scala/com/example/hello/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/main/scala/com/example/hello/impl/
     1642  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/main/scala/com/example/hello/impl/DavescalalagomServiceImpl.scala
     1648  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/main/scala/com/example/hello/impl/DavescalalagomLoader.scala
     7007  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/main/scala/com/example/hello/impl/DavescalalagomEntity.scala
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/main/resources/
      965  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/main/resources/application.conf
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/test/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/test/scala/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/test/scala/com/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/test/scala/com/example/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/test/scala/com/example/hello/
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/test/scala/com/example/hello/impl/
     1461  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/test/scala/com/example/hello/impl/DavescalalagomEntitySpec.scala
     1071  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/test/scala/com/example/hello/impl/DavescalalagomServiceSpec.scala
        0  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/test/resources/
      501  02-16-2018 22:19   lagom-scala-sbt/dave-scala-lagom-impl/src/test/resources/logback.xml
        0  02-16-2018 22:19   lagom-scala-sbt/project/
       20  02-16-2018 22:19   lagom-scala-sbt/project/build.properties
      208  02-16-2018 22:19   lagom-scala-sbt/project/plugins.sbt
      118  02-16-2018 22:19   lagom-scala-sbt/.gitignore
      595  02-16-2018 22:19   lagom-scala-sbt/LICENSE
     1514  02-16-2018 22:19   lagom-scala-sbt/build.sbt
      204  02-16-2018 22:19   lagom-scala-sbt/README.md
        0  02-16-2018 22:19   lagom-scala-sbt//
       55  01-15-2018 18:59   lagom-scala-sbt/sbt.bat
       44  01-15-2018 18:59   lagom-scala-sbt/sbt
        0  02-16-2018 22:19   lagom-scala-sbt/sbt-dist/
        0  02-16-2018 22:19   lagom-scala-sbt/sbt-dist/bin/
     6751  01-15-2018 18:59   lagom-scala-sbt/sbt-dist/bin/sbt-launch-lib.bash
     1321  01-15-2018 18:59   lagom-scala-sbt/sbt-dist/bin/sbt.bat
     5062  01-15-2018 18:59   lagom-scala-sbt/sbt-dist/bin/sbt
  1210231  01-15-2018 18:59   lagom-scala-sbt/sbt-dist/bin/sbt-launch.jar
        0  02-16-2018 22:19   lagom-scala-sbt/sbt-dist/conf/
      147  01-15-2018 18:59   lagom-scala-sbt/sbt-dist/conf/sbtconfig.txt
      939  01-15-2018 18:59   lagom-scala-sbt/sbt-dist/conf/sbtopts
---------                     -------
  1247658                     74 files


Add into GitHub
https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/

 Generated project
https://github.com/dveselka/lagom-scala-sbt


Build project
[dave@localhost lagom-scala-sbt]$ ./sbt runAll
Getting org.scala-sbt sbt 0.13.16 ...


Check the running service using
http://localhost:9000/api/hello/World



Get Started with Lightbend Technologies

 Microservices framework built on Akka and Play
https://www.lightbend.com/lagom-framework

Lagom - Get started 
https://www.lagomframework.com/get-started-java-maven.html


Create project - choose name and package
https://developer.lightbend.com/start/?group=lagom&project=lagom-java-maven

Download project and add it into GitHub
[dave@localhost github]$ cp ~/Downloads/lagom-java-maven.zip .
[dave@localhost github]$ unzip -l lagom-java-maven.zip 
Archive:  lagom-java-maven.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  02-16-2018 21:42   lagom-java-maven/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/integration-tests/
     2536  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/integration-tests/pom.xml
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/integration-tests/src/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/integration-tests/src/test/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/integration-tests/src/test/resources/
       38  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/integration-tests/src/test/resources/application.conf
      346  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/integration-tests/src/test/resources/logback-test.xml
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/integration-tests/src/test/java/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/integration-tests/src/test/java/org/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/integration-tests/src/test/java/org/dave/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/integration-tests/src/test/java/org/dave/it/
     3043  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/integration-tests/src/test/java/org/dave/it/StreamIT.java
      130  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/.gitignore
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-api/
      734  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-api/pom.xml
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-api/src/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-api/src/main/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-api/src/main/java/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-api/src/main/java/org/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-api/src/main/java/org/dave/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-api/src/main/java/org/dave/stream/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-api/src/main/java/org/dave/stream/api/
     1446  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-api/src/main/java/org/dave/stream/api/StreamService.java
     3277  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/pom.xml
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/
     2328  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/pom.xml
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/test/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/test/resources/
      404  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/test/resources/logback-test.xml
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/test/java/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/test/java/org/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/test/java/org/dave/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/test/java/org/dave/hello/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/test/java/org/dave/hello/impl/
     1858  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/test/java/org/dave/hello/impl/HelloEntityTest.java
     1179  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/test/java/org/dave/hello/impl/HelloServiceTest.java
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/main/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/main/resources/
      928  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/main/resources/application.conf
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/main/java/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/main/java/org/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/main/java/org/dave/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/main/java/org/dave/hello/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/main/java/org/dave/hello/impl/
     1838  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/main/java/org/dave/hello/impl/HelloCommand.java
     3488  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/main/java/org/dave/hello/impl/HelloEntity.java
     3119  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/main/java/org/dave/hello/impl/HelloServiceImpl.java
      442  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/main/java/org/dave/hello/impl/HelloModule.java
     1820  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/main/java/org/dave/hello/impl/HelloEvent.java
      726  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-impl/src/main/java/org/dave/hello/impl/HelloState.java
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-impl/
     2385  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-impl/pom.xml
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-impl/src/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-impl/src/main/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-impl/src/main/resources/
      935  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-impl/src/main/resources/application.conf
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-impl/src/main/java/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-impl/src/main/java/org/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-impl/src/main/java/org/dave/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-impl/src/main/java/org/dave/stream/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-impl/src/main/java/org/dave/stream/impl/
     1221  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-impl/src/main/java/org/dave/stream/impl/StreamServiceImpl.java
      710  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-impl/src/main/java/org/dave/stream/impl/StreamModule.java
     1196  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-impl/src/main/java/org/dave/stream/impl/StreamSubscriber.java
     1878  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/stream-impl/src/main/java/org/dave/stream/impl/StreamRepository.java
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-api/
     1051  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-api/pom.xml
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-api/src/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-api/src/main/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-api/src/main/java/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-api/src/main/java/org/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-api/src/main/java/org/dave/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-api/src/main/java/org/dave/hello/
        0  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-api/src/main/java/org/dave/hello/api/
     1925  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-api/src/main/java/org/dave/hello/api/HelloService.java
      855  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-api/src/main/java/org/dave/hello/api/HelloEvent.java
      484  02-16-2018 21:42   lagom-java-maven/DaveLagomProject/hello-api/src/main/java/org/dave/hello/api/GreetingMessage.java
        0  02-16-2018 21:42   lagom-java-maven//
---------                     -------
    42320                     81 files


Created project on GitHub
https://github.com/dveselka/lagom-java-maven

 Build and run project
[dave@localhost DaveLagomProject]$ mvn lagom:runAll
[INFO] Scanning for projects...


[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] DaveLagomProject
[INFO] hello-api
[INFO] hello-impl
[INFO] stream-api
[INFO] stream-impl
[INFO] integration-test


Akka starting
[INFO] Compiling 6 source files to /home/dave/github/lagom-java-maven/DaveLagomProject/hello-impl/target/classes
22:57:48.601 [info] akka.event.slf4j.Slf4jLogger [] - Slf4jLogger started
22:57:49.941 [info] akka.remote.Remoting [sourceThread=ForkJoinPool-1-worker-1, akkaSource=akka.remote.Remoting, sourceActorSystem=hello-impl-application, akkaTimestamp=21:57:49.939UTC] - Starting remoting
22:57:50.865 [info] akka.remote.Remoting [sourceThread=ForkJoinPool-1-worker-1, akkaTimestamp=21:57:50.864UTC, akkaSource=akka.remote.Remoting, sourceActorSystem=hello-impl-application] - Remoting started; listening on addresses :[akka.tcp://hello-impl-application@127.0.0.1:41899]
22:57:50.883 [info] akka.remote.Remoting [sourceThread=ForkJoinPool-1-worker-1, akkaTimestamp=21:57:50.883UTC, akkaSource=akka.remote.Remoting, sourceActorSystem=hello-impl-application] - Remoting now listens on addresses: [akka.tcp://hello-impl-application@127.0.0.1:41899]
22:57:50.926 [info] akka.cluster.Cluster(akka://hello-impl-application) [sourceThread=ForkJoinPool-1-worker-1, akkaTimestamp=21:57:50.926UTC, akkaSource=akka.cluster.Cluster(akka://hello-impl-application), sourceActorSystem=hello-impl-application] - Cluster Node [akka.tcp://hello-impl-application@127.0.0.1:41899] - Starting up...
22:57:51.084 [info] akka.cluster.Cluster(akka://hello-impl-application) [sourceThread=ForkJoinPool-1-worker-1, akkaTimestamp=21:57:51.084UTC, akkaSource=akka.cluster.Cluster(akka://hello-impl-application), sourceActorSystem=hello-impl-application] - Cluster Node [akka.tcp://hello-impl-application@127.0.0.1:41899] - Registered cluster JMX MBean [akka:type=Cluster,port=41899]
22:57:51.085 [info] akka.cluster.Cluster(akka://hello-impl-application) [sourceThread=ForkJoinPool-1-worker-1, akkaTimestamp=21:57:51.084UTC, akkaSource=akka.cluster.Cluster(akka://hello-impl-application), sourceActorSystem=hello-impl-application] - Cluster Node [akka.tcp://hello-impl-application@127.0.0.1:41899] - Started up successfully


Service started
2:59:47.300 [info] akka.cluster.singleton.ClusterSingletonManager [sourceThread=stream-impl-application-akka.actor.default-dispatcher-17, akkaTimestamp=21:59:47.297UTC, akkaSource=akka.tcp://stream-impl-application@127.0.0.1:41263/user/cassandraOffsetStorePrepare-singleton, sourceActorSystem=stream-impl-application] - ClusterSingletonManager state change [Start -> Oldest]
22:59:47.301 [info] com.lightbend.lagom.internal.persistence.cluster.ClusterStartupTaskActor [sourceThread=stream-impl-application-akka.actor.default-dispatcher-13, akkaTimestamp=21:59:47.300UTC, akkaSource=akka.tcp://stream-impl-application@127.0.0.1:41263/user/cassandraOffsetStorePrepare-singleton/singleton/cassandraOffsetStorePrepare, sourceActorSystem=stream-impl-application] - Executing cluster start task cassandraOffsetStorePrepare.
22:59:47.655 [info] akka.cluster.singleton.ClusterSingletonProxy [sourceThread=stream-impl-application-akka.actor.default-dispatcher-17, akkaTimestamp=21:59:47.655UTC, akkaSource=akka.tcp://stream-impl-application@127.0.0.1:41263/user/cassandraOffsetStorePrepare-singletonProxy, sourceActorSystem=stream-impl-application] - Singleton identified at [akka://stream-impl-application/user/cassandraOffsetStorePrepare-singleton/singleton]
22:59:47.703 [info] play.api.http.EnabledFilters [] - Enabled Filters (see <https://www.playframework.com/documentation/latest/Filters>):


22:59:48.517 [info] play.api.Play [] - Application started (Dev)
[INFO] Service hello-impl listening for HTTP on 0:0:0:0:0:0:0:0:57797
[INFO] Service stream-impl listening for HTTP on 0:0:0:0:0:0:0:0:58445
[INFO] (Services started, press enter to stop and go back to the console..


Fresh  start
INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] DaveLagomProject
[INFO] hello-api
[INFO] hello-impl
[INFO] stream-api
[INFO] stream-impl
[INFO] integration-test
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building DaveLagomProject 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- lagom-maven-plugin:1.4.0:runAll (default-cli) @ DaveLagomProject ---
[INFO] Starting Kafka
[INFO] Detected Guava >= 19 in the classpath, using modern compatibility layer
[INFO] Starting Cassandra
.[INFO] Using native clock to generate timestamps.
[INFO] Did not find Netty's native epoll transport in the classpath, defaulting to NIO.
.[INFO] Using native clock to generate timestamps.
.[INFO] Using native clock to generate timestamps.


Verify service by calling

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










Wednesday, February 7, 2018

Using Ethereum Mist Wallet

Ethereum main wiki

Mist release
https://github.com/ethereum/mist/releases


Step-by-Step Guide: Getting Started with Ethereum Mist Wallet

https://medium.com/@attores/step-by-step-guide-getting-started-with-ethereum-mist-wallet-772a3cc99af4


Use testnet
https://testnet.etherscan.io/

Choose RINKEBY
https://rinkeby.etherscan.io/

Start geth testnet
geth --fast --cache=512 --rpcapi personal,db,eth,net,web3 --rpc --testnet




Start mist - without local testnet

dave@localhost linux-unpacked]$ ./mist 
[2018-02-08 06:48:57.260] [INFO] main - Running in production mode: true
[2018-02-08 06:48:57.308] [INFO] EthereumNode - undefined null 'fast'
[2018-02-08 06:48:57.310] [INFO] EthereumNode - Defaults loaded: geth main fast
[2018-02-08 06:48:57.681] [INFO] main - Starting in Mist mode
[2018-02-08 06:48:59.652] [INFO] Db - Creating db: /home/dave/.config/Mist/mist.lokidb
[2018-02-08 06:48:59.812] [INFO] Db - Loading db: /home/dave/.config/Mist/mist.lokidb
[2018-02-08 06:48:59.820] [INFO] Windows - Creating commonly-used windows
[2018-02-08 06:48:59.820] [INFO] Windows - Create secondary window: loading, owner: notset
[2018-02-08 06:49:00.981] [INFO] updateChecker - Check for update...
[2018-02-08 06:49:04.822] [INFO] Windows - Create primary window: main, owner: notset
[2018-02-08 06:49:04.845] [INFO] Windows - Create primary window: splash, owner: notset
[2018-02-08 06:49:05.982] [INFO] ipcCommunicator - Backend language set to:  en
[2018-02-08 06:49:06.497] [INFO] (ui: splashscreen) - Web3 already initialized, re-using provider.
[2018-02-08 06:49:06.573] [INFO] (ui: splashscreen) - Meteor starting up...
[2018-02-08 06:49:06.652] [INFO] ClientBinaryManager - Initializing...
[2018-02-08 06:49:06.653] [INFO] ClientBinaryManager - Checking for new client binaries config from: https://raw.githubusercontent.com/ethereum/mist/master/clientBinaries.json
[2018-02-08 06:49:06.773] [WARN] ClientBinaryManager - Error loading local config - assuming this is a first run: Error: ENOENT: no such file or directory, open '/home/dave/.config/Mist/clientBinaries.json'
[2018-02-08 06:49:06.773] [INFO] ClientBinaryManager - Write new client binaries local config to disk ...
[2018-02-08 06:49:06.778] [INFO] ClientBinaryManager - No "skippedNodeVersion.json" found.
[2018-02-08 06:49:06.780] [INFO] ClientBinaryManager - Initializing...
[2018-02-08 06:49:06.780] [INFO] ClientBinaryManager - Resolving platform...
[2018-02-08 06:49:06.781] [INFO] ClientBinaryManager - Calculating possible clients...
[2018-02-08 06:49:06.783] [INFO] ClientBinaryManager - 1 possible clients.
[2018-02-08 06:49:06.784] [INFO] ClientBinaryManager - Verifying status of all 1 possible clients...
[2018-02-08 06:49:06.786] [INFO] ClientBinaryManager - Verify Geth status ...
[2018-02-08 06:49:06.888] [ERROR] ClientBinaryManager - Unable to resolve Geth executable: geth
[2018-02-08 06:49:06.891] [INFO] ClientBinaryManager - Download binary for Geth ...
[2018-02-08 06:49:06.912] [INFO] ClientBinaryManager - Downloading package from https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.7.2-1db4ecdc.tar.gz to /home/dave/.config/Mist/binaries/Geth/archive.tar ...
[2018-02-08 06:49:08.058] [INFO] updateChecker - App is up-to-date.

Start mist - with local testnet

Saturday, February 3, 2018

Connect to Ethereum geth client using web3j

Introduction video to web3j
https://www.youtube.com/watch?v=ea3miXs_P6Y

Blockchain - Using cryptocurrency with Java

http://www.javamagazine.mozaicreader.com/JanFeb2017/Default/36/0#&pageSet=36&page=0&contentItem=0

 

Reactive-Functional Fun on the Blockchain with web3j

https://community.oracle.com/docs/DOC-1011373


Ethereum Geth client
https://github.com/ethereum/go-ethereum/wiki/Installing-Geth#build-it-from-source-code


Web3j
https://web3j.io/
https://github.com/web3j/web3j 

Install Ethereum client

Get Golang and geth code
dnf install golang

git clone https://github.com/ethereum/go-ethereum.git

Compile geth client
[dave@localhost go-ethereum]$ make
build/env.sh go run build/ci.go install ./cmd/geth
>>> /usr/lib/golang/bin/go install -ldflags -X main.gitCommit=0662384d294eaa44390799747db030e8d401111d -v ./cmd/geth
github.com/ethereum/go-ethereum/common/hexutil
github.com/ethereum/go-ethereum/crypto/sha3
github.com/ethereum/go-ethereum/common/math
github.com/ethereum/go-ethereum/rlp
github.com/ethereum/go-ethereum/crypto/secp256k1
github.com/ethereum/go-ethereum/vendor/github.com/go-stack/stack
github.com/ethereum/go-ethereum/log
github.com/ethereum/go-ethereum/vendor/github.com/rcrowley/go-metrics
github.com/ethereum/go-ethereum/vendor/gopkg.in/karalabe/cookiejar.v2/collections/prque
github.com/ethereum/go-ethereum/common
github.com/ethereum/go-ethereum/vendor/github.com/aristanetworks/goarista/monotime
github.com/ethereum/go-ethereum/common/mclock
github.com/ethereum/go-ethereum/event
github.com/ethereum/go-ethereum/params
github.com/ethereum/go-ethereum/crypto/randentropy
github.com/ethereum/go-ethereum/vendor/github.com/pborman/uuid
github.com/ethereum/go-ethereum/vendor/golang.org/x/sys/unix
github.com/ethereum/go-ethereum/vendor/golang.org/x/crypto/pbkdf2
github.com/ethereum/go-ethereum/vendor/golang.org/x/crypto/scrypt
github.com/ethereum/go-ethereum/vendor/gopkg.in/fatih/set.v0
github.com/ethereum/go-ethereum/cmd/internal/browser
github.com/ethereum/go-ethereum/common/fdlimit
github.com/ethereum/go-ethereum/vendor/github.com/rcrowley/go-metrics/exp
github.com/ethereum/go-ethereum/vendor/github.com/syndtr/goleveldb/leveldb/util
github.com/ethereum/go-ethereum/metrics
github.com/ethereum/go-ethereum/vendor/github.com/syndtr/goleveldb/leveldb/cache
github.com/ethereum/go-ethereum/vendor/github.com/syndtr/goleveldb/leveldb/comparer
github.com/ethereum/go-ethereum/vendor/github.com/syndtr/goleveldb/leveldb/storage
github.com/ethereum/go-ethereum/vendor/github.com/syndtr/goleveldb/leveldb/filter
github.com/ethereum/go-ethereum/vendor/github.com/syndtr/goleveldb/leveldb/opt
github.com/ethereum/go-ethereum/vendor/github.com/golang/snappy
github.com/ethereum/go-ethereum/vendor/github.com/rjeczalik/notify
github.com/ethereum/go-ethereum/vendor/github.com/hashicorp/golang-lru/simplelru
github.com/ethereum/go-ethereum/vendor/github.com/syndtr/goleveldb/leveldb/errors
github.com/ethereum/go-ethereum/vendor/github.com/syndtr/goleveldb/leveldb/iterator
github.com/ethereum/go-ethereum/vendor/github.com/syndtr/goleveldb/leveldb/journal
github.com/ethereum/go-ethereum/vendor/github.com/hashicorp/golang-lru
github.com/ethereum/go-ethereum/vendor/github.com/syndtr/goleveldb/leveldb/memdb
github.com/ethereum/go-ethereum/vendor/github.com/syndtr/goleveldb/leveldb/table
github.com/ethereum/go-ethereum/vendor/golang.org/x/net/context
github.com/ethereum/go-ethereum/vendor/github.com/rs/xhandler
github.com/ethereum/go-ethereum/vendor/golang.org/x/net/websocket
github.com/ethereum/go-ethereum/vendor/github.com/rs/cors
github.com/ethereum/go-ethereum/vendor/github.com/edsrzf/mmap-go
github.com/ethereum/go-ethereum/vendor/github.com/syndtr/goleveldb/leveldb
github.com/ethereum/go-ethereum/common/bitutil
github.com/ethereum/go-ethereum/crypto/bn256
github.com/ethereum/go-ethereum/rpc
github.com/ethereum/go-ethereum/vendor/golang.org/x/crypto/ripemd160
github.com/ethereum/go-ethereum/vendor/github.com/elastic/gosigar
github.com/ethereum/go-ethereum/vendor/github.com/huin/goupnp/httpu
github.com/ethereum/go-ethereum/vendor/github.com/huin/goupnp/scpd
github.com/ethereum/go-ethereum/vendor/github.com/huin/goupnp/soap
github.com/ethereum/go-ethereum/vendor/github.com/huin/goupnp/ssdp
github.com/ethereum/go-ethereum/ethdb
github.com/ethereum/go-ethereum/vendor/golang.org/x/net/html/atom
github.com/ethereum/go-ethereum/vendor/golang.org/x/text/encoding/internal/identifier
github.com/ethereum/go-ethereum/vendor/golang.org/x/text/transform
github.com/ethereum/go-ethereum/vendor/golang.org/x/net/html
github.com/ethereum/go-ethereum/vendor/golang.org/x/text/internal/utf8internal
github.com/ethereum/go-ethereum/vendor/golang.org/x/text/internal/tag
github.com/ethereum/go-ethereum/vendor/golang.org/x/text/encoding
github.com/ethereum/go-ethereum/vendor/golang.org/x/text/runes
github.com/ethereum/go-ethereum/vendor/golang.org/x/text/encoding/internal
github.com/ethereum/go-ethereum/vendor/golang.org/x/text/language
github.com/ethereum/go-ethereum/vendor/golang.org/x/text/encoding/charmap
github.com/ethereum/go-ethereum/vendor/golang.org/x/text/encoding/japanese
github.com/ethereum/go-ethereum/vendor/golang.org/x/text/encoding/korean
github.com/ethereum/go-ethereum/vendor/golang.org/x/text/encoding/simplifiedchinese
github.com/ethereum/go-ethereum/vendor/golang.org/x/text/encoding/traditionalchinese
github.com/ethereum/go-ethereum/vendor/golang.org/x/text/encoding/unicode
github.com/ethereum/go-ethereum/vendor/github.com/jackpal/go-nat-pmp
github.com/ethereum/go-ethereum/p2p/netutil
github.com/ethereum/go-ethereum/eth/tracers/internal/tracers
github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3
github.com/ethereum/go-ethereum/vendor/github.com/golang/protobuf/proto
github.com/ethereum/go-ethereum/vendor/golang.org/x/text/encoding/htmlindex
github.com/ethereum/go-ethereum/vendor/golang.org/x/net/html/charset
github.com/ethereum/go-ethereum/vendor/github.com/huin/goupnp
github.com/ethereum/go-ethereum/vendor/github.com/huin/goupnp/dcps/internetgateway1
github.com/ethereum/go-ethereum/vendor/github.com/huin/goupnp/dcps/internetgateway2
github.com/ethereum/go-ethereum/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor
github.com/ethereum/go-ethereum/p2p/nat
github.com/ethereum/go-ethereum/accounts/usbwallet/internal/trezor
github.com/ethereum/go-ethereum/vendor/github.com/karalabe/hid
github.com/ethereum/go-ethereum/log/term
github.com/ethereum/go-ethereum/vendor/github.com/mattn/go-colorable
github.com/ethereum/go-ethereum/vendor/gopkg.in/urfave/cli.v1
github.com/ethereum/go-ethereum/internal/debug
github.com/ethereum/go-ethereum/vendor/github.com/prometheus/prometheus/util/flock
github.com/ethereum/go-ethereum/les/flowcontrol
github.com/ethereum/go-ethereum/vendor/golang.org/x/sync/syncmap
github.com/ethereum/go-ethereum/internal/jsre/deps
github.com/ethereum/go-ethereum/vendor/github.com/mattn/go-isatty
github.com/ethereum/go-ethereum/vendor/github.com/fatih/color
# github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3
In file included from vendor/gopkg.in/olebedev/go-duktape.v3/api.go:7:0:
vendor/gopkg.in/olebedev/go-duktape.v3/api.go: In function ‘_duk_error’:
vendor/gopkg.in/olebedev/go-duktape.v3/duktape.h:510:127: warning: right-hand operand of comma expression has no effect [-Wunused-value]
  (duk_error_raw((ctx), (duk_errcode_t) (err_code), (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__), (duk_ret_t) 0)
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
vendor/gopkg.in/olebedev/go-duktape.v3/api.go:153:2: note: in expansion of macro ‘duk_error’
  duk_error(ctx, err_code, "%s", str);
  ^~~~~~~~~
github.com/ethereum/go-ethereum/vendor/gopkg.in/sourcemap.v1/base64vlq
github.com/ethereum/go-ethereum/vendor/gopkg.in/sourcemap.v1
github.com/ethereum/go-ethereum/vendor/github.com/robertkrimen/otto/file
github.com/ethereum/go-ethereum/vendor/github.com/robertkrimen/otto/token
github.com/ethereum/go-ethereum/vendor/github.com/robertkrimen/otto/ast
github.com/ethereum/go-ethereum/vendor/github.com/robertkrimen/otto/dbg
github.com/ethereum/go-ethereum/vendor/github.com/robertkrimen/otto/parser
github.com/ethereum/go-ethereum/vendor/github.com/robertkrimen/otto/registry
github.com/ethereum/go-ethereum/vendor/github.com/robertkrimen/otto
github.com/ethereum/go-ethereum/crypto
github.com/ethereum/go-ethereum/trie
github.com/ethereum/go-ethereum/core/types
github.com/ethereum/go-ethereum/crypto/ecies
github.com/ethereum/go-ethereum/p2p/discover
github.com/ethereum/go-ethereum
github.com/ethereum/go-ethereum/accounts
github.com/ethereum/go-ethereum/accounts/keystore
github.com/ethereum/go-ethereum/core/state
github.com/ethereum/go-ethereum/core/vm
github.com/ethereum/go-ethereum/p2p/discv5
github.com/ethereum/go-ethereum/consensus
github.com/ethereum/go-ethereum/consensus/misc
github.com/ethereum/go-ethereum/consensus/clique
github.com/ethereum/go-ethereum/consensus/ethash
github.com/ethereum/go-ethereum/core
github.com/ethereum/go-ethereum/p2p
github.com/ethereum/go-ethereum/core/bloombits
github.com/ethereum/go-ethereum/eth/fetcher
github.com/ethereum/go-ethereum/accounts/usbwallet
github.com/ethereum/go-ethereum/dashboard
github.com/ethereum/go-ethereum/node
github.com/ethereum/go-ethereum/whisper/whisperv5
github.com/ethereum/go-ethereum/eth/downloader
github.com/ethereum/go-ethereum/eth/filters
github.com/ethereum/go-ethereum/light
github.com/ethereum/go-ethereum/internal/jsre
github.com/ethereum/go-ethereum/internal/ethapi
github.com/ethereum/go-ethereum/miner
github.com/ethereum/go-ethereum/internal/web3ext
github.com/ethereum/go-ethereum/vendor/github.com/peterh/liner
github.com/ethereum/go-ethereum/eth/gasprice
github.com/ethereum/go-ethereum/ethclient
github.com/ethereum/go-ethereum/vendor/github.com/maruel/panicparse/stack
github.com/ethereum/go-ethereum/console
github.com/ethereum/go-ethereum/vendor/github.com/mattn/go-runewidth
github.com/ethereum/go-ethereum/vendor/github.com/mitchellh/go-wordwrap
github.com/ethereum/go-ethereum/vendor/github.com/nsf/termbox-go
github.com/ethereum/go-ethereum/vendor/github.com/naoina/go-stringutil
github.com/ethereum/go-ethereum/vendor/github.com/naoina/toml/ast
github.com/ethereum/go-ethereum/vendor/github.com/gizak/termui
github.com/ethereum/go-ethereum/vendor/github.com/naoina/toml
github.com/ethereum/go-ethereum/eth/tracers
github.com/ethereum/go-ethereum/eth
github.com/ethereum/go-ethereum/les
github.com/ethereum/go-ethereum/ethstats
github.com/ethereum/go-ethereum/cmd/utils
github.com/ethereum/go-ethereum/cmd/geth
Done building.
Run "/home/dave/github/go-ethereum/build/bin/geth" to launch geth.



Start geth client
[dave@localhost go-ethereum]$ /home/dave/github/go-ethereum/build/bin/geth --fast --cache=512 --rpcapi personal,db,eth,net,web3 --rpc --testnet
INFO [02-04|06:34:54] Starting peer-to-peer node               instance=Geth/v1.8.0-unstable-0662384d/linux-amd64/go1.8.5
INFO [02-04|06:34:54] Allocated cache and file handles         database=/home/dave/.ethereum/testnet/geth/chaindata cache=512 handles=512
INFO [02-04|06:34:55] Writing custom genesis block 
INFO [02-04|06:34:55] Initialised chain configuration          config="{ChainID: 3 Homestead: 0 DAO: <nil> DAOSupport: true EIP150: 0 EIP155: 10 EIP158: 10 Byzantium: 1700000 Engine: ethash}"
INFO [02-04|06:34:55] Disk storage enabled for ethash caches   dir=/home/dave/.ethereum/testnet/geth/ethash count=3
INFO [02-04|06:34:55] Disk storage enabled for ethash DAGs     dir=/home/dave/.ethash                       count=2
INFO [02-04|06:34:55] Initialising Ethereum protocol           versions="[63 62]" network=3
INFO [02-04|06:34:55] Loaded most recent local header          number=0 hash=419410…ca4a2d td=1048576
INFO [02-04|06:34:55] Loaded most recent local full block      number=0 hash=419410…ca4a2d td=1048576
INFO [02-04|06:34:55] Loaded most recent local fast block      number=0 hash=419410…ca4a2d td=1048576
INFO [02-04|06:34:55] Regenerated local transaction journal    transactions=0 accounts=0
INFO [02-04|06:34:55] Starting P2P networking 
INFO [02-04|06:34:57] UDP listener up                          self=enode://9bbc55ed1cca170be4cba9c3ea9e22322680d2f9cdd7e363591d2a6738e55707cb58fa64764c9b1ead28174dbec81ec5721cb2452e625de6292fe36881d672a2@89.233.189.164:30303
INFO [02-04|06:34:57] RLPx listener up                         self=enode://9bbc55ed1cca170be4cba9c3ea9e22322680d2f9cdd7e363591d2a6738e55707cb58fa64764c9b1ead28174dbec81ec5721cb2452e625de6292fe36881d672a2@89.233.189.164:30303
INFO [02-04|06:34:57] IPC endpoint opened: /home/dave/.ethereum/testnet/geth.ipc 
INFO [02-04|06:34:57] HTTP endpoint opened: http://127.0.0.1:8545 


Geth client running
INFO [02-04|07:06:39] Imported new state entries               count=273 elapsed=8.868µs processed=273 pending=4369 retry=0 duplicate=0 unexpected=0
INFO [02-04|07:06:39] Imported new block headers               count=0   elapsed=8.269ms number=83814 hash=94033d…457655 ignored=192
INFO [02-04|07:06:39] Imported new block receipts              count=4   elapsed=659.004µs bytes=3957 number=83626 hash=ba23b3…b7e218 ignored=0
INFO [02-04|07:06:40] Imported new block receipts              count=33  elapsed=4.361ms   bytes=33409 number=83659 hash=5eb979…3e5a58 ignored=0
INFO [02-04|07:06:40] Imported new block headers               count=0   elapsed=7.208ms   number=84006 hash=aee4cb…1bb757 ignored=192
INFO [02-04|07:06:40] Imported new block receipts              count=155 elapsed=35.627ms  bytes=89944 number=83814 hash=94033d…457655 ignored=0
INFO [02-04|07:06:40] Imported new block receipts              count=192 elapsed=9.058ms   bytes=130405 number=84006 hash=aee4cb…1bb757 ignored=0


Connect to client using https://web3j.io/

Web3j code samples
https://github.com/web3j/examples/blob/master/rx/src/main/java/org/web3j/examples/rx/Main.java

Maven sample project
https://github.com/JacqMT/web3j-maven-example/blob/master/pom.xml

Clone sample project
git clone https://github.com/JacqMT/web3j-maven-example


Compile test project using
[dave@localhost web3j-maven-example]$ mvn install
[INFO] Scanning for projects...
[WARNING] 
[[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building web3j-maven-example 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ web3j-maven-example ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/dave/github/web3j-maven-example/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ web3j-maven-example ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 4 source files to /home/dave/github/web3j-maven-example/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ web3j-maven-example ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/dave/github/web3j-maven-example/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ web3j-maven-example ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ web3j-maven-example ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ web3j-maven-example ---
[INFO] Building jar: /home/dave/github/web3j-maven-example/target/web3j-maven-example-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ web3j-maven-example ---
[INFO] Installing /home/dave/github/web3j-maven-example/target/web3j-maven-example-1.0-SNAPSHOT.jar to /home/dave/.m2/repository/org/train/web3j-maven-example/1.0-SNAPSHOT/web3j-maven-example-1.0-SNAPSHOT.jar
[INFO] Installing /home/dave/github/web3j-maven-example/pom.xml to /home/dave/.m2/repository/org/train/web3j-maven-example/1.0-SNAPSHOT/web3j-maven-example-1.0-SNAPSHOT.pom



[dave@localhost web3j-maven-example]$ ls -R
.:
contracts  LICENSE  pom.xml  README.md  src  tutorial-images

./contracts:
build  solidity

./contracts/build:
greeter.abi  greeter.bin  mortal.abi  mortal.bin

./contracts/solidity:
Greeter.sol

./src:
main

./src/main:
java

./src/main/java:
org

./src/main/java/org:
train  web3j

./src/main/java/org/train:
FundsService.java  Greeting.java  VersionFinder.java

./src/main/java/org/web3j:
example

./src/main/java/org/web3j/example:
generated

./src/main/java/org/web3j/example/generated:
Greeter.java

./tutorial-images:
'Generate a Wallet.png'           'Rinkeby EtherScan.png'             'Setting Contract Value Output.png'
'Greetings Output.png'            'Rinkeby Faucet.png'                'Starting Local Ethereum Node.png'
'Local Node Sync Status.png'      'Sending Funds Local Node Log.png'  'VersionFinder Output.png'
'Rinkeby EtherScan Overview.png'  'Sending Funds Output.png'



Display version of Ethereum geth  client
[dave@localhost web3j-maven-example]$ mvn exec:java -Dexec.mainClass="org.train.VersionFinder"

Client version: Geth/v1.8.0-unstable-0662384d/linux-amd64/go1.8.5
Network version: 3


Download web3j CLI tools
https://github.com/web3j/web3j/releases/tag/v3.2.0

 Create  wallet
[dave@localhost bin]$ ./web3j wallet create

              _      _____ _     _        
             | |    |____ (_)   (_)       
__      _____| |__      / /_     _   ___  
\ \ /\ / / _ \ '_ \     \ \ |   | | / _ \ 
 \ V  V /  __/ |_) |.___/ / | _ | || (_) |
  \_/\_/ \___|_.__/ \____/| |(_)|_| \___/ 
                         _/ |             
                        |__/              

Please enter a wallet file password: 
Please re-enter the password: 
Please enter a destination directory location [/home/dave/.ethereum/testnet/keystore]: 
Wallet file UTC--2018-02-04T06-34-14.95000000Z--1234567890123456789012345678.json successfully created in: /home/dave/.ethereum/testnet/keystore


Check transactions on testnet
https://rinkeby.etherscan.io/address/

Getting ether from https://www.rinkeby.io/ "Crypto Faucet"
https://gist.github.com/cryptogoth/10a98e8078cfd69f7ca892ddbdcf26bc

Post wallet id on Google+ and then go to
https://www.rinkeby.io/#faucet

Check if Ether  transaction is properly finished on  https://rinkeby.etherscan.io/address/



Transaction Information
TxHash:
0xTX_HASH
TxReceipt Status: Success
Block Height: 1710713 (102 block confirmations)
TimeStamp: 25 mins ago (Feb-04-2018 07:48:00 AM +UTC)
From:  0xTO_WALLET_ADDRESS
To:0xFROM_WALLET_ADDRESS
Value: 3 Ether ($0.00)
Gas Limit: 21000
Gas Used By Txn: 21000
Gas Price: 0.000000004 Ether (4 Gwei)
Actual Tx Cost/Fee: 0.000084 Ether ($0.000000)
Cumulative Gas Used: 21000
Nonce: 5246


Block information


Block Information
  Height:     
   1710713  
  TimeStamp:     1 hr 4 mins ago (Feb-04-2018 07:48:00 AM +UTC)
  Transactions:     2 transactions and 0 contract internal transactions in this block
  Hash:     0xTX_HASH
  Parent Hash:     0xPARENT_TX_HASH
  Sha3Uncles:     0x1dcc4de8dec75d7aa45645645651b948a7413f0a142fd40d49347
  Mined By:     0xfc18cbc391de84dbd87466689f5dd91 in 15 secs
  Difficulty:     2
  Total Difficulty:     3,188,999
  Size:     864 bytes
  Gas Used:     5,033,664 (71.90%)
  Gas Limit:     7,001,200
  Nonce:     0x0000000000000000
  Block Reward:     0 Ether
  Uncles Reward:     


Fully synchronize geth client

dave@localhost go-ethereum]$ /home/dave/github/go-ethereum/build/bin/geth --fast --cache=512 --rpcapi personal,db,eth,net,web3 --rpc --testnet
INFO [02-04|09:33:58] Starting peer-to-peer node               instance=Geth/v1.8.0-unstable-0662384d/linux-amd64/go1.8.5
INFO [02-04|09:33:58] Allocated cache and file handles         database=/home/dave/.ethereum/testnet/geth/chaindata cache=512 handles=512
INFO [02-04|09:34:00] Initialised chain configuration          config="{ChainID: 3 Homestead: 0 DAO: <nil> DAOSupport: true EIP150: 0 EIP155: 10 EIP158: 10 Byzantium: 1700000 Engine: ethash}"
INFO [02-04|09:34:00] Disk storage enabled for ethash caches   dir=/home/dave/.ethereum/testnet/geth/ethash count=3
INFO [02-04|09:34:00] Disk storage enabled for ethash DAGs     dir=/home/dave/.ethash                       count=2
INFO [02-04|09:34:01] Initialising Ethereum protocol           versions="[63 62]" network=3
INFO [02-04|09:34:01] Loaded most recent local header          number=926234 hash=a2bb1a…990d6c td=642817207095421
INFO [02-04|09:34:01] Loaded most recent local full block      number=0      hash=419410…ca4a2d td=1048576
INFO [02-04|09:34:01] Loaded most recent local fast block      number=913040 hash=9c0570…0f970a td=627371749055334
INFO [02-04|09:34:01] Loaded local transaction journal         transactions=0 dropped=0
INFO [02-04|09:34:01] Upgrading chain index                    type=bloombits percentage=70
INFO [02-04|09:34:01] Regenerated local transaction journal    transactions=0 accounts=0
INFO [02-04|09:34:01] Starting P2P networking 
INFO [02-04|09:34:05] UDP listener up                          self=enode://9bbc55ed1cca170be4cba9c3ea76765cca170226dd7e363591d2a6738e55707cb58fa64764c9b1ead28174dbec81ec5721cb2452e625de6292fe36881d672a2@89.233.189.164:30303
INFO [02-04|09:34:05] RLPx listener up                         self=enode://9bbc55ed1cca170be4cba9c322680d2f956565635956565738e55707cb58fa64764c9b1ead28174dbec81ec5721cb2452e625de6292fe36881d672a2@89.233.189.164:30303
INFO [02-04|09:34:05] IPC endpoint opened: /home/dave/.ethereum/testnet/geth.ipc 
INFO [02-04|09:34:05] HTTP endpoint opened: http://127.0.0.1:8545 



[dave@localhost go-ethereum]$ du -h  /home/dave/.ethereum/
2.8M    /home/dave/.ethereum/geth/chaindata
20K    /home/dave/.ethereum/geth/nodes
2.9M    /home/dave/.ethereum/geth
60M    /home/dave/.ethereum/testnet/geth/ethash
2.0G    /home/dave/.ethereum/testnet/geth/chaindata
6.2M    /home/dave/.ethereum/testnet/geth/nodes
2.0G    /home/dave/.ethereum/testnet/geth
8.0K    /home/dave/.ethereum/testnet/keystore
2.0G    /home/dave/.ethereum/testnet
4.0K    /home/dave/.ethereum/keystore
2.0G    /home/dave/.ethereum/



Without properly finished transaction you will get following error

java.util.concurrent.ExecutionException: java.lang.RuntimeException: Error processing transaction request: insufficient funds for gas * price + value


Run the test code
mvn exec:java -Dexec.mainClass="org.train.FundsService"

 
Transfer funds using web3j test code

package org.train;

import java.io.IOException;
import java.math.BigDecimal;
import java.util.concurrent.ExecutionException;

import org.web3j.crypto.CipherException;
import org.web3j.crypto.Credentials;
import org.web3j.crypto.WalletUtils;
import org.web3j.protocol.Web3j;
import org.web3j.protocol.core.methods.response.TransactionReceipt;
import org.web3j.protocol.exceptions.TransactionTimeoutException;
import org.web3j.protocol.http.HttpService;
import org.web3j.tx.Transfer;
import org.web3j.utils.Convert;

public class FundsService {
    public static void main(String[] args) throws IOException, CipherException, InterruptedException,
                                                    ExecutionException, TransactionTimeoutException {
        Web3j web3 = Web3j.build(new HttpService());
        String walletId = "<WALLET_ADDRESS>";
        String walletSource = "/home/dave/.ethereum/testnet/keystore/UTC--2018-02-04T06-34-14.95000000Z--" + walletId + "" +
                ".json";
        Credentials credentials = WalletUtils.loadCredentials("<WALLET_PASSWORD>", walletSource);
        String myWalletAddr = "0x" + walletId;
        TransactionReceipt transactionReceipt = Transfer.sendFundsAsync(web3, credentials, myWalletAddr,
                BigDecimal.valueOf(0.2), Convert.Unit.ETHER).get();
        System.out.println("Funds transfer completed...");
        System.out.println("Hash: " + transactionReceipt.getBlockHash());
        System.out.println("Block number: " + transactionReceipt.getBlockNumber());
    }
}

Sunday, October 15, 2017

Build Weblogic Docker image

Oracle Docker image repository https://github.com/oracle/docker-images


Weblogic image https://github.com/oracle/docker-images/tree/master/OracleWebLogic


1. Build Java image

Download latest Java 8 JRE

dave@localhost docker-images]$ ls -1 ./OracleJava/java-8
build.sh
Dockerfile
server-jre-8u131-linux-x64.tar.gz.download
server-jre-8u144-linux-x64.tar.gz



2. Build Weblogic 12.2.1.2 image

Download Weblogic 12.2.1 installer  http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html

[dave@localhost docker-images]$ ls -1 ./OracleWebLogic/dockerfiles/
12.1.3
12.2.1
12.2.1.1
12.2.1.2
buildDockerImage.sh
[dave@localhost docker-images]$ ls -1 ./OracleWebLogic/dockerfiles/12.2.1.2
Checksum.developer
Checksum.generic
container-scripts
Dockerfile.developer
Dockerfile.generic
fmw_12.2.1.2.0_wls_Disk1_1of1.zip
fmw_12.2.1.2.0_wls_Disk1_1of1.zip.download
fmw_12.2.1.2.0_wls_quick_Disk1_1of1.zip.download
install.file
oraInst.loc
README.md


Run script
./OracleWebLogic/dockerfiles/buildDockerImage.sh -v 12.2.1.2 -g

[dave@localhost dockerfiles]$ ./buildDockerImage.sh -v 12.2.1.2 -g
Checking if required packages are present and valid...
fmw_12.2.1.2.0_wls_Disk1_1of1.zip: OK
md5sum: WARNING: 1 line is improperly formatted
=====================
Building image 'oracle/weblogic:12.2.1.2-generic' ...
Sending build context to Docker daemon  829.6MB
Step 1/13 : FROM oracle/serverjre:8
 ---> 51c243388334
Step 2/13 : MAINTAINER Monica Riccelli <monica.riccelli@oracle.com>
 ---> Running in 3cc123fdaa4f
Removing intermediate container 3cc123fdaa4f
 ---> 092fff463648
Step 3/13 : ENV ORACLE_HOME=/u01/oracle     USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom"     SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh     PATH=$PATH:/usr/java/default/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
 ---> Running in 04c6eea7844c
Removing intermediate container 04c6eea7844c
 ---> 0a29fe157ea7
Step 4/13 : RUN mkdir -p /u01 &&     chmod a+xr /u01 &&     useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle
 ---> Running in 33d5472a0320
Removing intermediate container 33d5472a0320
 ---> 289030b6953d
Step 5/13 : COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py /u01/oracle/
 ---> d21b12b16163
Step 6/13 : ENV DOMAIN_NAME="${DOMAIN_NAME:-base_domain}"     DOMAIN_HOME=/u01/oracle/user_projects/domains/${DOMAIN_NAME:-base_domain}     ADMIN_PORT="${ADMIN_PORT:-7001}"     ADMIN_USERNAME="${ADMIN_USERNAME:-weblogic}"     ADMIN_NAME="${ADMIN_NAME:-AdminServer}"     ADMIN_PASSWORD="${ADMIN_PASSWORD:-""}"
 ---> Running in f83a3bad5d97
Removing intermediate container f83a3bad5d97
 ---> 6bb5a3073c44
Step 7/13 : ENV FMW_PKG=fmw_12.2.1.2.0_wls_Disk1_1of1.zip     FMW_JAR=fmw_12.2.1.2.0_wls.jar
 ---> Running in 4e716494a790
Removing intermediate container 4e716494a790
 ---> 76fdd9a2493d
Step 8/13 : COPY $FMW_PKG install.file oraInst.loc /u01/
 ---> 1407f6c45390
Step 9/13 : RUN  chown oracle:oracle -R /u01 &&      chmod +xr $SCRIPT_FILE
 ---> Running in 0c24be9827e6
Removing intermediate container 0c24be9827e6
 ---> 5eaf260ec2af
Step 10/13 : USER oracle
 ---> Running in a069a933c070
Removing intermediate container a069a933c070
 ---> 0fa1e8c0908c
Step 11/13 : RUN cd /u01 && $JAVA_HOME/bin/jar xf /u01/$FMW_PKG && cd - &&     $JAVA_HOME/bin/java -jar /u01/$FMW_JAR -silent -responseFile /u01/install.file -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME INSTALL_TYPE="WebLogic Server" &&     rm /u01/$FMW_JAR /u01/$FMW_PKG /u01/oraInst.loc /u01/install.file
 ---> Running in 9ff357945a0c
/
Launcher log file is /tmp/OraInstall2017-10-15_01-59-00PM/launcher2017-10-15_01-59-00PM.log.
Extracting the installer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Done
Checking if CPU speed is above 300 MHz.   Actual 2494.393 MHz    Passed
Checking swap space: must be greater than 512 MB.   Actual 3855 MB    Passed
Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)
Checking temp space: must be greater than 300 MB.   Actual 7520 MB    Passed


Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2017-10-15_01-59-00PM
Log: /tmp/OraInstall2017-10-15_01-59-00PM/install2017-10-15_01-59-00PM.log
Setting ORACLE_HOME to /u01/oracle
Setting INSTALL_TYPE to WebLogic Server
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
Reading response file..
Skipping Software Updates
Validations are disabled for this session.
Verifying data
Copying Files
Percent Complete : 10
Percent Complete : 20
Percent Complete : 30
Percent Complete : 40
Percent Complete : 50
Percent Complete : 60
Percent Complete : 70
Percent Complete : 80
Percent Complete : 90
Percent Complete : 100

The installation of Oracle Fusion Middleware 12c WebLogic Server and Coherence 12.2.1.2.0 completed successfully.
Logs successfully copied to /u01/oracle/.inventory/logs.
Removing intermediate container 9ff357945a0c
 ---> 6a5a31abe912
Step 12/13 : WORKDIR ${ORACLE_HOME}
Removing intermediate container 0d6b38ee3a57
 ---> a5172a9ffdf3
Step 13/13 : CMD ["/u01/oracle/createAndStartEmptyDomain.sh"]
 ---> Running in bdfedddc7b2e
Removing intermediate container bdfedddc7b2e
 ---> 692cfcc733f2
Successfully built 692cfcc733f2
Successfully tagged oracle/weblogic:12.2.1.2-generic

  WebLogic Docker Image for 'generic' version 12.2.1.2 is ready to be extended: 
    
    --> oracle/weblogic:12.2.1.2-generic

  Build completed in 981 seconds.



List Docker images
[dave@localhost dockerfiles]$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
oracle/weblogic     12.2.1.2-generic    692cfcc733f2        2 minutes ago       2.77GB
oracle/serverjre    8                   51c243388334        About an hour ago   269MB
oraclelinux         7-slim              c0feb50f7527        2 months ago        118MB
wildfly-mgmt        latest              3ea63bcef45a        11 months ago       583MB
docker-whale        latest              04c2ee13ff82        12 months ago       256MB
ubuntu              latest              c73a085dc378        12 months ago       127MB
jboss/wildfly       latest              4c99bd2cd264        13 months ago       583MB
hello-world         latest              c54a2cc56cbb        15 months ago       1.85kB
docker/whalesay     latest              6b362a9f73eb        2 years ago         247MB


Build Weblogic domain image

Go to dir
/home/dave/docker/docker-images/OracleWebLogic/samples/12212-domain

Run
docker build -t 12212-domain .

[dave@localhost 12212-domain]$ docker build -t 12212-domain .
Sending build context to Docker daemon   29.7kB
Step 1/10 : FROM oracle/weblogic:12.2.1.2-generic
 ---> 692cfcc733f2
Step 2/10 : MAINTAINER Monica Riccelli <monica.riccelli@oracle.com>
 ---> Running in b6c764bf4555
 ---> c42ce3fb8dc0
Step 3/10 : ENV ADMIN_HOST="wlsadmin"     NM_PORT="5556"     MS_PORT="8001"     DEBUG_PORT="8453"     ORACLE_HOME=/u01/oracle     SCRIPT_FILE=/u01/oracle/createAndStartWLSDomain.sh     CONFIG_JVM_ARGS="-Dweblogic.security.SSL.ignoreHostnameVerification=true"      PATH=$PATH:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:/u01/oracle/user_projects/domains/${DOMAIN_NAME:-base_domain}/bin:/u01/oracle
 ---> Running in 2a8fc02da8bf
 ---> b10912a412d6
Step 4/10 : ENV DOMAIN_NAME="${DOMAIN_NAME:-base_domain}"     PRE_DOMAIN_HOME=/u01/oracle/user_projects/domains     ADMIN_PORT="${ADMIN_PORT:-7001}"      ADMIN_USERNAME="${ADMIN_USERNAME:-weblogic}"     ADMIN_NAME="${ADMIN_NAME:-AdminServer}"     ADMIN_PASSWORD="${ADMIN_PASSWORD:-weblogic123}"     CLUSTER_NAME="${CLUSTER_NAME:-DockerCluster}"     DEBUG_FLAG=true     PRODUCTION_MODE=dev
 ---> Running in 0a8c04cdceb4
 ---> 98988294cf7c
Step 5/10 : COPY container-scripts/* /u01/oracle/
 ---> 6552e8159b31
Step 6/10 : RUN mkdir -p $PRE_DOMAIN_HOME &&     chmod a+xr $PRE_DOMAIN_HOME &&     chown oracle:oracle -R $PRE_DOMAIN_HOME
 ---> Running in d98390d3d688
 ---> 7344002fdbc5
Step 7/10 : EXPOSE $NM_PORT $ADMIN_PORT $MS_PORT $DEBUG_PORT
 ---> Running in 4b5af2a7a1f7
 ---> b76eba7d94a0
Step 8/10 : USER oracle
 ---> Running in 41d00ab1aff6
 ---> 201878e35274
Step 9/10 : WORKDIR $ORACLE_HOME
 ---> d763bf1840a0
Step 10/10 : CMD ["/u01/oracle/createAndStartWLSDomain.sh"]
 ---> Running in 3782f7fc5ba1
 ---> 187bd2277dd8
Removing intermediate container 4b5af2a7a1f7
Removing intermediate container 41d00ab1aff6
Removing intermediate container 48eef663f19a
Removing intermediate container 3782f7fc5ba1
Removing intermediate container b6c764bf4555
Removing intermediate container 2a8fc02da8bf
Removing intermediate container 0a8c04cdceb4
Removing intermediate container d98390d3d688
Successfully built 187bd2277dd8
Successfully tagged 12212-domain:latest
[dave@localhost 12212-domain]$ 


List Docker images
[dave@localhost dockerfiles]$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
12212-domain        latest              187bd2277dd8        2 minutes ago       2.77GB
oracle/weblogic     12.2.1.2-generic    692cfcc733f2        11 minutes ago      2.77GB
oracle/serverjre    8                   51c243388334        About an hour ago   269MB
oraclelinux         7-slim              c0feb50f7527        2 months ago        118MB
wildfly-mgmt        latest              3ea63bcef45a        11 months ago       583MB


Run the domain image
[dave@localhost dockerfiles]$ docker run -d --name=wlsadmin -p 7001:7001 12212-domain
dd00fa33169ac3c4fbed8df3374632766ce4601694f8434c48b8d8814f9b12f0
[dave@localhost dockerfiles]$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                                                  NAMES
dd00fa33169a        12212-domain        "/u01/oracle/creat..."   30 seconds ago      Up 25 seconds       5556/tcp, 8001/tcp, 8453/tcp, 0.0.0.0:7001->7001/tcp   wlsadmin


Wait for start and then check the Weblogic console via http://localhost:7001/console

Sunday, September 17, 2017

Weblogic 12.2.1 - build webservice using jwsc Ant task

We want to test Ant jwsc task on Weblogic 12.2.1 server 

This blog is used to start project
https://www.igorkromin.net/index.php/2015/04/28/an-example-build-system-using-jwsc-and-wldeploy-weblogic-tasks/

Another blog https://gerardnico.com/wiki/weblogic/web_service

Weblogic documetation for  weblogic.wsee.tools.anttasks.JwscTask
 http://docs.oracle.com/middleware/1221/wls/WSGET/jax-ws-setenv.htm#WSGET136


Project structure

dave@localhost jwsc-ant-webservice]$ ls -R1
.:
build
build-base.xml
build.properties
build.xml
dist
lib
src

./build:
META-INF
WsExample.war

./build/META-INF:
application.xml
weblogic-application.xml

./dist:
WsExample.ear

./lib:

./src:
org

./src/org:
dave

./src/org/dave:
SayHello.java

Copy of code https://github.com/dveselka/weblogic

Webservice source code  ( from Weblogic Maven  sample ) - see here http://danielveselka.blogspot.cz/2017/09/weblogic-122-1-implement-webservice.html

[dave@localhost jwsc-ant-webservice]$ more ../dave-basic-webservice-project/src/main/java/org/dave/SayHello.java 
package org.dave;

// Import the standard JWS annotation interfaces

import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;

// Standard JWS annotation that specifies that the name of the Web Service is
// "Simple" and the targetNamespace used in the generated WSDL is 
// "http://example.org"
@WebService(name="SayHello", targetNamespace="http://example.org", serviceName = "SayHello")

// Standard JWS annotation that specifies the mapping of the service onto the
// SOAP message protocol.
@SOAPBinding(style=SOAPBinding.Style.DOCUMENT,
             use=SOAPBinding.Use.LITERAL,
             parameterStyle=SOAPBinding.ParameterStyle.WRAPPED)

/**
 * This JWS file forms the basis of a simple WebLogic Web Service with a 
 * single operation: sayHello
 *
 * @author Copyright (c) 1999,2013, Oracle and/or its affiliates. All rights reserved.
 */

public class SayHello {

  // Required constructor

  public SayHello() {}

  // Standard JWS annotation that specifies that the method should be exposed
  // as a public operation.  Because the annotation does not include the
  // member-value "operationName", the public name of the operation is the
  // same as the method name: sayHello.

  @WebMethod()
  public String sayHello(String message) {
    System.out.println("sayHello:" + message);
    return "Here is the message: '" + message + "'";
  }
}

Compilation requires multiple jars or Weblogic installation reference in libs.dir

[dave@localhost jwsc-ant-webservice]$ more build.properties 
# WLS details
wls.adminurl=t3://localhost:7001
wls.targets=AdminServer
wls.user=weblogic
wls.passwd=SOME_PASSWORD
# Directories
libs.dir=/app/weblogic-12.2.1/wlserver/server/lib
build.dir=build
dist.dir=dist
src.dir=src
# WS details
ws.name=WsExample
ws.context=wsexample
ws.jwsfile=org/dave/SayHello.java
ws.keepgenerated=yes


Deploy webservice

[dave@localhost jwsc-ant-webservice]$ ant -p
Buildfile: /home/dave/git/weblogic/jwsc-ant-webservice/build.xml

Main targets:

Other targets:

 all
 build-fail
 build-service
 clean
 deploy-service
 init
Default target: all
[dave@localhost jwsc-ant-webservice]$ ant deploy-service
Buildfile: /home/dave/git/weblogic/jwsc-ant-webservice/build.xml

init:

build-service:
     [jwsc] warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
     [jwsc] JWS: processing module WsExample
     [jwsc] Parsing source files
     [jwsc] Parsing source files
     [jwsc] 1 JWS files being processed for module WsExample
     [jwsc] JWS: /home/dave/git/weblogic/jwsc-ant-webservice/src/org/dave/SayHello.java Validated.
     [jwsc] Processing 1 JAX-WS web services...
     [jwsc] Compiling 3 source files to /tmp/_9ddhhq
     [jwsc] Deleting existing module outputFile /home/dave/git/weblogic/jwsc-ant-webservice/build/WsExample.war
     [jwsc] Building jar: /home/dave/git/weblogic/jwsc-ant-webservice/build/WsExample.war
     [jwsc] Created JWS deployment outputFile: /home/dave/git/weblogic/jwsc-ant-webservice/build/WsExample.war
     [jwsc] [EarFile] Application File : /home/dave/git/weblogic/jwsc-ant-webservice/build/META-INF/application.xml
[AntUtil.deleteDir] Deleting directory /tmp/_9ddhhq
      [ear] Building ear: /home/dave/git/weblogic/jwsc-ant-webservice/dist/WsExample.ear

deploy-service:
 [wldeploy] weblogic.Deployer -noexit -name WsExample -targets AdminServer -adminurl t3://localhost:7001 -user weblogic -password ******** -undeploy 
 [wldeploy] weblogic.Deployer invoked with options:  -noexit -name WsExample -targets AdminServer -adminurl t3://localhost:7001 -user weblogic -undeploy
 [wldeploy] <Sep 17, 2017 12:46:48 PM CEST> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating undeploy operation for application, WsExample [archive: null], to AdminServer .> 



Test webservice using  http://localhost:7001/wsexample/SayHello


Endpoint     Information
Service Name:    {http://example.org}SayHello
Port Name:    {http://example.org}SayHelloPort
    
Address:    http://localhost:7001/wsexample/SayHello
WSDL:    http://localhost:7001/wsexample/SayHello?wsdlTest
Implementation class:    org.dave.SayHello


WSDL  http://localhost:7001/wsexample/SayHello?wsdl

<?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.11-b150616.1732 svn-revision#a247ba216861f2c0baac9a3657c5690bce0c744d. --><!-- Generated by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.11-b150616.1732 svn-revision#a247ba216861f2c0baac9a3657c5690bce0c744d. --><definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://example.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://example.org" name="SayHello">
<types>
<xsd:schema>
<xsd:import namespace="http://example.org" schemaLocation="http://localhost:7001/wsexample/SayHello?xsd=1"/>
</xsd:schema>
</types>
<message name="sayHello">
<part name="parameters" element="tns:sayHello"/>
</message>
<message name="sayHelloResponse">
<part name="parameters" element="tns:sayHelloResponse"/>
</message>
<portType name="SayHello">
<operation name="sayHello">
<input wsam:Action="http://example.org/SayHello/sayHelloRequest" message="tns:sayHello"/>
<output wsam:Action="http://example.org/SayHello/sayHelloResponse" message="tns:sayHelloResponse"/>
</operation>
</portType>
<binding name="SayHelloPortBinding" type="tns:SayHello">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="sayHello">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="SayHello">
<port name="SayHelloPort" binding="tns:SayHelloPortBinding">
<soap:address location="http://localhost:7001/wsexample/SayHello"/>
</port>
</service>
</definitions>

Test result:

request
    request-1505645963920

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header/>
    <soap:Body>
        <ns1:sayHello xmlns:ns1="http://example.org">
            <arg0>dave</arg0>
        </ns1:sayHello>
    </soap:Body>
</soap:Envelope>



response:

    response-1505645964157

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
        <ns0:sayHelloResponse xmlns:ns0="http://example.org">
            <return>Here is the message: 'dave'</return>
        </ns0:sayHelloResponse>
    </S:Body>
</S:Envelope>