Showing posts with label GitHub. Show all posts
Showing posts with label GitHub. Show all posts

Monday, March 21, 2022

Create GihHub Action with Maven build

HOWTO

 

GitHub

  •  https://github.com/dveselka/java-tutorial/tree/master/.github/workflows

 

Workflow file

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK 11
      uses: actions/setup-java@v2
      with:
        java-version: '11'
        distribution: 'temurin'
        cache: maven
    - name: Build with Maven
      run: mvn -B package --file pom.xml

 

Run list


 Job detail


 


Saturday, January 29, 2022

Using Maven with Weblogic 14.1.1

 HOWTO

 

GitHub

 

Set env 

dave@dave dave-basic-webapp-ejb-project]$ . /app/weblogic/wlserver/server/bin/setWLSEnv.sh
CLASSPATH=/usr/java/jdk-11.0.13/lib/tools.jar:/home/app/weblogic/wlserver/modules/features/wlst.wls.classpath.jar:

PATH=/home/app/weblogic/wlserver/server/bin:/home/app/weblogic/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.10.5.0.0/apache-ant-1.10.5/bin:/usr/java/jdk-11.0.13/bin:/usr/java/jdk-11.0.13/bin:/app/weblogic/oracle_common/modules/thirdparty/apache-maven_bundle/3.6.1.0.0/apache-maven-3.6.1//bin:/app/weblogic-14.1.1/oracle_common/modules/thirdparty/apache-maven_bundle/3.6.1.0.0/apache-maven-3.6.1//bin:/home/dave/.local/bin:/home/dave/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/app/weblogic/oracle_common/modules/thirdparty/apache-maven_bundle/3.6.1.0.0/apache-maven-3.6.1//bin

Your environment has been set.

 

Compile and deploy the project - requires Maven configuration - see below 

Use Weblogic path /app/weblogic - Maven plugin had issues with Oracle JARs synced to local repository 

Error "java.lang.NoClassDefFoundError Required class missing : weblogic/Deployer" After deleting com/oracle/weblogic in Maven local repo and resync deploy works

dave@dave dave-basic-webapp-ejb-project]$ mvn  clean  compile package  pre-integration-test 
[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------< dave:dave-basic-webapp-ejb-project >-----------------
[INFO] Building basicWebappEjb 1.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ dave-basic-webapp-ejb-project ---
[INFO] Deleting /git/weblogic/dave-basic-webapp-ejb-project/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ dave-basic-webapp-ejb-project ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ dave-basic-webapp-ejb-project ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 6 source files to /git/weblogic/dave-basic-webapp-ejb-project/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ dave-basic-webapp-ejb-project ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ dave-basic-webapp-ejb-project ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ dave-basic-webapp-ejb-project ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /git/weblogic/dave-basic-webapp-ejb-project/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ dave-basic-webapp-ejb-project ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ dave-basic-webapp-ejb-project ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ dave-basic-webapp-ejb-project ---
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/home/dave/.m2/repository/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar) to field java.util.Properties.defaults
WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Packaging webapp
[INFO] Assembling webapp [dave-basic-webapp-ejb-project] in [/git/weblogic/dave-basic-webapp-ejb-project/target/basicWebappEjb]
[INFO] Processing war project
[INFO] Copying webapp resources [/git/weblogic/dave-basic-webapp-ejb-project/src/main/webapp]
[INFO] Webapp assembled in [105 msecs]
[INFO] Building war: /git/weblogic/dave-basic-webapp-ejb-project/target/basicWebappEjb.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ dave-basic-webapp-ejb-project ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ dave-basic-webapp-ejb-project ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ dave-basic-webapp-ejb-project ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /git/weblogic/dave-basic-webapp-ejb-project/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ dave-basic-webapp-ejb-project ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ dave-basic-webapp-ejb-project ---
[INFO] No tests to run.
[INFO] Skipping execution of surefire because it has already been run for this configuration
[INFO] 
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ dave-basic-webapp-ejb-project ---
[INFO] Packaging webapp
[INFO] Assembling webapp [dave-basic-webapp-ejb-project] in [/git/weblogic/dave-basic-webapp-ejb-project/target/basicWebappEjb]
[INFO] Processing war project
[INFO] Copying webapp resources [/git/weblogic/dave-basic-webapp-ejb-project/src/main/webapp]
[INFO] Webapp assembled in [66 msecs]
[INFO] Building war: /git/weblogic/dave-basic-webapp-ejb-project/target/basicWebappEjb.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] 
[INFO] --- weblogic-maven-plugin:14.1.1-0-0:deploy (default) @ dave-basic-webapp-ejb-project ---
[INFO] Command flags are: -noexit -deploy -username weblogic -password ******* -name basicWebappEjb -source /git/weblogic/dave-basic-webapp-ejb-project/target/basicWebappEjb.war -verbose -adminurl t3://127.0.0.1:7001
weblogic.Deployer invoked with options:  -noexit -deploy -username weblogic -name basicWebappEjb -source /git/weblogic/dave-basic-webapp-ejb-project/target/basicWebappEjb.war -verbose -adminurl t3://127.0.0.1:7001
<Jan 30, 2022, 9:00:58 AM Central European Standard Time> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating deploy operation for application, basicWebappEjb [archive: /git/weblogic/dave-basic-webapp-ejb-project/target/basicWebappEjb.war], to configured targets.> 
Task 6 initiated: [Deployer:149026]deploy application basicWebappEjb on AdminServer.
Task 6 completed: [Deployer:149026]deploy application basicWebappEjb on AdminServer.
Target state: deploy completed on Server AdminServer

Target Assignments:
+ basicWebappEjb  AdminServer
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  10.671 s
[INFO] Finished at: 2022-01-30T09:01:01+01:00
[INFO] ------------------------------------------------------------------------


 


Install Oracle plugin to local repository

Follow instructions from Oracle Weblogic 14.1.1 HOWTO https://docs.oracle.com/en/middleware/standalone/weblogic-server/14.1.1.0/wlprg/maven.html#GUID-C6FC7582-2D1C-4EA5-B000-71AE9A2F2B05 

 


  cd /app/weblogic-14.1.1/
  find . -name   oracle*maven-*.jar
  cd  ./oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/14.1.1/

  ls ~/.m2/repository/
  mvn install:install-file -DpomFile=oracle-maven-sync-14.1.1.pom -Dfile=oracle-maven-sync-14.1.1.jar
  mvn com.oracle.maven:oracle-maven-sync:push -DoracleHome=/app/weblogic-14.1.1/
  mvn archetype:crawl -Dcatalog=$HOME/.m2/archetype-catalog.xml

  List plugins goals

[dave@dave dave-basic-webapp-ejb-project]$ mvn help:describe -DgroupId=com.oracle.weblogic -DartifactId=weblogic-maven-plugin -Dversion=14.1.1-0-0
[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------< dave:dave-basic-webapp-ejb-project >-----------------
[INFO] Building basicWebappEjb 1.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO] 
[INFO] --- maven-help-plugin:3.2.0:describe (default-cli) @ dave-basic-webapp-ejb-project ---
[INFO] com.oracle.weblogic:weblogic-maven-plugin:14.1.1-0-0

Name: weblogic-maven-plugin
Description: The Oracle WebLogic Server 12.3.1 Maven plugin
Group Id: com.oracle.weblogic
Artifact Id: weblogic-maven-plugin
Version: 14.1.1-0-0
Goal Prefix: weblogic

This plugin has 23 goals:

weblogic:appc
  Description: This goal is a wrapper for the weblogic.appc compiler.

weblogic:create-domain
  Description: Create a domain for WebLogic Server using the default domain
    template. For more complex domain creation use the WLST goal. Note:
    Starting in WLS 12.2.1, there is a single unified version of WLST that
    automatically includes the WLST environment from all products in the
    ORACLE_HOME.

weblogic:deploy
  Description: Deploys an application to WebLogic Server (supports all
    formats WAR, JAR, RAR, EAR, etc.)

weblogic:distribute-app
  Description: Prepares deployment files for deployment by copying deployment
    files to target servers and validating them.

weblogic:install
  Description: Installs WebLogic Server

weblogic:list-apps
  Description: Lists the deployment names for applications and stand-alone
    modules deployed distributed, or installed to the domain

weblogic:purge-tasks
  Description: Flushes out retired deployment tasks

weblogic:redeploy
  Description: Redeploys a running application or part of a running
    application

weblogic:remove-domain
  Description: This class provides basic capabilities to remove a domain
    directory.

weblogic:start-app
  Description: Starts an application

weblogic:start-server
  Description: Starts WebLogic Server.

weblogic:stop-app
  Description: Stops an application

weblogic:stop-server
  Description: This goals run a stop script to stop WebLogic Server.

weblogic:undeploy
  Description: Stops the deployment unit and removes staged files from target
    servers

weblogic:uninstall
  Description: Uninstalls WebLogic Server

weblogic:update-app
  Description: Updates an application's deployment plan by redistributing the
    plan files and reconfiguring the application based on the new plan
    contents.

weblogic:wlst
  Description: This goal is a wrapper for the WLST scripting tool.
    Note: Starting in WLS 12.2.1, there is a single unified version of WLST
    that automatically includes the WLST environment from all products in the
    ORACLE_HOME.

weblogic:wlst-client
  Description: WLST wrapper for Maven that does not require a server install
    for WLST online commands.

weblogic:ws-clientgen
  Description: A Maven goal to generate client web service artifacts from a
    WSDL Note the differences between clientgen Ant task and Maven goal:
    clientgen goal only generates JAXWS web service artifacts, while Ant task
    has JAXRPC as the default. At the moment there is no way to direct
    clientgen goal to also compile and package generated artifacts.
  Deprecated. No reason given

weblogic:ws-jwsc
  Description: This goal builds a JAX-WS web service, generates source code,
    data binding artifacts, deployment descriptors, and so on into an output
    directory.
  Deprecated. No reason given

weblogic:ws-wsdlc
  Description: This goal generates, from an existing WSDL file, a set of
    artifacts that together provide a partial Java implementation of the Web
    Service described by the WSDL file.
  Deprecated. No reason given

weblogic:wsgen
  Description: Reads a JAX-WS service endpoint implementation class and
    generates all of the portable artifacts for a JAX-WS web service.

weblogic:wsimport
  Description: Parses wsdl and binding files and generates Java code needed
    to access it.

For more information, run 'mvn help:describe [...] -Ddetail'

Create project using Eclipse and Maven archetype 


 

 

Sunday, February 7, 2021

Create Weblogic Docker domain with managed server using Docker compose

HOWTO

* Weblogic Docker image using Centos  https://danielveselka.blogspot.com/2021/02/create-oracle-weblogic-docker-images.html

* Docker compose https://danielveselka.blogspot.com/2020/10/create-weblogic-docker-domain-using.html

* Docker compose reference https://docs.docker.com/compose/reference/overview/ 

GitHub repo https://github.com/dveselka/weblogic/tree/master/docker-compose-managed-server 

 


 

Docker file for Weblogic domain

https://github.com/dveselka/weblogic/blob/master/docker-compose-managed-server/Dockerfile

FROM oracle/weblogic:12.2.1.4-generic

# Maintainer
# ----------
MAINTAINER Daniel Veselka

# WLS Configuration
# -----------------
ENV CUSTOM_DOMAIN_NAME="${CUSTOM_DOMAIN_NAME:-daveDomain}" \
    CUSTOM_DOMAIN_ROOT="/app/domains" \
    CUSTOM_ADMIN_PORT="${CUSTOM_ADMIN_PORT:-7001}" \
    CUSTOM_ADMIN_NAME="${CUSTOM_ADMIN_NAME:-adminserver}" \
    CUSTOM_ADMIN_HOST="${CUSTOM_ADMIN_HOST:-adminserver}" \
    CUSTOM_MANAGED_SERVER_PORT="${CUSTOM_MANAGED_SERVER_PORT:-8001}" \
    CUSTOM_MANAGED_SERVER_NAME_BASE="${CUSTOM_MANAGED_SERVER_NAME_BASE:-MS}" \
    CUSTOM_CONFIGURED_MANAGED_SERVER_COUNT="${CUSTOM_CONFIGURED_MANAGED_SERVER_COUNT:-2}" \
    CUSTOM_MANAGED_NAME="${CUSTOM_MANAGED_NAME:-MS1}" \
    CUSTOM_CLUSTER_NAME="${CUSTOM_CLUSTER_NAME:-cluster1}" \
    CUSTOM_CLUSTER_TYPE="${CUSTOM_CLUSTER_TYPE:-DYNAMIC}" \
    CUSTOM_PRODUCTION_MODE_ENABLED="${CUSTOM_PRODUCTION_MODE_ENABLED:-prod}" \
    PROPERTIES_FILE_DIR="/app/domains/properties" \
    CUSTOM_JAVA_OPTIONS="-Doracle.jdbc.fanEnabled=false -Dweblogic.StdoutDebugEnabled=false -Dweblogic.rjvm.enableprotocolswitch=true"  \
    CUSTOM_PATH="$PATH:${JAVA_HOME}/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:/u01/oracle/container-scripts"

# Add files required to build this image
COPY --chown=oracle:oracle container-scripts/* /u01/oracle/container-scripts/

#Create directory where domain will be written to
USER root
RUN mkdir -p $CUSTOM_DOMAIN_ROOT && \
    chown -R oracle:oracle $CUSTOM_DOMAIN_ROOT/.. && \
    chmod -R a+xwr $CUSTOM_DOMAIN_ROOT/.. && \
    chmod +x /u01/oracle/container-scripts/*

RUN ln -s  /usr/java/latest/ /usr/java/jdk-8

USER oracle

VOLUME $CUSTOM_DOMAIN_ROOT

WORKDIR $ORACLE_HOME
CMD ["/u01/oracle/container-scripts/createWLSDomain.sh"]


Domain script modified to take values from env vars https://github.com/dveselka/weblogic/blob/master/docker-compose-managed-server/container-scripts/create-wls-domain.py

import os
import socket

def getEnvVar(var):
  val=os.environ.get(var)
  if val==None:
    print "ERROR: Env var ",var, " not set."
    sys.exit(1)
  return val

# This python script is used to create a WebLogic domain
domain_name                   = getEnvVar("CUSTOM_DOMAIN_NAME")
admin_server_name             = os.environ.get("CUSTOM_ADMIN_NAME")
admin_port                    = int(os.environ.get("CUSTOM_ADMIN_PORT"))
server_port                   = int(os.environ.get("CUSTOM_MANAGED_SERVER_PORT"))
managed_server_name_base      = os.environ.get("CUSTOM_MANAGED_SERVER_NAME_BASE")
number_of_ms                  = int(os.environ.get("CUSTOM_CONFIGURED_MANAGED_SERVER_COUNT"))
domain_path                   = os.environ.get("CUSTOM_DOMAIN_HOME")
cluster_name                  = os.environ.get("CUSTOM_CLUSTER_NAME")
cluster_type                  = os.environ.get("CUSTOM_CLUSTER_TYPE")
production_mode_enabled       = os.environ.get("CUSTOM_PRODUCTION_MODE_ENABLED")

username = getEnvVar("CUSTOM_WEBLOGIC_USERNAME")
password = getEnvVar("CUSTOM_WEBLOGIC_PASSWORD")

Docker compose file https://github.com/dveselka/weblogic/blob/master/docker-compose-managed-server/docker-compose.yml

 

version: "3.8"

networks:
  &network wlsnet:
    driver: bridge

services:
  adminserver:
    container_name: adminserver
    hostname: adminserver
    image: 12214-weblogic-domain-generic
    restart: "no" 
    environment:
      JAVA_HOME: "/usr/java/latest"
      CUSTOM_PRODUCTION_MODE_ENABLED: "false"
      CUSTOM_DOMAIN_NAME: daveDomain
      CUSTOM_DOMAIN_ROOT: /app/domains
      CUSTOM_DOMAIN_HOME: /app/domains/daveDomain
      CUSTOM_WEBLOGIC_USERNAME: weblogic
      CUSTOM_WEBLOGIC_PASSWORD: weblogic123
    ports:
      - "7001:7001"
      - "9002:9002"
    networks:
      - *network
    volumes:
      - /app/domains:/app/domains:z


  managedserver:
    container_name: managedserver    
    image: 12214-weblogic-domain-generic
    command: /u01/oracle/container-scripts/startManagedServer.sh 
    restart: "no" 
    environment:
      JAVA_HOME: "/usr/java/latest"
      CUSTOM_PRODUCTION_MODE_ENABLED: "false"
      CUSTOM_DOMAIN_HOME: /app/domains/daveDomain
      CUSTOM_WEBLOGIC_USERNAME: weblogic
      CUSTOM_WEBLOGIC_PASSWORD: weblogic123
    ports:
      - "8001:8001"
    depends_on:
      - adminserver

    networks:
      - *network
    volumes:
      - /app/domains:/app/domains:z  

 
Logs from Docker compose

[dave@dave docker-compose-managed-server]$ docker-compose up
Creating AdminContainer ... done
Creating managedserver  ... done
Attaching to AdminContainer, managedserver
managedserver    | Domain Home is:  /u01/oracle/user_projects/domains/base_domain
AdminContainer   | Domain Home is:  /u01/oracle/user_projects/domains/base_domain
AdminContainer   | /u01/oracle/properties/domain_security.properties
managedserver    | Waiting for WebLogic Admin Server on AdminContainer/7001 to become available...
AdminContainer   | /u01/oracle/properties/domain.properties
AdminContainer   | Java Options: -Doracle.jdbc.fanEnabled=false -Dweblogic.StdoutDebugEnabled=false -Dweblogic.rjvm.enableprotocolswitch=true
AdminContainer   | Starting the Admin Server
AdminContainer   | ==========================
AdminContainer   | .
AdminContainer   | .
AdminContainer   | JAVA Memory arguments: -Djava.security.egd=file:/dev/./urandom
AdminContainer   | .
AdminContainer   | CLASSPATH=/usr/java/jdk-8/lib/tools.jar:/u01/oracle/wlserver/server/lib/weblogic.jar:/u01/oracle/wlserver/../oracle_common/modules/thirdparty/ant-contrib-1.0b3.jar:/u01/oracle/wlserver/modules/features/oracle.wls.common.nodemanager.jar::/u01/oracle/wlserver/common/derby/lib/derbynet.jar:/u01/oracle/wlserver/common/derby/lib/derbyclient.jar:/u01/oracle/wlserver/common/derby/lib/derby.jar
AdminContainer   | .
AdminContainer   | PATH=/u01/oracle/user_projects/domains/base_domain/bin:/u01/oracle/wlserver/server/bin:/u01/oracle/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.10.5.0.0/apache-ant-1.10.5/bin:/usr/java/jdk-8/jre/bin:/usr/java/jdk-8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
AdminContainer   | .
AdminContainer   | ***************************************************
AdminContainer   | *  To start WebLogic Server, use a username and   *
AdminContainer   | *  password assigned to an admin-level user.  For *
AdminContainer   | *  server administration, use the WebLogic Server *
AdminContainer   | *  console at http://hostname:port/console        *
AdminContainer   | ***************************************************
AdminContainer   | Starting WLS with line:
AdminContainer   | /usr/java/jdk-8/bin/java -server   -Djava.security.egd=file:/dev/./urandom -cp /u01/oracle/wlserver/server/lib/weblogic-launcher.jar -Dlaunch.use.env.classpath=true -Dweblogic.Name=AdminServer -Djava.security.policy=/u01/oracle/wlserver/server/lib/weblogic.policy  -Dweblogic.ProductionModeEnabled=true -Doracle.jdbc.fanEnabled=false -Dweblogic.StdoutDebugEnabled=false -Dweblogic.rjvm.enableprotocolswitch=true -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader  -javaagent:/u01/oracle/wlserver/server/lib/debugpatch-agent.jar -da -Dwls.home=/u01/oracle/wlserver/server -Dweblogic.home=/u01/oracle/wlserver/server      weblogic.Server
AdminContainer   | <Feb 7, 2021 1:53:32 PM UTC> <Info> <Security> <BEA-090905> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.> 
AdminContainer   | <Feb 7, 2021 1:53:32 PM UTC> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to HMACDRBG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.> 
AdminContainer   | <Feb 7, 2021 1:53:33 PM UTC> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 25.231-b11 from Oracle Corporation.> 
AdminContainer   | <Feb 7, 2021 1:53:33 PM UTC> <Info> <RCM> <BEA-2165021> <"ResourceManagement" is not enabled in this JVM. Enable "ResourceManagement" to use the WebLogic Server "Resource Consumption Management" feature. To enable "ResourceManagement", you must specify the following JVM options in the WebLogic Server instance in which the JVM runs: -XX:+UnlockCommercialFeatures -XX:+ResourceManagement.> 
AdminContainer   | <Feb 7, 2021 1:53:33 PM UTC> <Info> <Management> <BEA-141107> <Version: WebLogic Server 12.2.1.4.0 Thu Sep 12 04:04:29 GMT 2019 1974621> 
AdminContainer   | <Feb 7, 2021 1:53:34 PM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.> 
AdminContainer   | <Feb 7, 2021 1:53:34 PM UTC> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool.> 
AdminContainer   | <Feb 7, 2021 1:53:34 PM UTC> <Info> <WorkManager> <BEA-002942> <CMM memory level becomes 0. Setting standby thread pool size to 256.> 
AdminContainer   | <Feb 7, 2021 1:53:35,054 PM UTC> <Notice> <Log Management> <BEA-170019> <The server log file weblogic.logging.FileStreamHandler instance=1372879917
AdminContainer   | Current log file=/u01/oracle/user_projects/domains/base_domain/servers/AdminServer/logs/AdminServer.log
AdminContainer   | Rotation dir=/u01/oracle/user_projects/domains/base_domain/servers/AdminServer/logs
AdminContainer   |  is opened. All server side log events will be written to this file.> 
AdminContainer   | <Feb 7, 2021 1:53:35,538 PM UTC> <Notice> <Security> <BEA-090946> <Security pre-initializing using security realm: myrealm> 
AdminContainer   | <Feb 7, 2021 1:53:35,911 PM UTC> <Notice> <Security> <BEA-090947> <Security post-initializing using security realm: myrealm> 
AdminContainer   | <Feb 7, 2021 1:53:37,147 PM UTC> <Notice> <Security> <BEA-090082> <Security initialized using administrative security realm: myrealm> 
AdminContainer   | <Feb 7, 2021 1:53:37,580 PM UTC> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://172.19.0.2:7001/jndi/weblogic.management.mbeanservers.runtime.> 
AdminContainer   | <Feb 7, 2021 1:53:37,942 PM UTC> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://172.19.0.2:7001/jndi/weblogic.management.mbeanservers.domainruntime.> 
AdminContainer   | <Feb 7, 2021 1:53:38,007 PM UTC> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://172.19.0.2:7001/jndi/weblogic.management.mbeanservers.edit.> 
AdminContainer   | <Feb 7, 2021 1:53:38,738 PM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY.> 
AdminContainer   | <Feb 7, 2021 1:53:38,738 PM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.> 
AdminContainer   | <Feb 7, 2021 1:53:38,776 PM UTC> <Notice> <Log Management> <BEA-170036> <The Logging monitoring service timer has started to check for logged message counts every 30 seconds.> 
AdminContainer   | <Feb 7, 2021 1:53:40,767 PM UTC> <Notice> <Log Management> <BEA-170027> <The server has successfully established a connection with the Domain level Diagnostic Service.> 
AdminContainer   | <Feb 7, 2021 1:53:41,489 PM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN.> 
AdminContainer   | <Feb 7, 2021 1:53:41,543 PM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING.> 
AdminContainer   | <Feb 7, 2021 1:53:41,580 PM UTC> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 172.19.0.2:7001 for protocols iiop, t3, ldap, snmp, http.> 
AdminContainer   | <Feb 7, 2021 1:53:41,648 PM UTC> <Notice> <Security> <BEA-090171> <Loading the identity certificate and private key stored under the alias DemoIdentity from the jks keystore file /u01/oracle/user_projects/domains/base_domain/security/DemoIdentity.jks.> 
AdminContainer   | <Feb 7, 2021 1:53:41,654 PM UTC> <Alert> <Security> <BEA-090153> <Demo identity certificate is used in 
AdminContainer   | <Feb 7, 2021 1:53:41,656 PM UTC> <Notice> <Security> <BEA-090169> <Loading trusted certificates from the jks keystore file /u01/oracle/wlserver/server/lib/DemoTrust.jks.> 
AdminContainer   | <Feb 7, 2021 1:53:41,658 PM UTC> <Notice> <Security> <BEA-090169> <Loading trusted certificates from the jks keystore file /usr/java/jdk1.8.0_231-amd64/jre/lib/security/cacerts.> 
AdminContainer   | <Feb 7, 2021 1:53:41,663 PM UTC> <Alert> <Security> <BEA-090152> <Demo trusted CA certificate is being used in 
AdminContainer   | <Feb 7, 2021 1:53:41,666 PM UTC> <Notice> <WebLogicServer> <BEA-000329> <Started the WebLogic Server Administration Server "AdminServer" for domain "base_domain" running in production mode.> 
AdminContainer   | <Feb 7, 2021 1:53:41,666 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DefaultSecure" is now listening on 172.19.0.2:7002 for protocols iiops, t3s, ldaps, https.> 
AdminContainer   | <Feb 7, 2021 1:53:41,667 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DefaultSecure[1]" is now listening on 127.0.0.1:7002 for protocols iiops, t3s, ldaps, https.> 
AdminContainer   | <Feb 7, 2021 1:53:41,667 PM UTC> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.> 
AdminContainer   | <Feb 7, 2021 1:53:41,668 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DaveChannel" is now listening on 172.19.0.2:8001 for protocols t3, http.> 
AdminContainer   | <Feb 7, 2021 1:53:41,668 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DaveChannel[1]" is now listening on 127.0.0.1:8001 for protocols t3, http.> 
AdminContainer   | <Feb 7, 2021 1:53:41,669 PM UTC> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 172.19.0.2:7001 for protocols iiop, t3, ldap, snmp, http.> 
AdminContainer   | <Feb 7, 2021 1:53:41,669 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DefaultSecure" is now listening on 172.19.0.2:7002 for protocols iiops, t3s, ldaps, https.> 
AdminContainer   | <Feb 7, 2021 1:53:41,670 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DefaultSecure[1]" is now listening on 127.0.0.1:7002 for protocols iiops, t3s, ldaps, https.> 
AdminContainer   | <Feb 7, 2021 1:53:41,670 PM UTC> <Notice> <WebLogicServer> <BEA-000360> <The server started in RUNNING mode.> 
AdminContainer   | <Feb 7, 2021 1:53:41,671 PM UTC> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.> 
AdminContainer   | <Feb 7, 2021 1:53:41,672 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DaveChannel" is now listening on 172.19.0.2:8001 for protocols t3, http.> 
AdminContainer   | <Feb 7, 2021 1:53:41,673 PM UTC> <Notice> <Server> <BEA-002613> <Channel "DaveChannel[1]" is now listening on 127.0.0.1:8001 for protocols t3, http.> 
AdminContainer   | <Feb 7, 2021 1:53:41,677 PM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING.> 
managedserver    | WebLogic Admin Server is now available. Proceeding...
managedserver    | Managed Server Name: MS1
managedserver    | Managed Server Home: /u01/oracle/user_projects/domains/base_domain/servers/MS1
managedserver    | Managed Server Security: /u01/oracle/user_projects/domains/base_domain/servers/MS1/security
managedserver    | A properties file with the username and password needs to be supplied.
managedserver exited with code 0
AdminContainer   | 2021-02-07 13:53:42.756/11.265 Oracle Coherence 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational configuration from "jar:file:/u01/oracle/coherence/lib/coherence.jar!/tangosol-coherence.xml"
AdminContainer   | 2021-02-07 13:53:42.797/11.306 Oracle Coherence 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational overrides from "jar:file:/u01/oracle/coherence/lib/coherence.jar!/tangosol-coherence-override-dev.xml"
AdminContainer   | 2021-02-07 13:53:42.801/11.310 Oracle Coherence 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "/tangosol-coherence-override.xml" is not specified
AdminContainer   | 2021-02-07 13:53:42.805/11.315 Oracle Coherence 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "cache-factory-config.xml" is not specified
AdminContainer   | 2021-02-07 13:53:42.808/11.318 Oracle Coherence 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "cache-factory-builder-config.xml" is not specified
AdminContainer   | 2021-02-07 13:53:42.811/11.320 Oracle Coherence 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified
AdminContainer   | 
AdminContainer   | Oracle Coherence Version 12.2.1.4.0 Build 74888
AdminContainer   |  Grid Edition: Development mode
AdminContainer   | Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
AdminContainer   | 
AdminContainer   | 2021-02-07 13:53:42.888/11.397 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Configured versioned, multi-cluster Management over ReST
AdminContainer   | <Feb 7, 2021 1:54:11,563 PM UTC> <Notice> <JMX> <BEA-149535> <JMX Resiliency Activity Server=AdminServer : Initializing callbacks> 
AdminContainer   | <Feb 7, 2021 1:54:11,566 PM UTC> <Notice> <JMX> <BEA-149535> <JMX Resiliency Activity Server=AdminServer : Added MBeanServerConnection in DomainRuntimeServiceMBean > 
AdminContainer   | <Feb 7, 2021 1:54:11,567 PM UTC> <Notice> <JMX> <BEA-149535> <JMX Resiliency Activity Server=AdminServer : Callback is done> 
AdminContainer   | <Feb 7, 2021 1:54:11,570 PM UTC> <Notice> <JMX> <BEA-149535> <JMX Resiliency Activity Server=AdminServer : Connection already exists for the server. Did not attempt to connect to the server> 
AdminContainer   | <Feb 7, 2021 1:54:13,054 PM UTC> <Notice> <JMX> <BEA-149535> <JMX Resiliency Activity Server=All Servers : Resolving connection list DomainRuntimeServiceMBean> 

Managed server start

dminserver      | <Feb 13, 2021 8:14:44,392 AM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING.> 
managedserver    | WebLogic Admin Server is now available. Proceeding...
managedserver    | Managed Server Name: MS1
managedserver    | Managed Server Home: /app/domains/daveDomain/servers/MS1
managedserver    | Managed Server Security: /app/domains/daveDomain/servers/MS1/security
managedserver    | Make directory /app/domains/daveDomain/servers/MS1/security to create boot.properties
managedserver    | Java Options: -Doracle.jdbc.fanEnabled=false -Dweblogic.StdoutDebugEnabled=false -Dweblogic.rjvm.enableprotocolswitch=true
managedserver    | Connecting to Admin Server at http://adminserver:7001
managedserver    | .
managedserver    | .
managedserver    | JAVA Memory arguments: -Djava.security.egd=file:/dev/./urandom
managedserver    | .
managedserver    | CLASSPATH=/usr/java/jdk1.8.0_231-amd64/lib/tools.jar:/u01/oracle/wlserver/server/lib/weblogic.jar:/u01/oracle/wlserver/../oracle_common/modules/thirdparty/ant-contrib-1.0b3.jar:/u01/oracle/wlserver/modules/features/oracle.wls.common.nodemanager.jar:/u01/oracle/wlserver/common/derby/lib/derbyclient.jar:/u01/oracle/wlserver/common/derby/lib/derby.jar
managedserver    | .
managedserver    | PATH=/app/domains/daveDomain/bin:/u01/oracle/wlserver/server/bin:/u01/oracle/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.10.5.0.0/apache-ant-1.10.5/bin:/usr/java/jdk1.8.0_231-amd64/jre/bin:/usr/java/jdk1.8.0_231-amd64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
managedserver    | .
managedserver    | ***************************************************
managedserver    | *  To start WebLogic Server, use a username and   *
managedserver    | *  password assigned to an admin-level user.  For *
managedserver    | *  server administration, use the WebLogic Server *
managedserver    | *  console at http://hostname:port/console        *
managedserver    | ***************************************************
managedserver    | Starting WLS with line:
managedserver    | /usr/java/jdk1.8.0_231-amd64/bin/java -server   -Djava.security.egd=file:/dev/./urandom -cp /u01/oracle/wlserver/server/lib/weblogic-launcher.jar -Dlaunch.use.env.classpath=true -Dweblogic.Name=MS1 -Djava.security.policy=/u01/oracle/wlserver/server/lib/weblogic.policy -Doracle.jdbc.fanEnabled=false -Dweblogic.StdoutDebugEnabled=false -Dweblogic.rjvm.enableprotocolswitch=true -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader  -javaagent:/u01/oracle/wlserver/server/lib/debugpatch-agent.jar -da -Dwls.home=/u01/oracle/wlserver/server -Dweblogic.home=/u01/oracle/wlserver/server   -Dweblogic.management.server=http://adminserver:7001   weblogic.Server
adminserver      | 2021-02-13 08:14:45.918/7.656 Oracle Coherence 12.2.1.4.0 <Info> (thread=[STANDBY] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational configuration from "jar:file:/u01/oracle/coherence/lib/coherence.jar!/tangosol-coherence.xml"

Thursday, August 4, 2016

Deploy Java application from GitHub to AWS

HOWTO from AWS tutorial


AWS tutorial video  Code Deploy Setup (IAM, EC2)
https://www.youtube.com/watch?v=qZa5JXmsWZs

GitHub for AWS tutorial video https://github.com/andrewpuch/code_deploy_example/

AWS CodeDeploy tutorial video https://www.youtube.com/watch?v=jcR9iIWdU7E

Steps to create running AWS EC2 instance


Create AWS free account

Getting started :
https://aws.amazon.com/free/

Create AWS account




Create own Linux instance
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html


Connect to AWS Linux instance via ssh

[dave@localhost aws]$ chmod 400 dave_amazon.pem
[dave@localhost aws]$ ssh -i "dave_amazon.pem" ec2-user@ec2-11-123-765-44.us-west-2.compute.amazonaws.com


       __|  __|_  )
       _|  (     /   Amazon Linux AMI
      ___|\___|___|

https://aws.amazon.com/amazon-linux-ami/2016.03-release-notes/
8 package(s) needed for security, out of 17 available
Run "sudo yum update" to apply all updates.


Install AWS tools on Fedora

https://fedoramagazine.org/aws-tools-fedora/

[root@localhost ~]# dnf install  awscli
Dependencies resolved.
=================================================================================================
 Package                  Arch         Version                               Repository     Size
=================================================================================================
Installing:
 awscli                   noarch       1.10.45-1.fc23                        updates       868 k
 python3-botocore         noarch       1.4.35-1.fc23                         updates       1.8 M
 python3-colorama         noarch       0.3.2-2.fc23                          fedora         29 k
 python3-docutils         noarch       0.12-0.3.20140510svn7747.fc23         fedora        1.5 M
 python3-jmespath         noarch       0.9.0-1.fc23                          updates        43 k
 python3-pyasn1           noarch       0.1.8-1.fc23                          fedora        108 k
 python3-rsa              noarch       3.4.1-1.fc23                          updates        72 k
 python3-s3transfer       noarch       0.0.1-2.fc23                          updates        29 k

Transaction Summary
=================================================================================================
Install  8 Packages

Total download size: 4.5 M
Installed size: 27 M
Is this ok [y/N]: 
Paste your text here.

  

[dave@localhost aws]$ aws --version
aws-cli/1.10.45 Python/3.4.3 Linux/4.5.7-200.fc23.x86_64 botocore/1.4.35

 Add AWS IAM access keys

[dave@localhost aws]$ aws configure

Check running instances 

[dave@localhost aws]$ aws ec2 describe-instances 
{
    "Reservations": [
        {
            "Instances": [
                {
                    "PublicDnsName":

Integrating AWS CodeDeploy with GitHub

https://docs.aws.amazon.com/codedeploy/latest/userguide/github-integ.html


Setup roles in IAM
https://docs.aws.amazon.com/codedeploy/latest/userguide/getting-started-setup.html



Amazon AWS Java samples
https://github.com/aws/aws-sdk-java/tree/master/src/samples



Create GitHub repository with sample application
https://github.com/dveselka/aws-java-sample

User guide GitHub - AWS integration
https://docs.aws.amazon.com/codedeploy/latest/userguide/github-integ-tutorial.html 

Create application - see tutorial page
  Step 5: Deploy the Application to the Instance


Connect with GitHub


Deploy AWS sample Linux
https://github.com/dveselka/aws-sample-linux


Check AWS CodeDeploy console

Deploy fails with HEALTH_CONSTRAINTS

It is necessary to install CodeDeploy on instance
Follow this tutorial :

Install or reinstall the AWS CodeDeploy agent for Amazon Linux or RHEL

https://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-run-agent-install.html#how-to-run-agent-install-linux

[ec2-user@ip-172-31-21-129 ~]$ wget https://aws-codedeploy-eu-central-1.s3.amazonaws.com/latest/install
--2016-08-07 13:45:20--  https://aws-codedeploy-eu-central-1.s3.amazonaws.com/latest/install
Resolving aws-codedeploy-eu-central-1.s3.amazonaws.com (aws-codedeploy-eu-central-1.s3.amazonaws.com)... 54.231.193.44
Connecting to aws-codedeploy-eu-central-1.s3.amazonaws.com (aws-codedeploy-eu-central-1.s3.amazonaws.com)|54.231.193.44|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 13359 (13K) []
Saving to: ‘install’

install                    100%[======================================>]  13.05K  78.6KB/s    in 0.2s    

2016-08-07 13:45:21 (78.6 KB/s) - ‘install’ saved [13359/13359]


Check installation success
[ec2-user@ip-172-31-21-129 ~]$ sudo service codedeploy-agent status
The AWS CodeDeploy agent is running as PID 2660


Deploy application from GithHub  using CodeDeploy - Deployments


Access application using public IP address





Check log on EC2 instance

c2-user]# tail -500f /var/log/httpd/access_log 
189.278.189.245 - - [24/Sep/2016:18:03:53 +0000] "GET / HTTP/1.1" 200 911 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0"



Sample app Linux
https://github.com/awslabs/aws-codedeploy-samples/tree/master/applications/SampleApp_Linux

Sample Tomcat application on GitHub
https://github.com/awslabs/aws-codedeploy-sample-tomcat


You can also download sample app from Amazon S3
[dave@localhost aws]$ aws s3 cp s3://aws-codedeploy-eu-central-1/samples/latest/SampleApp_Linux.zip . --region eu-central-1
download: s3://aws-codedeploy-eu-central-1/samples/latest/SampleApp_Linux.zip to ./SampleApp_Linux.zip

[dave@localhost aws]$ unzip -l SampleApp_Linux.zip 
Archive:  SampleApp_Linux.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
       34  11-03-2014 22:42   scripts/install_dependencies
       33  11-03-2014 22:43   scripts/start_server
      105  11-03-2014 22:43   scripts/stop_server
      359  11-03-2014 22:42   appspec.yml
      717  11-03-2014 22:42   index.html
    10884  11-03-2014 22:42   LICENSE.txt
---------                     -------
    12132                     6 files