Showing posts with label MicroProfile. Show all posts
Showing posts with label MicroProfile. Show all posts

Sunday, November 17, 2019

Deploying microservices to Kubernetes using OpenLiberty


OpenLiberty sample github
https://github.com/OpenLiberty/guide-kubernetes-intro

OpenLiberty tutorial
https://openliberty.io/guides/kubernetes-intro.html#what-youll-learn

MiniKubernetes installation guide
https://github.com/kubernetes/minikube#installation

Minikube Linux install
https://minikube.sigs.k8s.io/docs/start/linux/

Fedora Getting started with virtualization
https://docs.fedoraproject.org/en-US/quick-docs/getting-started-with-virtualization/


Dependencies resolved. 
================================================================================================================================================== 
 Package                                      Architecture                Version                               Repository                   Size 
================================================================================================================================================== 
Installing group/module packages: 
 virt-install                                 noarch                      2.2.1-2.fc31                          fedora                       64 k 
 virt-manager                                 noarch                      2.2.1-2.fc31                          fedora                      543 k 
 virt-viewer                                  x86_64                      8.0-3.fc31                            fedora                      404 k 
Installing dependencies: 
 autogen-libopts                              x86_64                      5.18.16-3.fc31                        fedora                       75 k 
 gnutls-dane                                  x86_64                      3.6.10-1.fc31                         fedora                       27 k 
 gnutls-utils                                 x86_64                      3.6.10-1.fc31                         fedora                      341 k 
 libgovirt                                    x86_64                      0.3.4-9.fc30                          fedora                       71 k 
 libvirt-bash-completion                      x86_64                      5.6.0-4.fc31                          fedora                       12 k 
 libvirt-client                               x86_64                      5.6.0-4.fc31                          fedora                      343 k 
 python3-libvirt                              x86_64                      5.6.0-1.fc31                          fedora                      294 k 
 virt-manager-common                          noarch                      2.2.1-2.fc31                          fedora                      1.0 M 
Installing Groups: 
 Virtualization            


dave@localhost finish]$ sudo systemctl start libvirtd
[dave@localhost finish]$ sudo systemctl enable libvirtd
Created symlink /etc/systemd/system/sockets.target.wants/libvirtd.socket → /usr/lib/systemd/system/libvirtd.socket.
Created symlink /etc/systemd/system/sockets.target.wants/libvirtd-ro.socket → /usr/lib/systemd/system/libvirtd-ro.socket.
[dave@localhost finish]$ lsmod | grep kvm
kvm_intel             299008  0
kvm                   770048  1 kvm_intel
irqbypass              16384  1 kvm


Some errors appear in virt validation

[dave@localhost finish]$ virt-host-validate
  QEMU: Checking for hardware virtualization                                 : PASS
  QEMU: Checking if device /dev/kvm exists                                   : PASS
  QEMU: Checking if device /dev/kvm is accessible                            : PASS
  QEMU: Checking if device /dev/vhost-net exists                             : PASS
  QEMU: Checking if device /dev/net/tun exists                               : PASS
  QEMU: Checking for cgroup 'cpu' controller support                         : WARN (Enable 'cpu' in kernel Kconfig file or mount/enable cgroup controller in your system)
  QEMU: Checking for cgroup 'cpuacct' controller support                     : PASS
  QEMU: Checking for cgroup 'cpuset' controller support                      : WARN (Enable 'cpuset' in kernel Kconfig file or mount/enable cgroup controller in your system)
  QEMU: Checking for cgroup 'memory' controller support                      : PASS
  QEMU: Checking for cgroup 'devices' controller support                     : WARN (Enable 'devices' in kernel Kconfig file or mount/enable cgroup controller in your system)
  QEMU: Checking for cgroup 'blkio' controller support                       : WARN (Enable 'blkio' in kernel Kconfig file or mount/enable cgroup controller in your system)
  QEMU: Checking for device assignment IOMMU support                         : PASS
  QEMU: Checking if IOMMU is enabled by kernel                               : WARN (IOMMU appears to be disabled in kernel. Add intel_iommu=on to kernel cmdline arguments)
   LXC: Checking for Linux >= 2.6.26                                         : PASS
   LXC: Checking for namespace ipc                                           : PASS
   LXC: Checking for namespace mnt                                           : PASS
   LXC: Checking for namespace pid                                           : PASS
   LXC: Checking for namespace uts                                           : PASS
   LXC: Checking for namespace net                                           : PASS
   LXC: Checking for namespace user                                          : PASS
   LXC: Checking for cgroup 'cpu' controller support                         : FAIL (Enable 'cpu' in kernel Kconfig file or mount/enable cgroup controller in your system)
   LXC: Checking for cgroup 'cpuacct' controller support                     : PASS
   LXC: Checking for cgroup 'cpuset' controller support                      : FAIL (Enable 'cpuset' in kernel Kconfig file or mount/enable cgroup controller in your system)
   LXC: Checking for cgroup 'memory' controller support                      : PASS
   LXC: Checking for cgroup 'devices' controller support                     : FAIL (Enable 'devices' in kernel Kconfig file or mount/enable cgroup controller in your system)
   LXC: Checking for cgroup 'freezer' controller support                     : FAIL (Enable 'freezer' in kernel Kconfig file or mount/enable cgroup controller in your system)
   LXC: Checking for cgroup 'blkio' controller support                       : FAIL (Enable 'blkio' in kernel Kconfig file or mount/enable cgroup controller in your system)
   LXC: Checking if device /sys/fs/fuse/connections exists                   : PASS


[root@localhost ~]# sudo dnf config-manager --add-repo=https://download.docker.com/linux/fedora/docker-ce.repo

Adding repo from: https://download.docker.com/linux/fedora/docker-ce.repo

 


After Docker installtion all tests pass

[root@localhost ~]# virt-host-validate

  QEMU: Checking for hardware virtualization                                 : PASS

  QEMU: Checking if device /dev/kvm exists                                   : PASS

  QEMU: Checking if device /dev/kvm is accessible                            : PASS

  QEMU: Checking if device /dev/vhost-net exists                             : PASS

  QEMU: Checking if device /dev/net/tun exists                               : PASS

  QEMU: Checking for cgroup 'cpu' controller support                         : PASS

  QEMU: Checking for cgroup 'cpuacct' controller support                     : PASS

  QEMU: Checking for cgroup 'cpuset' controller support                      : PASS

  QEMU: Checking for cgroup 'memory' controller support                      : PASS

  QEMU: Checking for cgroup 'devices' controller support                     : PASS

  QEMU: Checking for cgroup 'blkio' controller support                       : PASS

  QEMU: Checking for device assignment IOMMU support                         : PASS

  QEMU: Checking if IOMMU is enabled by kernel                               : WARN (IOMMU appears to be disabled in kernel. Add intel_iommu=on to kernel cmdline arguments)

   LXC: Checking for Linux >= 2.6.26                                         : PASS

   LXC: Checking for namespace ipc                                           : PASS

   LXC: Checking for namespace mnt                                           : PASS

   LXC: Checking for namespace pid                                           : PASS

   LXC: Checking for namespace uts                                           : PASS

   LXC: Checking for namespace net                                           : PASS

   LXC: Checking for namespace user                                          : PASS

   LXC: Checking for cgroup 'cpu' controller support                         : PASS

   LXC: Checking for cgroup 'cpuacct' controller support                     : PASS

   LXC: Checking for cgroup 'cpuset' controller support                      : PASS

   LXC: Checking for cgroup 'memory' controller support                      : PASS

   LXC: Checking for cgroup 'devices' controller support                     : PASS

   LXC: Checking for cgroup 'freezer' controller support                     : PASS

   LXC: Checking for cgroup 'blkio' controller support                       : PASS

   LXC: Checking if device /sys/fs/fuse/connections exists                   : PASS

 


Install minikube
https://minikube.sigs.k8s.io/docs/start/linux/



 
Download and install minikube to /usr/local/bin:

 
 curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \

   && sudo install minikube-linux-amd64 /usr/local/bin/minikube

 
 


Start minukube

[dave@localhost ~]$ minikube start --vm-driver=kvm2

😄  minikube v1.5.2 on Fedora 31

✨  Automatically selected the 'kvm2' driver (alternates: [none])

💾  Downloading driver docker-machine-driver-kvm2:

    > docker-machine-driver-kvm2.sha256: 65 B / 65 B [-------] 100.00% ? p/s 0s

    > docker-machine-driver-kvm2: 13.87 MiB / 13.87 MiB  100.00% 8.94 MiB p/s 2

💿  Downloading VM boot image ...

    > minikube-v1.5.1.iso.sha256: 65 B / 65 B [--------------] 100.00% ? p/s 0s

    > minikube-v1.5.1.iso: 143.76 MiB / 143.76 MiB [-] 100.00% 17.68 MiB p/s 9s

🔥  Creating kvm2 VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...

 

dave@localhost ~]$ minikube start

😄  minikube v1.5.2 on Fedora 31

💡  Tip: Use 'minikube start -p <name>' to create a new cluster, or 'minikube delete' to delete this one.

🏃  Using the running kvm2 "minikube" VM ...

⌛  Waiting for the host to be provisioned ...

🐳  Preparing Kubernetes v1.16.2 on Docker '18.09.9' ...

💾  Downloading kubeadm v1.16.2

💾  Downloading kubelet v1.16.2

🔄  Relaunching Kubernetes using kubeadm ... 

 

Need to work on virtual host configuration

🔄  Relaunching Kubernetes using kubeadm ... 

  
💣  Error restarting cluster: waiting for apiserver: apiserver process never appeared

 


Need to download and install Fedora 31 image

Create storage

dd if=/dev/zero of=/var/lib/libvirt/images/guest.img bs=1M count=20480


Download ISO image at https://getfedora.org/en/workstation/download/

 root@localhost ~]# cp /home/dave/Downloads/Fedora-Workstation-Live-x86_64-31-1.9.iso /var/lib/libvirt/images/Fedora-Workstation-31/
 root@localhost ~]# virt-install --name Fedora31 --description 'Fedora 31 Workstation' --ram 4096 --vcpus 2 --disk path=/var/lib/libvirt/images/Fedora-Workstation-31/Fedora-Workstation-31-20180518.0.x86_64.qcow2,size=20 --os-type linux --os-variant fedora31 --network bridge=virbr0 --graphics vnc,listen=127.0.0.1,port=5901 --cdrom /var/lib/libvirt/images/Fedora-Workstation-31/Fedora-Workstation-Live-x86_64-31-1.9.iso --noautoconsole

Install Kubernetes client
[root@localhost ~]# dnf install kubernetes-client

 


dave@localhost ~]$  kubectl get po -A

NAMESPACE     NAME                               READY   STATUS    RESTARTS   AGE

kube-system   coredns-5644d7b6d9-hgfrq           1/1     Running   0          3m27s

kube-system   coredns-5644d7b6d9-rh2wp           1/1     Running   0          3m27s

kube-system   etcd-minikube                      1/1     Running   0          2m24s

kube-system   kube-addon-manager-minikube        1/1     Running   0          3m37s

kube-system   kube-apiserver-minikube            1/1     Running   0          2m16s

kube-system   kube-controller-manager-minikube   1/1     Running   0          2m24s

kube-system   kube-proxy-brljs                   1/1     Running   0          3m26s

kube-system   kube-scheduler-minikube            1/1     Running   0          2m18s

kube-system   storage-provisioner                1/1     Running   0          3m25s

 

[dave@localhost guide-kubernetes-intro]$ ls

finish  LICENSE  README.adoc  scripts  start

[dave@localhost guide-kubernetes-intro]$ cd finish/

[dave@localhost finish]$ kubectl get nodes

NAME       STATUS   ROLES    AGE     VERSION

minikube   Ready    master   5m24s   v1.16.2

 


Follow the OpenLiberty guide

 https://openliberty.io/guides/kubernetes-intro.html#building-and-containerizing-the-microservices


https://openliberty.io/guides/kubernetes-intro.html#building-and-containerizing-the-microservices

[INFO] Reactor Summary for guide-kubernetes-intro 1.0-SNAPSHOT:

[INFO] 

[INFO] guide-kubernetes-intro ............................. SUCCESS [  0.114 s]

[INFO] system ............................................. SUCCESS [ 56.164 s]

[INFO] inventory .......................................... SUCCESS [  3.497 s]

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  01:01 min

[INFO] Finished at: 2019-11-23T14:51:32+01:00

[INFO] ------------------------------------------------------------------------

 



Build Docker images

[dave@localhost finish]$ docker build -t system:1.0-SNAPSHOT system/.

Sending build context to Docker daemon  173.1MB

Step 1/2 : FROM open-liberty

latest: Pulling from library/open-liberty

7ddbc47eeb70: Pull complete 

c1bbdc448b72: Pull complete 

8c3b70e39044: Pull complete 

45d437916d57: Pull complete 

da4c04c54fa4: Pull complete 

8f6c6858a836: Pull complete 

5d00a703c295: Pull complete 

cb8753aefdab: Pull complete 

973c4edce328: Pull complete 

768f5576235d: Pull complete 

03125c94a5ec: Pull complete 

Digest: sha256:c23b036bed7bd0dec141db5bbde186fb617fd67f4d2db4c1a7793eb483354fc9

Status: Downloaded newer image for open-liberty:latest

 ---> 33db8778e38a

Step 2/2 : ADD --chown=1001:0 target/system.tar.gz /opt/ol

 ---> 63fb2879e723

Successfully built 63fb2879e723

Successfully tagged system:1.0-SNAPSHOT

 


Build inventory image
[dave@localhost finish]$ docker build -t inventory:1.0-SNAPSHOT inventory/.

Sending build context to Docker daemon    174MB

Step 1/2 : FROM open-liberty

 ---> 33db8778e38a

Step 2/2 : ADD --chown=1001:0 target/inventory.tar.gz /opt/ol

 ---> c2f7faff812d

Successfully built c2f7faff812d

Successfully tagged inventory:1.0-SNAPSHOT

 


List of Docker images

[dave@localhost finish]$ docker images

REPOSITORY                                TAG                 IMAGE ID            CREATED              SIZE

inventory                                 1.0-SNAPSHOT        c2f7faff812d        44 seconds ago       393MB

system                                    1.0-SNAPSHOT        63fb2879e723        About a minute ago   393MB

open-liberty                              latest              33db8778e38a        2 weeks ago          392MB

k8s.gcr.io/kube-proxy                     v1.16.2             8454cbe08dc9        5 weeks ago          86.1MB

k8s.gcr.io/kube-controller-manager        v1.16.2             6e4bffa46d70        5 weeks ago          163MB

k8s.gcr.io/kube-apiserver                 v1.16.2             c2c9a0406787        5 weeks ago          217MB

k8s.gcr.io/kube-scheduler                 v1.16.2             ebac1ae204a2        5 weeks ago          87.3MB

k8s.gcr.io/etcd                           3.3.15-0            b2756210eeab        2 months ago         247MB

k8s.gcr.io/coredns                        1.6.2               bf261d157914        3 months ago         44.1MB

k8s.gcr.io/kube-addon-manager             v9.0.2              bd12a212f9dc        4 months ago         83.1MB

k8s.gcr.io/kube-addon-manager             v9.0                119701e77cbc        10 months ago        83.1MB

k8s.gcr.io/kubernetes-dashboard-amd64     v1.10.1             f9aed6605b81        11 months ago        122MB

k8s.gcr.io/k8s-dns-sidecar-amd64          1.14.13             4b2e93f0133d        14 months ago        42.9MB

k8s.gcr.io/k8s-dns-kube-dns-amd64         1.14.13             55a3c5209c5e        14 months ago        51.2MB

k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64    1.14.13             6dc8ef8287d3        14 months ago        41.4MB

k8s.gcr.io/pause                          3.1                 da86e6ba6ca1        23 months ago        742kB

gcr.io/k8s-minikube/storage-provisioner   v1.8.1              4689081edb10        2 years ago          80.8MB

 


kubernetes.yaml
apiVersion: apps/v1

kind: Deployment

metadata:

  name: system-deployment

  labels:

    app: system

spec:

  selector:

    matchLabels:

      app: system

  template:

    metadata:

      labels:

        app: system

    spec:

      containers:

      - name: system-container

        image: system:1.0-SNAPSHOT

        ports:

        - containerPort: 9080

---

apiVersion: apps/v1

kind: Deployment

metadata:

  name: inventory-deployment

  labels:

    app: inventory

spec:

  selector:

    matchLabels:

      app: inventory

  template:

    metadata:

      labels:

        app: inventory

    spec:

      containers:

      - name: inventory-container

        image: inventory:1.0-SNAPSHOT

        ports:

        - containerPort: 9080

---

apiVersion: v1

kind: Service

metadata:

  name: system-service

spec:

  type: NodePort

  selector:

    app: system

  ports:

  - protocol: TCP

    port: 9080

    targetPort: 9080

    nodePort: 31000

---

apiVersion: v1

kind: Service

metadata:

  name: inventory-service

spec:

  type: NodePort

  selector:

    app: inventory

  ports:

  - protocol: TCP

    port: 9080

    targetPort: 9080

    nodePort: 32000


[dave@localhost finish]$ kubectl apply -f kubernetes.yaml

deployment.apps/system-deployment created

deployment.apps/inventory-deployment created

service/system-service created

service/inventory-service created

 



get pods

[dave@localhost finish]$ kubectl get pods

NAME                                    READY   STATUS    RESTARTS   AGE

inventory-deployment-759769c979-tzq9b   1/1     Running   0          24s

system-deployment-94895d89d-6dpp6       1/1     Running   0          24s

[dave@localhost finish]$ 

 


Describe pods
[dave@localhost finish]$ kubectl describe pods

Name:           inventory-deployment-759769c979-tzq9b

Namespace:      default

Priority:       0

Node:           minikube/192.168.39.189

Start Time:     Sat, 23 Nov 2019 14:55:44 +0100

Labels:         app=inventory

                pod-template-hash=759769c979

Annotations:    <none>

Status:         Running

IP:             172.17.0.5

Controlled By:  ReplicaSet/inventory-deployment-759769c979

Containers:

  inventory-container:

    Container ID:   docker://255c6a483511976cc861a644e3c83049411c9dfb9deb39694ed2f456f821a0bf

    Image:          inventory:1.0-SNAPSHOT

    Image ID:       docker://sha256:c2f7faff812d29712919e170acb72ce64192ba9fee543ce1b56a3f3271c59ae1

    Port:           9080/TCP

    Host Port:      0/TCP

    State:          Running

      Started:      Sat, 23 Nov 2019 14:55:45 +0100

    Ready:          True

    Restart Count:  0

    Environment:    <none>

    Mounts:

      /var/run/secrets/kubernetes.io/serviceaccount from default-token-z9cp2 (ro)

Conditions:

  Type              Status

  Initialized       True 

  Ready             True 

  ContainersReady   True 

  PodScheduled      True 

Volumes:

  default-token-z9cp2:

    Type:        Secret (a volume populated by a Secret)

    SecretName:  default-token-z9cp2

    Optional:    false

QoS Class:       BestEffort

Node-Selectors:  <none>

Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s

                 node.kubernetes.io/unreachable:NoExecute for 300s

Events:

  Type    Reason     Age        From               Message

  ----    ------     ----       ----               -------

  Normal  Scheduled  <unknown>  default-scheduler  Successfully assigned default/inventory-deployment-759769c979-tzq9b to minikube

  Normal  Pulled     49s        kubelet, minikube  Container image "inventory:1.0-SNAPSHOT" already present on machine

  Normal  Created    49s        kubelet, minikube  Created container inventory-container

  Normal  Started    48s        kubelet, minikube  Started container inventory-container

 
 
Name:           system-deployment-94895d89d-6dpp6

Namespace:      default

Priority:       0

Node:           minikube/192.168.39.189

Start Time:     Sat, 23 Nov 2019 14:55:44 +0100

Labels:         app=system

                pod-template-hash=94895d89d

Annotations:    <none>

Status:         Running

IP:             172.17.0.4

Controlled By:  ReplicaSet/system-deployment-94895d89d

Containers:

  system-container:

    Container ID:   docker://eaaaa4976cd8ec0218872276faacf9bd52dcfac125ab2a1ce372ab692d88b859

    Image:          system:1.0-SNAPSHOT

    Image ID:       docker://sha256:63fb2879e723f56f74af3ec4ad6f4672ba3dbe8db3b162a5cb80b7496703f1c2

    Port:           9080/TCP

    Host Port:      0/TCP

    State:          Running

      Started:      Sat, 23 Nov 2019 14:55:45 +0100

    Ready:          True

    Restart Count:  0

    Environment:    <none>

    Mounts:

      /var/run/secrets/kubernetes.io/serviceaccount from default-token-z9cp2 (ro)

Conditions:

  Type              Status

  Initialized       True 

  Ready             True 

  ContainersReady   True 

  PodScheduled      True 

Volumes:

  default-token-z9cp2:

    Type:        Secret (a volume populated by a Secret)

    SecretName:  default-token-z9cp2

    Optional:    false

QoS Class:       BestEffort

Node-Selectors:  <none>

Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s

                 node.kubernetes.io/unreachable:NoExecute for 300s

Events:

  Type    Reason     Age        From               Message

  ----    ------     ----       ----               -------

  Normal  Scheduled  <unknown>  default-scheduler  Successfully assigned default/system-deployment-94895d89d-6dpp6 to minikube

  Normal  Pulled     49s        kubelet, minikube  Container image "system:1.0-SNAPSHOT" already present on machine

  Normal  Created    49s        kubelet, minikube  Created container system-container

  Normal  Started    48s        kubelet, minikube  Started container system-container

 


Get ip
[dave@localhost finish]$ minikube ip 

192.168.39.189

 



Test  endpoint
[dave@localhost finish]$ curl http://192.168.39.189:31000/system/properties

{"java.vendor":"Eclipse OpenJ9","default.https.port":"9443","sun.java.launcher":"SUN_STANDARD","shared.resource.dir":"/opt/ol/wlp/usr/shared/resources/","os.name":"Linux","kernel.launch.time":"809693252842","sun.boot.class.path":"/opt/java/openjdk/lib/amd64/compressedrefs/jclSC180/vm.jar:/opt/java/openjdk/lib/se-service.jar:/opt/java/openjdk/lib/rt.jar:/opt/java/openjdk/lib/resources.jar:/opt/java/openjdk/lib/jsse.jar:/opt/java/openjdk/lib/charsets.jar:/opt/java/openjdk/lib/jce.jar","default.http.port":"9080","java.vm.specification.vendor":"Oracle Corporation","shared.app.dir":"/opt/ol/wlp/usr/shared/apps/","java.runtime.version":"1.8.0_232-b09","wlp.lib.dir":"/opt/ol/wlp/lib/","wlp.workarea.dir":"workarea/","user.name":"default","java.compiler":"j9jit29","os.encoding":"UTF-8","com.ibm.util.extralibs.properties":"","com.ibm.jcl.checkClassPath":"","server.tmp.dir":"/opt/ol/wlp/output/defaultServer/workarea/tmp/","user.language":"en","jdk.attach.allowAttachSelf":"true","com.ibm.oti.vm.bootstrap.library.path":"/opt/java/openjdk/lib/amd64/compressedrefs:/opt/java/openjdk/lib/amd64","sun.boot.library.path":"/opt/java/openjdk/lib/amd64/compressedrefs:/opt/java/openjdk/lib/amd64","wlp.install.dir":"/opt/ol/wlp/","server.output.dir":"/opt/ol/wlp/output/defaultServer/","jdk.extensions.version":"8.0.232.0","java.util.logging.manager":"com.ibm.ws.kernel.boot.logging.WsLogManager","java.version":"1.8.0_232","user.timezone":"GMT","com.ibm.system.agent.path":"/opt/java/openjdk/lib/amd64","sun.arch.data.model":"64","com.ibm.zero.version":"2","java.endorsed.dirs":"/opt/java/openjdk/lib/endorsed","com.ibm.oti.vm.library.version":"29","sun.jnu.encoding":"UTF-8","file.encoding.pkg":"sun.io","file.separator":"/","java.specification.name":"Java Platform API Specification","java.class.version":"52.0","user.country":"US","java.home":"/opt/java/openjdk","java.vm.info":"JRE 1.8.0 Linux amd64-64-Bit Compressed References 20191017_442 (JIT enabled, AOT enabled)\nOpenJ9   - 77c1cf708\nOMR      - 20db4fbc\nJCL      - 97b5ec8f383 based on jdk8u232-b09","os.version":"4.19.76","java.awt.fonts":"","path.separator":":","org.apache.aries.blueprint.preemptiveShutdown":"false","java.vm.version":"openj9-0.17.0","user.variant":"","wlp.user.dir.isDefault":"true","ibm.cds.suppresserrors":"true","java.awt.printerjob":"sun.print.PSPrinterJob","jdk.extensions.name":"Extensions for OpenJDK for Eclipse OpenJ9","sun.io.unicode.encoding":"UnicodeLittle","awt.toolkit":"sun.awt.X11.XToolkit","ibm.signalhandling.sigint":"true","org.apache.cxf.stax.allowInsecureParser":"1","user.home":"/home/default","com.ibm.cpu.endian":"little","java.specification.vendor":"Oracle Corporation","ibm.signalhandling.sigchain":"true","org.jboss.weld.xml.disableValidating":"true","java.library.path":"/opt/java/openjdk/lib/amd64/compressedrefs:/opt/java/openjdk/lib/amd64:/usr/lib64:/usr/lib","java.vendor.url":"http://www.eclipse.org/openj9","java.vm.vendor":"Eclipse OpenJ9","java.fullversion":"1.8.0_232-b09\nJRE 1.8.0 Linux amd64-64-Bit Compressed References 20191017_442 (JIT enabled, AOT enabled)\nOpenJ9   - 77c1cf708\nOMR      - 20db4fbc\nJCL      - 97b5ec8f383 based on jdk8u232-b09","java.runtime.name":"OpenJDK Runtime Environment","sun.net.http.retryPost":"false","sun.java.command":"/opt/ol/wlp/bin/tools/ws-server.jar defaultServer","java.class.path":"/opt/ol/wlp/bin/tools/ws-server.jar:/opt/ol/wlp/bin/tools/ws-javaagent.jar:/opt/ol/wlp/bin/tools/ws-javaagent.jar","server.config.dir":"/opt/ol/wlp/usr/servers/defaultServer/","wlp.user.dir":"/opt/ol/wlp/usr/","java.vm.specification.name":"Java Virtual Machine Specification","sun.java.launcher.pid":"1","java.vm.specification.version":"1.8","sun.cpu.endian":"little","java.awt.headless":"true","java.io.tmpdir":"/tmp","ibm.system.encoding":"UTF-8","shared.config.dir":"/opt/ol/wlp/usr/shared/config/","os.arch":"amd64","java.awt.graphicsenv":"sun.awt.X11GraphicsEnvironment","ibm.signalhandling.rs":"false","java.ext.dirs":"/opt/java/openjdk/lib/ext","user.dir":"/opt/ol/wlp/output/defaultServer","line.separator":"\n","java.vm.name":"Eclipse OpenJ9 VM","com.ibm.oti.shared.enabled":"true","com.ibm.vm.bitmode":"64","wlp.process.type":"server","javax.management.builder.initial":"com.ibm.ws.kernel.boot.jmx.internal.PlatformMBeanServerBuilder","file.encoding":"UTF-8","java.specification.version":"1.8","com.ibm.oti.configuration":"scar","wlp.server.name":"defaultServer"}


Scale deployment
[dave@localhost finish]$ kubectl scale deployment/system-deployment --replicas=3

deployment.apps/system-deployment scaled

[dave@localhost finish]$ kubectl get pods

NAME                                    READY   STATUS    RESTARTS   AGE

inventory-deployment-759769c979-tzq9b   1/1     Running   0          11m

system-deployment-94895d89d-58mlq       1/1     Running   0          5s

system-deployment-94895d89d-6dpp6       1/1     Running   0          11m

system-deployment-94895d89d-9q9xz       1/1     Running   0          5s

 


Run tests

[INFO] -------------------------------------------------------

[INFO]  T E S T S

[INFO] -------------------------------------------------------

[INFO] Running it.io.openliberty.guides.inventory.InventoryEndpointTest

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.188 s - in it.io.openliberty.guides.inventory.InventoryEndpointTest

[INFO] 

[INFO] Results:

[INFO] 

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] 

[INFO] 

[INFO] --- liberty-maven-plugin:3.0.M1:test-stop-server (test-stop-server) @ inventory ---

[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty:openliberty-runtime:null:RELEASE:zip.

[INFO] CWWKM2102I: Using installDirectory : /git/guide-kubernetes-intro/finish/inventory/target/liberty/wlp.

[INFO] CWWKM2102I: Using serverName : defaultServer.

[INFO] CWWKM2102I: Using serverDirectory : /git/guide-kubernetes-intro/finish/inventory/target/liberty/wlp/usr/servers/defaultServer.

[INFO] CWWKM2152I: Stopping server defaultServer.

[INFO] CWWKM2001I: server.config.dir is /git/guide-kubernetes-intro/finish/inventory/target/liberty/wlp/usr/servers/defaultServer.

[INFO] CWWKM2001I: server.output.dir is /git/guide-kubernetes-intro/finish/inventory/target/liberty/wlp/usr/servers/defaultServer.

[INFO] CWWKM2001I: Invoke command is [/git/guide-kubernetes-intro/finish/inventory/target/liberty/wlp/bin/server, stop, defaultServer].

[INFO] 

[INFO] Stopping server defaultServer.

[INFO] Server defaultServer stopped.

[INFO] 

[INFO] --- maven-failsafe-plugin:3.0.0-M1:verify (verify-results) @ inventory ---

[INFO] ------------------------------------------------------------------------

[INFO] Reactor Summary for guide-kubernetes-intro 1.0-SNAPSHOT:

[INFO] 

[INFO] guide-kubernetes-intro ............................. SUCCESS [  0.003 s]

[INFO] system ............................................. SUCCESS [  8.917 s]

[INFO] inventory .......................................... SUCCESS [  9.144 s]

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

 


Resource usage


Virtual machine manager

[root@localhost ~]# virt-manager




Saturday, October 26, 2019

Create microservices multimodule OpenLiberty project using Maven

Multimodule project guide
https://openliberty.io/guides/maven-multimodules.html

Sample multimodule project
https://github.com/Yavin/maven-ear-example

Get the code

[dave@localhost git]$ git clone https://github.com/openliberty/guide-maven-multimodules.git
Cloning into 'guide-maven-multimodules'... 

Project structure

[dave@localhost finish]$ find
.
./ear
./ear/pom.xml
./ear/src
./ear/src/main
./ear/src/main/liberty
./ear/src/main/liberty/config
./ear/src/main/liberty/config/server.xml
./ear/src/test
./ear/src/test/java
./ear/src/test/java/it
./ear/src/test/java/it/io
./ear/src/test/java/it/io/openliberty
./ear/src/test/java/it/io/openliberty/guides
./ear/src/test/java/it/io/openliberty/guides/multimodules
./ear/src/test/java/it/io/openliberty/guides/multimodules/Test.java
./war
./war/pom.xml
./war/src
./war/src/main
./war/src/main/java
./war/src/main/java/io
./war/src/main/java/io/openliberty
./war/src/main/java/io/openliberty/guides
./war/src/main/java/io/openliberty/guides/multimodules
./war/src/main/java/io/openliberty/guides/multimodules/web
./war/src/main/java/io/openliberty/guides/multimodules/web/HeightsBean.java
./war/src/main/webapp
./war/src/main/webapp/index.jsp
./war/src/main/webapp/WEB-INF
./war/src/main/webapp/WEB-INF/web.xml
./war/src/main/webapp/heights.jsp
./jar
./jar/pom.xml
./jar/src
./jar/src/main
./jar/src/main/java
./jar/src/main/java/io
./jar/src/main/java/io/openliberty
./jar/src/main/java/io/openliberty/guides
./jar/src/main/java/io/openliberty/guides/multimodules
./jar/src/main/java/io/openliberty/guides/multimodules/lib
./jar/src/main/java/io/openliberty/guides/multimodules/lib/Converter.java
./pom.xml


Build the project using mvn install


[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] io.openliberty.guides.multimodules.modules                         [pom]
[INFO] io.openliberty.guides.multimodules.jar                             [jar]
[INFO] io.openliberty.guides.multimodules.war                             [war]
[INFO] io.openliberty.guides.multimodules.ear                             [ear]
[INFO] 
[INFO] --< io.openliberty.guides:io.openliberty.guides.multimodules.modules >--
[INFO] Building io.openliberty.guides.multimodules.modules 0.0.1-SNAPSHOT [1/4]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ io.openliberty.guides.multimodules.modules ---
[INFO] Installing /git/guide-maven-multimodules/finish/pom.xml to /home/dave/.m2/repository/io/openliberty/guides/io.openliberty.guides.multimodules.modules/0.0.1-SNAPSHOT/io.openliberty.guides.multimodules.modules-0.0.1-SNAPSHOT.pom


Start the server using mvn liberty:start-server

INFO] --- liberty-maven-plugin:3.0.M1:start-server (default-cli) @ io.openliberty.guides.multimodules.modules ---
[INFO] CWWKM2102I: Using installDirectory : /git/guide-maven-multimodules/finish/target/liberty/wlp.
[INFO] CWWKM2102I: Using serverName : defaultServer.
[INFO] CWWKM2102I: Using serverDirectory : /git/guide-maven-multimodules/finish/target/liberty/wlp/usr/servers/defaultServer.
[INFO] Installing from Open Liberty repository...
[INFO] Getting: https://public.dhe.ibm.com/ibmdl/export/pub/software/openliberty/runtime/release/info.json
[INFO] To: /home/dave/.m2/repository/wlp-cache/openliberty-versions.json
[INFO] Using runtime version: 2019-10-02_0300
[INFO] Getting: https://public.dhe.ibm.com/ibmdl/export/pub/software/openliberty/runtime/release/2019-10-02_0300/info.json
[INFO] To: /home/dave/.m2/repository/wlp-cache/2019-10-02_0300.json
[INFO] Getting: https://public.dhe.ibm.com/ibmdl/export/pub/software/openliberty/runtime/release/2019-10-02_0300/openliberty-19.0.0.10.zip
[INFO] To: /home/dave/.m2/repository/wlp-cache/2019-10-02_0300/openliberty-19.0.0.10.zip


[INFO] Copying 1 file to /git/guide-maven-multimodules/finish/ear/target/liberty/wlp/usr/servers/defaultServer
[INFO] CWWKM2144I: Update server configuration file server.xml from /git/guide-maven-multimodules/finish/ear/src/main/liberty/config/server.xml.
[INFO] CWWKM2144I: Update server configuration file bootstrap.properties from inlined configuration.
[INFO] CWWKM2001I: server.config.dir is /git/guide-maven-multimodules/finish/ear/target/liberty/wlp/usr/servers/defaultServer.
[INFO] CWWKM2001I: server.output.dir is /git/guide-maven-multimodules/finish/ear/target/liberty/wlp/usr/servers/defaultServer.
[INFO] CWWKM2001I: Invoke command is [/git/guide-maven-multimodules/finish/ear/target/liberty/wlp/bin/server, start, defaultServer].
[INFO] 
[INFO] Starting server defaultServer.
[INFO] Server defaultServer started with process ID 21980.
[INFO] Waiting up to 30 seconds for server confirmation:  CWWKF0011I to be found in /git/guide-maven-multimodules/finish/ear/target/liberty/wlp/usr/servers/defaultServer/logs/messages.log
[INFO] CWWKM2010I: Searching for CWWKF0011I in /git/guide-maven-multimodules/finish/ear/target/liberty/wlp/usr/servers/defaultServer/logs/messages.log. This search will timeout after 30 seconds.
[INFO] CWWKM2015I: Match number: 1 is [10/26/19 12:10:53:843 CEST] 0000001f com.ibm.ws.kernel.feature.internal.FeatureManager            A CWWKF0011I: The defaultServer server is ready to run a smarter planet. The defaultServer server started in 1.067 seconds..

[dave@localhost finish]$ tail -500f /git/guide-maven-multimodules/finish/ear/target/liberty/wlp/usr/servers/defaultServer/logs/messages.log
********************************************************************************
product = Open Liberty 19.0.0.10 (wlp-1.0.33.cl191020191002-0300)
wlp.install.dir = /git/guide-maven-multimodules/finish/ear/target/liberty/wlp/
java.home = /usr/java/jdk1.8.0_231-amd64/jre
java.version = 1.8.0_231
java.runtime = Java(TM) SE Runtime Environment (1.8.0_231-b11)
os = Linux (5.3.6-200.fc30.x86_64; amd64) (en_US)
process = 21980@localhost.localdomain
********************************************************************************
[10/26/19 12:10:52:876 CEST] 00000001 com.ibm.ws.kernel.launch.internal.FrameworkManager           A CWWKE0001I: The server defaultServer has been launched.
[10/26/19 12:10:53:275 CEST] 00000001 com.ibm.ws.kernel.launch.internal.FrameworkManager           I CWWKE0002I: The kernel started after 0.498 seconds
[10/26/19 12:10:53:296 CEST] 0000001f com.ibm.ws.kernel.feature.internal.FeatureManager            I CWWKF0007I: Feature update started.
[10/26/19 12:10:53:457 CEST] 00000015 com.ibm.ws.app.manager.internal.monitor.DropinMonitor        A CWWKZ0058I: Monitoring dropins for applications.
[10/26/19 12:10:53:527 CEST] 00000023 com.ibm.ws.tcpchannel.internal.TCPPort                       E CWWKO0221E: TCP Channel defaultHttpEndpoint initialization did not succeed.  The socket bind did not succeed for host * and port 9080.  The port might already be in use.  Exception Message: Address already in use
[10/26/19 12:10:53:625 CEST] 00000026 com.ibm.ws.app.manager.AppMessageHelper                      I CWWKZ0018I: Starting application io.openliberty.guides.multimodules.ear.
[10/26/19 12:10:53:626 CEST] 00000026 bm.ws.app.manager.ear.internal.EARDeployedAppInfoFactoryImpl I CWWKZ0134I: The io.openliberty.guides.multimodules.ear application is using the loose application definition at the /git/guide-maven-multimodules/finish/ear/target/liberty/wlp/usr/servers/defaultServer/apps/io.openliberty.guides.multimodules.ear-0.0.1-SNAPSHOT.ear.xml location.
[10/26/19 12:10:53:815 CEST] 00000026 com.ibm.ws.session.WASSessionCore                            I SESN8501I: The session manager did not find a persistent storage location; HttpSession objects will be stored in the local application server's memory.
[10/26/19 12:10:53:826 CEST] 00000026 com.ibm.ws.webcontainer.osgi.webapp.WebGroup                 I SRVE0169I: Loading Web Module: Archetype Created Web Application.
[10/26/19 12:10:53:827 CEST] 00000026 com.ibm.ws.webcontainer                                      I SRVE0250I: Web Module Archetype Created Web Application has been bound to default_host.
[10/26/19 12:10:53:830 CEST] 00000026 com.ibm.ws.app.manager.AppMessageHelper                      A CWWKZ0001I: Application io.openliberty.guides.multimodules.ear started in 0.205 seconds.
[10/26/19 12:10:53:842 CEST] 0000001f com.ibm.ws.kernel.feature.internal.FeatureManager            A CWWKF0012I: The server installed the following features: [el-3.0, jsp-2.3, servlet-3.1].
[10/26/19 12:10:53:843 CEST] 0000001f com.ibm.ws.kernel.feature.internal.FeatureManager            I CWWKF0008I: Feature update completed in 0.568 seconds.
[10/26/19 12:10:53:843 CEST] 0000001f com.ibm.ws.kernel.feature.internal.FeatureManager            A CWWKF0011I: The defaultServer server is ready to run a smarter planet. The defaultServer server started in 1.067 seconds.
[10/26/19 12:10:53:847 CEST] 00000029 com.ibm.ws.session.WASSessionCore                            I SESN0176I: A new session context will be created for application key default_host/converter
[10/26/19 12:10:53:861 CEST] 00000029 com.ibm.ws.util                                              I SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.
[10/26/19 12:10:53:868 CEST] 0000002a com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator          I SRVE9103I: A configuration file for a web server plugin was automatically generated for this server at /git/guide-maven-multimodules/finish/ear/target/liberty/wlp/usr/servers/defaultServer/logs/state/plugin-cfg.xml.


Test the application

Configure development environment for Java Microproflle using OpenLiberty on Fedora

Follow the guide fron OpenLiberty
https://openliberty.io/guides/maven-intro.html

Install latest Maven


https://computingforgeeks.com/installing-latest-apache-maven-on-centos-fedora/

[dave@localhost ~]$ export VER="3.6.2"
[dave@localhost ~]$ curl -O http://www-eu.apache.org/dist/maven/maven-3/${VER}/binaries/apache-maven-${VER}-bin.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 8928k  100 8928k    0     0  9508k      0 --:--:-- --:--:-- --:--:-- 9497k
[dave@localhost ~]$ tar xvf apache-maven-${VER}-bin.tar.gz



[dave@localhost ~]$ sudo mv apache-maven-${VER} /opt/maven
[sudo] password for dave: 
[dave@localhost ~]$ cat <<EOF | sudo tee /etc/profile.d/maven.sh
> export MAVEN_HOME=/opt/maven
> export PATH=\$PATH:\$MAVEN_HOME/bin
> EOF
export MAVEN_HOME=/opt/maven
export PATH=$PATH:$MAVEN_HOME/bin
[dave@localhost ~]$ source /etc/profile.d/maven.sh
[dave@localhost ~]$ echo $MAVEN_HOME
/opt/maven
[dave@localhost ~]$ echo $PATH
/home/dave/.local/bin:/home/dave/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/opt/maven/bin
[dave@localhost ~]$ mvn --version
Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T17:06:16+02:00)
Maven home: /opt/maven
Java version: 1.8.0_232, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.fc30.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.3.6-200.fc30.x86_64", arch: "amd64", family: "unix"


Install Oracle JDK


You can also use OpenJDK but I want to run Weblogic on this host so I need Oracle JDK 


[dave@localhost finish]$ sudo dnf install ~/Downloads/jdk-8u231-linux-x64.rpm 
Error: 
 Problem: conflicting requests
  - nothing provides /bin/basename needed by jdk1.8-2000:1.8.0_231-fcs.x86_64
  - nothing provides /bin/cp needed by jdk1.8-2000:1.8.0_231-fcs.x86_64
  - nothing provides /bin/ls needed by jdk1.8-2000:1.8.0_231-fcs.x86_64
  - nothing provides /bin/mkdir needed by jdk1.8-2000:1.8.0_231-fcs.x86_64
  - nothing provides /bin/mv needed by jdk1.8-2000:1.8.0_231-fcs.x86_64
  - nothing provides /bin/pwd needed by jdk1.8-2000:1.8.0_231-fcs.x86_64
  - nothing provides /bin/sort needed by jdk1.8-2000:1.8.0_231-fcs.x86_64
(try to add '--skip-broken' to skip uninstallable packages)


Use direct rpm installation due to missing deps


[dave@localhost Downloads]$ sudo rpm -Uvh  ~/Downloads/jdk-8u231-linux-x64.rpm 
warning: /home/dave/Downloads/jdk-8u231-linux-x64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:jdk1.8-2000:1.8.0_231-fcs        ################################# [100%]
Unpacking JAR files...
    tools.jar...
    plugin.jar...
    javaws.jar...
    deploy.jar...
    rt.jar...
    jsse.jar...
    charsets.jar...
    localedata.jar...
[dave@localhost Downloads]$ rpm -qi jdk1.8 
Name        : jdk1.8
Epoch       : 2000
Version     : 1.8.0_231
Release     : fcs
Architecture: x86_64
Install Date: Sat 26 Oct 2019 09:50:36 AM CEST
Group       : Development/Tools
Size        : 308047737
License     : https://java.com/bc_license
Signature   : RSA/SHA256, Sat 05 Oct 2019 12:32:51 PM CEST, Key ID 72f97b74ec551f03
Source RPM  : jdk1.8-1.8.0_231-fcs.src.rpm
Build Date  : Sat 05 Oct 2019 12:18:14 PM CEST
Build Host  : java.com
Relocations : /usr/java 
Vendor      : Oracle Corporation
URL         : http://www.oracle.com/technetwork/java/javase/overview/index.html
Summary     : Java Platform Standard Edition Development Kit
Description :
The Java Platform Standard Edition Development Kit (JDK) includes both
the runtime environment (Java virtual machine, the Java platform classes
and supporting files) and development tools (compilers, debuggers,
tool libraries and other tools).

The JDK is a development environment for building applications, applets
and components that can be deployed with the Java Platform Standard
Edition Runtime Environment.


Set new Java home

[dave@localhost Downloads]$ sudo  /usr/sbin/alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.fc30.x86_64/jre/bin/java)
   2           /usr/java/jdk1.8.0_231-amd64/jre/bin/java

Enter to keep the current selection[+], or type selection number: 2
[dave@localhost Downloads]$ java -version
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)



Get the code for sample


git clone https://github.com/openliberty/guide-maven-intro.git
cd guide-maven-intro/finish
mvn install


Start server

[dave@localhost finish]$           mvn liberty:start-server
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for io.openliberty.guides:ServletSample:war:1.0-SNAPSHOT
[WARNING] 'parent.version' is either LATEST or RELEASE (both of them are being deprecated) @ line 8, column 18
[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] ----------------< io.openliberty.guides:ServletSample >-----------------
[INFO] Building ServletSample 1.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO] 
[INFO] --- liberty-maven-plugin:3.0.M1:start-server (default-cli) @ ServletSample ---
[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty:openliberty-runtime:null:RELEASE:zip.
[INFO] CWWKM2102I: Using installDirectory : /git/guide-maven-intro/finish/target/liberty/wlp.
[INFO] CWWKM2102I: Using serverName : ServletSampleServer.
[INFO] CWWKM2102I: Using serverDirectory : /git/guide-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer.
[INFO] CWWKM2112I: Re-using previously installed assembly.
[INFO] Copying 1 file to /git/guide-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer
[INFO] CWWKM2144I: Update server configuration file server.xml from /git/guide-maven-intro/finish/src/main/liberty/config/server.xml.
[INFO] CWWKM2144I: Update server configuration file bootstrap.properties from inlined configuration.
[INFO] CWWKM2001I: server.config.dir is /git/guide-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer.
[INFO] CWWKM2001I: server.output.dir is /git/guide-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer.
[INFO] CWWKM2001I: Invoke command is [/git/guide-maven-intro/finish/target/liberty/wlp/bin/server, start, ServletSampleServer].
[INFO] 
[INFO] Starting server ServletSampleServer.
[INFO] Server ServletSampleServer started with process ID 18867.
[INFO] Waiting up to 30 seconds for server confirmation:  CWWKF0011I to be found in /git/guide-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer/logs/messages.log
[INFO] CWWKM2010I: Searching for CWWKF0011I in /git/guide-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer/logs/messages.log. This search will timeout after 30 seconds.
[INFO] CWWKM2015I: Match number: 1 is [10/26/19 10:16:29:999 CEST] 00000020 com.ibm.ws.kernel.feature.internal.FeatureManager            A CWWKF0011I: The ServletSampleServer server is ready to run a smarter planet. The ServletSampleServer server started in 1.286 seconds..
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.408 s
[INFO] Finished at: 2019-10-26T10:16:30+02:00
[INFO] ------------------------------------------------------------------------


Test server

[dave@localhost finish]$ pgrep -a java
18867 /usr/java/jdk1.8.0_231-amd64/jre/bin/java -javaagent:/git/guide-maven-intro/finish/target/liberty/wlp/bin/tools/ws-javaagent.jar -Djava.awt.headless=true -Djdk.attach.allowAttachSelf=true -jar /git/guide-maven-intro/finish/target/liberty/wlp/bin/tools/ws-server.jar ServletSampleServer


[dave@localhost finish]$ wget -O - http://localhost:9080/ServletSample/servlet
--2019-10-26 10:19:27--  http://localhost:9080/ServletSample/servlet
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:9080... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified
Saving to: ‘STDOUT’

-                                          [<=>                                                                         ]       0  --.-KB/s               Hello! How are you today?
-                                          [ <=>                                                                        ]      26  --.-KB/s    in 0s      

2019-10-26 10:19:27 (2.10 MB/s) - written to stdout [26]

Saturday, October 5, 2019

Creating a RESTful web service using Java Microprofile

 Creating a RESTful web service using Java Microprofile - OpenLiberty guide

https://openliberty.io/guides/rest-intro.html?_ga=2.32933814.922244966.1570259159-606366657.1570259159


Install latest version of Maven  on Centos 7.6 ( sample failed with 3.0.5 default version)
https://www.tecmint.com/install-apache-maven-on-centos-7/

No implementation for org.codehaus.plexus.languages.java.jpms.LocationManager was bound.
  while locating org.apache.maven.plugin.surefire.SurefirePlugin

On Fedora 30 I get following error in Maven
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.wasdev.wlp.maven.plugins:liberty-maven-plugin:2.7:install-server (install-server) on project microprofile: Unable to resolve artifact: io.openliberty:openliberty-runtime:19.0.0.9: Could not transfer artifact io.openliberty:openliberty-runtime:zip:19.0.0.9 from/to central (https://repo.maven.apache.org/maven2): User-specified log class 'org.codehaus.mojo.pluginsupport.logging.DelegatingLog' cannot be found or is not useable. -> [Help 1]
Installing latest version of Maven removed error


Clone the tutorial  sample repo
https://github.com/eugenp/tutorials

Go to Microprofile sample
https://github.com/eugenp/tutorials/tree/master/microprofile

Follow the tutorial article
https://www.baeldung.com/eclipse-microprofile

Change versions to latest in pom.xml - check versions at https://mvnrepository.com/artifact/io.openliberty/openliberty-runtime/

tail pom.xml 
    <properties>
        <app.name>library</app.name>
        <package.file>${project.build.directory}/${app.name}-service.jar</package.file>
        <packaging.type>runnable</packaging.type>
        <microprofile.version>1.2</microprofile.version>
        <liberty-maven-plugin.version>2.7</liberty-maven-plugin.version>
        <openliberty-runtime.version>19.0.0.9</openliberty-runtime.version>
    </properties>

JsonObject - Java EE 7
https://docs.oracle.com/javaee/7/api/javax/json/JsonObject.html

Reader/Writer Java EE7 sample https://github.com/javaee-samples/javaee7-samples/tree/master/jaxrs/readerwriter-json

Compile and start the service
mvn package
java -jar target/library-service.jar


microprofile]$ java -jar target/library-service.jar
Extracting files to /home/centos/wlpExtract/library-service_1453971251685/wlp
Successfully extracted all product files.
Launching defaultServer (Open Liberty 19.0.0.9/wlp-1.0.32.cl190920190905-0148) on OpenJDK 64-Bit Server VM, version 1.8.0_222-b10 (en_US)
[AUDIT   ] CWWKE0001I: The server defaultServer has been launched.
[AUDIT   ] CWWKZ0058I: Monitoring dropins for applications.
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://localhost:9080/
[AUDIT   ] CWWKZ0001I: Application microprofile-1.0-SNAPSHOT started in 1.746 seconds.
[AUDIT   ] CWWKF0012I: The server installed the following features: [cdi-1.2, jaxrs-2.0, jaxrsClient-2.0, jndi-1.0, json-1.0, jsonp-1.0, servlet-3.1].
[AUDIT   ] CWWKF0011I: The defaultServer server is ready to run a smarter planet. The defaultServer server started in 5.136 seconds.


Test the service



curl http://localhost:9080/library/books
[{"id":"0001-201910","isbn":"1","name":"Building Microservice With Eclipse MicroProfile","author":"baeldung","pages":"420"}] 

On Weblogic I got following error
Oct 07, 2019 10:16:16 AM org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor aroundWriteTo
SEVERE: MessageBodyWriter not found for media type=application/json, type=class java.util.ArrayList, genericType=class java.util.ArrayList.
<Oct 7, 2019, 10:16:16,652 AM CEST> <Error> <org.glassfish.jersey.message.internal.WriterInterceptorExecutor> <BEA-000000> <MessageBodyWriter not found for media type=application/json, type=class java.util.ArrayList, genericType=class java.util.ArrayList.>
Using this hint from Adam Bien solved the issue http://www.adam-bien.com/roller/abien/entry/jax_rs_returning_a_list
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Response getAllBooks() {

        List<Book> books = bookManager.getAll();
        GenericEntity<List<Book>> list = new GenericEntity<List<Book>>(books) {
        };
        return Response.ok(list).build();
        
    }

Thursday, October 25, 2018

Getting started with Microprofile


MicroProfile

https://microprofile.io/

https://openliberty.io/docs/ref/microprofile/1.3/

List of microprofile implementations
https://wiki.eclipse.org/MicroProfile/Implementation

Payara 


https://blog.payara.fish/building-your-next-microservice-with-eclipse-microprofile

https://github.com/OndrejM/getting-started-microprofile

OpenLiberty

https://www.phillip-kruger.com/post/fatjars_thinwars_and_why_openliberty_is_cool/

OpenLiberty guides
https://openliberty.io/guides/

Install OpenLiberty via Maven
https://openliberty.io/blog/2018/07/27/installing-features-from-maven-dependencies.html

http://www.adam-bien.com/roller/abien/entry/microprofile_java_ee_8_thinner

http://javaeemicro.services/


Thorntail ( previously JBoss  Wildfly Swarm)


https://thorntail.io/

https://developers.redhat.com/blog/2017/08/24/the-skinny-on-fat-thin-hollow-and-uber/


https://developers.redhat.com/blog/2018/08/23/eclipse-microprofile-and-red-hat-update-thorntail-and-smallrye/


Sample project

Start application HOWTO
 https://openliberty.io/guides/maven-intro.html


Compile the project

mvn install

jar tvf target/ServletSample-1.0-SNAPSHOT.war
    97 Thu Oct 25 11:12:26 CEST 2018 META-INF/MANIFEST.MF
     0 Thu Oct 25 11:12:26 CEST 2018 META-INF/
     0 Thu Oct 25 11:12:26 CEST 2018 WEB-INF/
     0 Thu Oct 25 11:12:26 CEST 2018 WEB-INF/classes/
     0 Thu Oct 25 11:12:26 CEST 2018 WEB-INF/classes/io/
     0 Thu Oct 25 11:12:26 CEST 2018 WEB-INF/classes/io/openliberty/
     0 Thu Oct 25 11:12:26 CEST 2018 WEB-INF/classes/io/openliberty/guides/
     0 Thu Oct 25 11:12:26 CEST 2018 WEB-INF/classes/io/openliberty/guides/hello/
     0 Thu Oct 25 11:12:26 CEST 2018 WEB-INF/lib/
   431 Thu Oct 25 11:08:56 CEST 2018 WEB-INF/web.xml
1047863 Thu Oct 25 11:11:42 CEST 2018 WEB-INF/lib/jaxb-impl-2.2.11.jar
  1222 Thu Oct 25 11:11:44 CEST 2018 WEB-INF/classes/io/openliberty/guides/hello/HelloServlet.class
   575 Thu Oct 25 11:08:56 CEST 2018 index.html
  6330 Thu Oct 25 11:08:56 CEST 2018 META-INF/maven/io.openliberty.guides/ServletSample/pom.xml
   107 Thu Oct 25 11:12:26 CEST 2018 META-INF/maven/io.openliberty.guides/ServletSample/pom.properties
102244 Thu Oct 25 11:11:42 CEST 2018 WEB-INF/lib/jaxb-api-2.2.11.jar
 69409 Thu Oct 25 11:11:42 CEST 2018 WEB-INF/lib/activation-1.1.1.jar
252336 Thu Oct 25 11:11:42 CEST 2018 WEB-INF/lib/jaxb-core-2.2.11.jar


Maven build log

mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ServletSample 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ ServletSample ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /git/openliberty-maven-intro/finish/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ ServletSample ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ ServletSample ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /git/openliberty-maven-intro/finish/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ ServletSample ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ ServletSample ---
[INFO]
[INFO] --- liberty-maven-plugin:2.6.1:install-server (create-server) @ ServletSample ---
[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty:openliberty-runtime:null:RELEASE:zip.
[INFO] CWWKM2102I: Using installDirectory : /git/openliberty-maven-intro/finish/target/liberty/wlp.
[INFO] CWWKM2102I: Using serverName : ServletSampleServer.
[INFO] CWWKM2102I: Using serverDirectory : /git/openliberty-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer.
[INFO] CWWKM2185I: The liberty-maven-plugin configuration parameter "appsDirectory" value defaults to "apps".
[INFO] CWWKM2112I: Re-using previously installed assembly.
[INFO]
[INFO] --- liberty-maven-plugin:2.6.1:create-server (create-server) @ ServletSample ---
[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty:openliberty-runtime:null:RELEASE:zip.
[INFO] CWWKM2102I: Using installDirectory : /git/openliberty-maven-intro/finish/target/liberty/wlp.
[INFO] CWWKM2102I: Using serverName : ServletSampleServer.
[INFO] CWWKM2102I: Using serverDirectory : /git/openliberty-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer.
[INFO] CWWKM2185I: The liberty-maven-plugin configuration parameter "appsDirectory" value defaults to "apps".
[INFO] CWWKM2112I: Re-using previously installed assembly.
[INFO] Copying 1 file to /git/openliberty-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer
[INFO] CWWKM2144I: Update server configuration file server.xml from /git/openliberty-maven-intro/finish/src/main/liberty/config/server.xml.
[INFO] CWWKM2144I: Update server configuration file bootstrap.properties from inlined configuration.
[INFO]
[INFO] --- maven-war-plugin:3.2.2:war (default-war) @ ServletSample ---
[INFO] Packaging webapp
[INFO] Assembling webapp [ServletSample] in [/git/openliberty-maven-intro/finish/target/ServletSample-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/git/openliberty-maven-intro/finish/src/main/webapp]
[INFO] Webapp assembled in [47 msecs]
[INFO] Building war: /git/openliberty-maven-intro/finish/target/ServletSample-1.0-SNAPSHOT.war
[INFO]
[INFO] --- liberty-maven-plugin:2.6.1:install-apps (install-apps) @ ServletSample ---
[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty:openliberty-runtime:null:RELEASE:zip.
[INFO] CWWKM2102I: Using installDirectory : /git/openliberty-maven-intro/finish/target/liberty/wlp.
[INFO] CWWKM2102I: Using serverName : ServletSampleServer.
[INFO] CWWKM2102I: Using serverDirectory : /git/openliberty-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer.
[INFO] Copying 1 file to /git/openliberty-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer
[INFO] CWWKM2144I: Update server configuration file server.xml from /git/openliberty-maven-intro/finish/src/main/liberty/config/server.xml.
[INFO] CWWKM2144I: Update server configuration file bootstrap.properties from inlined configuration.
[INFO] CWWKM2185I: The liberty-maven-plugin configuration parameter "appsDirectory" value defaults to "apps".
[INFO] CWWKM2160I: Installing application ServletSample.war.xml.
[INFO]
[INFO] --- liberty-maven-plugin:2.6.1:package-server (package-server) @ ServletSample ---
[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty:openliberty-runtime:null:RELEASE:zip.
[INFO] CWWKM2102I: Using installDirectory : /git/openliberty-maven-intro/finish/target/liberty/wlp.
[INFO] CWWKM2102I: Using serverName : ServletSampleServer.
[INFO] CWWKM2102I: Using serverDirectory : /git/openliberty-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer.
[INFO] CWWKM2112I: Re-using previously installed assembly.
[INFO] CWWKM2134I: Packaging server ServletSampleServer.
[INFO] Copying 1 file to /git/openliberty-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer
[INFO] CWWKM2144I: Update server configuration file server.xml from /git/openliberty-maven-intro/finish/src/main/liberty/config/server.xml.
[INFO] CWWKM2144I: Update server configuration file bootstrap.properties from inlined configuration.
[INFO] CWWKM2136I: Package file location is /git/openliberty-maven-intro/finish/target/ServletSample.zip.
[INFO] CWWKM2001I: server.config.dir is /git/openliberty-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer.
[INFO] CWWKM2001I: server.output.dir is /git/openliberty-maven-intro/finish/target/wlp-package/ServletSampleServer.
[INFO] CWWKM2001I: Invoke command is [/git/openliberty-maven-intro/finish/target/liberty/wlp/bin/server, package, ServletSampleServer, --archive=/git/openliberty-maven-intro/finish/target/ServletSample.zip, --include=usr].
[INFO] Packaging server ServletSampleServer.
[INFO] Server ServletSampleServer package complete in /git/openliberty-maven-intro/finish/target/ServletSample.zip.
[INFO]
[INFO] --- liberty-maven-plugin:2.6.1:test-start-server (test-start-server) @ ServletSample ---
[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty:openliberty-runtime:null:RELEASE:zip.
[INFO] CWWKM2102I: Using installDirectory : /git/openliberty-maven-intro/finish/target/liberty/wlp.
[INFO] CWWKM2102I: Using serverName : ServletSampleServer.
[INFO] CWWKM2102I: Using serverDirectory : /git/openliberty-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer.
[INFO] CWWKM2112I: Re-using previously installed assembly.
[INFO] Copying 1 file to /git/openliberty-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer
[INFO] CWWKM2144I: Update server configuration file server.xml from /git/openliberty-maven-intro/finish/src/main/liberty/config/server.xml.
[INFO] CWWKM2144I: Update server configuration file bootstrap.properties from inlined configuration.
[INFO] CWWKM2001I: server.config.dir is /git/openliberty-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer.
[INFO] CWWKM2001I: server.output.dir is /git/openliberty-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer.
[INFO] CWWKM2001I: Invoke command is [/git/openliberty-maven-intro/finish/target/liberty/wlp/bin/server, start, ServletSampleServer].
[INFO] Server ServletSampleServer is already running with process ID 28763.
[INFO] Waiting up to 30 seconds for server confirmation:  CWWKF0011I to be found in /git/openliberty-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer/logs/messages.log
[INFO] CWWKM2010I: Searching for CWWKF0011I in /git/openliberty-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer/logs/messages.log. This search will timeout after 30 seconds.
[INFO] CWWKM2015I: Match number: 1 is [10/25/18 11:13:40:556 CEST] 00000019 com.ibm.ws.kernel.feature.internal.FeatureManager            A CWWKF0011I: The server ServletSampleServer is ready to run a smarter planet..
[INFO]
[INFO] --- maven-failsafe-plugin:2.19.1:integration-test (default) @ ServletSample ---


Tests 

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running io.openliberty.guides.hello.it.EndpointIT
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.373 sec - in io.openliberty.guides.hello.it.EndpointIT

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- liberty-maven-plugin:2.6.1:test-stop-server (test-stop-server) @ ServletSample ---
[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty:openliberty-runtime:null:RELEASE:zip.
[INFO] CWWKM2102I: Using installDirectory : /git/openliberty-maven-intro/finish/target/liberty/wlp.
[INFO] CWWKM2102I: Using serverName : ServletSampleServer.
[INFO] CWWKM2102I: Using serverDirectory : /git/openliberty-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer.
[INFO] CWWKM2152I: Stopping server ServletSampleServer.
[INFO] CWWKM2001I: server.config.dir is /git/openliberty-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer.
[INFO] CWWKM2001I: server.output.dir is /git/openliberty-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer.
[INFO] CWWKM2001I: Invoke command is [/git/openliberty-maven-intro/finish/target/liberty/wlp/bin/server, stop, ServletSampleServer].
[INFO] Stopping server ServletSampleServer.
[INFO] Server ServletSampleServer stopped.
[INFO]
[INFO] --- maven-failsafe-plugin:2.19.1:verify (default) @ ServletSample ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ ServletSample ---
[INFO] Installing /git/openliberty-maven-intro/finish/target/ServletSample-1.0-SNAPSHOT.war to /home/centos/.m2/io/openliberty/guides/ServletSample/1.0-SNAPSHOT/ServletSample-1.0-SNAPSHOT.war
[INFO] Installing /git/openliberty-maven-intro/finish/pom.xml to /home/centos/.m2/io/openliberty/guides/ServletSample/1.0-SNAPSHOT/ServletSample-1.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS


Run server

mvn liberty:start-server

Server log

tail -500f ./target/liberty/wlp/usr/servers/ServletSampleServer/logs/messages.log
********************************************************************************
product = Open Liberty 18.0.0.3 (wlp-1.0.22.cl180320180905-2337)
wlp.install.dir = /git/openliberty-maven-intro/finish/target/liberty/wlp/
java.home = /usr/java/jdk1.8.0_144/jre
java.version = 1.8.0_144
java.runtime = Java(TM) SE Runtime Environment (1.8.0_144-b01)
os = Linux (3.10.0-693.21.1.el7.x86_64; amd64) (en_US)
process = 28763@ip-10-112-45-153.eu-central-1.compute.internal
********************************************************************************
[10/25/18 11:13:37:833 CEST] 00000001 com.ibm.ws.kernel.launch.internal.FrameworkManager           A CWWKE0001I: The server ServletSampleServer has been launched.
[10/25/18 11:13:38:923 CEST] 00000001 com.ibm.ws.kernel.launch.internal.FrameworkManager           I CWWKE0002I: The kernel started after 1.322 seconds
[10/25/18 11:13:38:962 CEST] 00000019 com.ibm.ws.kernel.feature.internal.FeatureManager            I CWWKF0007I: Feature update started.
[10/25/18 11:13:39:643 CEST] 00000011 com.ibm.ws.app.manager.internal.monitor.DropinMonitor        A CWWKZ0058I: Monitoring dropins for applications.
[10/25/18 11:13:39:652 CEST] 0000001c com.ibm.ws.tcpchannel.internal.TCPChannel                    I CWWKO0219I: TCP Channel defaultHttpEndpoint has been started and is now listening for requests on host *  (IPv6) port 9080.
[10/25/18 11:13:39:853 CEST] 00000021 com.ibm.ws.app.manager.AppMessageHelper                      I CWWKZ0018I: Starting application ServletSample.
[10/25/18 11:13:39:932 CEST] 00000021 m.ibm.ws.container.service.app.deploy.ManifestClassPathUtils W SRVE9967W: The manifest class path jaxb-api.jar can not be found in jar file file:/home/centos/.m2/com/sun/xml/bind/jaxb-core/2.2.11/jaxb-core-2.2.11.jar or its parent.
[10/25/18 11:13:39:944 CEST] 00000021 m.ibm.ws.container.service.app.deploy.ManifestClassPathUtils W SRVE9967W: The manifest class path jaxb-core.jar can not be found in jar file file:/home/centos/.m2/com/sun/xml/bind/jaxb-impl/2.2.11/jaxb-impl-2.2.11.jar or its parent.
[10/25/18 11:13:40:106 CEST] 00000021 m.ibm.ws.container.service.app.deploy.ManifestClassPathUtils W SRVE9967W: The manifest class path jaxb-api.jar can not be found in jar file file:/home/centos/.m2/com/sun/xml/bind/jaxb-core/2.2.11/jaxb-core-2.2.11.jar or its parent.
[10/25/18 11:13:40:109 CEST] 00000021 m.ibm.ws.container.service.app.deploy.ManifestClassPathUtils W SRVE9967W: The manifest class path jaxb-core.jar can not be found in jar file file:/home/centos/.m2/com/sun/xml/bind/jaxb-impl/2.2.11/jaxb-impl-2.2.11.jar or its parent.
[10/25/18 11:13:40:484 CEST] 00000021 com.ibm.ws.session.WASSessionCore                            I SESN8501I: The session manager did not find a persistent storage location; HttpSession objects will be stored in the local application server's memory.
[10/25/18 11:13:40:506 CEST] 00000021 com.ibm.ws.webcontainer.osgi.webapp.WebGroup                 I SRVE0169I: Loading Web Module: Hello Servlet.
[10/25/18 11:13:40:508 CEST] 00000021 com.ibm.ws.webcontainer                                      I SRVE0250I: Web Module Hello Servlet has been bound to default_host.
[10/25/18 11:13:40:510 CEST] 00000021 com.ibm.ws.http.internal.VirtualHostImpl                     A CWWKT0016I: Web application available (default_host): http://rdfadm:9080/ServletSample/
[10/25/18 11:13:40:514 CEST] 00000021 com.ibm.ws.app.manager.AppMessageHelper                      A CWWKZ0001I: Application ServletSample started in 0.661 seconds.
[10/25/18 11:13:40:555 CEST] 00000019 com.ibm.ws.kernel.feature.internal.FeatureManager            A CWWKF0012I: The server installed the following features: [servlet-3.1].
[10/25/18 11:13:40:556 CEST] 00000019 com.ibm.ws.kernel.feature.internal.FeatureManager            I CWWKF0008I: Feature update completed in 1.633 seconds.
[10/25/18 11:13:40:556 CEST] 00000019 com.ibm.ws.kernel.feature.internal.FeatureManager            A CWWKF0011I: The server ServletSampleServer is ready to run a smarter planet.
[10/25/18 11:13:40:566 CEST] 00000025 com.ibm.ws.session.WASSessionCore                            I SESN0176I: A new session context will be created for application key default_host/ServletSample
[10/25/18 11:13:40:582 CEST] 00000025 com.ibm.ws.util                                              I SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.
[10/25/18 11:13:40:803 CEST] 00000021 com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator          I SRVE9103I: A configuration file for a web server plugin was automatically generated for this server at /git/openliberty-maven-intro/finish/target/liberty/wlp/usr/servers/ServletSampleServer/logs/state/plugin-cfg.xml.