Sunday, October 15, 2017

Build Weblogic Docker image

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


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


1. Build Java image

Download latest Java 8 JRE

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



2. Build Weblogic 12.2.1.2 image

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

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


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

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


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

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

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

  Build completed in 981 seconds.



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


Build Weblogic domain image

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

Run
docker build -t 12212-domain .

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


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


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


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

Sunday, September 17, 2017

Weblogic 12.2.1 - build webservice using jwsc Ant task

We want to test Ant jwsc task on Weblogic 12.2.1 server 

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

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

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


Project structure

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

./build:
META-INF
WsExample.war

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

./dist:
WsExample.ear

./lib:

./src:
org

./src/org:
dave

./src/org/dave:
SayHello.java


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

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

// Import the standard JWS annotation interfaces

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

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

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

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

public class SayHello {

  // Required constructor

  public SayHello() {}

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

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

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

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


Deploy webservice

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

Main targets:

Other targets:

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

init:

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

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



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


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


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

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

Test result:

request
    request-1505645963920

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



response:

    response-1505645964157

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





Weblogic 12.2 1 - implement WebService using Maven Archetype

Java EE7 web service tutorial
https://docs.oracle.com/javaee/7/tutorial/jaxws.htm

Here is description  for basic webservice implementation in Weblogic 12.2.1 docs
https://docs.oracle.com/middleware/12211/lcm/MAVEN/weblogic_maven.htm#MAVEN8785

Requires configuration of Oracle Maven repository on local host - see here http://danielveselka.blogspot.cz/2016/01/using-maven-on-weblogic-1221-with-java.html

Use Maven  archetype to generate application

mvn archetype:generate -DarchetypeGroupId=com.oracle.weblogic.archetype -DarchetypeArtifactId=basic-webservice -DarchetypeVersion=12.2.1-0-0 -DgroupId=org.dave -DartifactId=dave-basic-webservice-project  -Dversion=1.0-SNAPSHOT


[INFO] Archetype repository missing. Using the one from [com.oracle.weblogic.archetype:basic-webservice:12.2.1-0-0] found in catalog local
[INFO] Using property: groupId = org.dave
[INFO] Using property: artifactId = dave-basic-webservice-project
[INFO] Using property: version = 1.0-SNAPSHOT
[INFO] Using property: package = org.dave
Confirm properties configuration:
groupId: org.dave
artifactId: dave-basic-webservice-project
version: 1.0-SNAPSHOT
package: org.dave

Run mvn compile

META-INF/application.xml

<?xml version='1.0' encoding='UTF-8'?>
<application xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="5">
  <display-name>target</display-name>
  <module>
    <web>
      <web-uri>SayHello</web-uri>
      <context-root>basicWebservice</context-root>
    </web>
  </module>
</application>


Run mvn package

[dave@localhost dave-basic-webservice-project]$ mvn package
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building basicWebservice 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ dave-basic-webservice-project ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/dave/git/weblogic/dave-basic-webservice-project/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ dave-basic-webservice-project ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- weblogic-maven-plugin:12.2.1-0-0:ws-jwsc (default) @ dave-basic-webservice-project ---
EarFile] Application File : /home/dave/git/weblogic/dave-basic-webservice-project/target/META-INF/application.xml
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ dave-basic-webservice-project ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/dave/git/weblogic/dave-basic-webservice-project/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ dave-basic-webservice-project ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ dave-basic-webservice-project ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ dave-basic-webservice-project ---
[INFO] Packaging webapp
[INFO] Assembling webapp [dave-basic-webservice-project] in [/home/dave/git/weblogic/dave-basic-webservice-project/target/generated-dave-basic-webservice-project]
[INFO] Processing war project
[INFO] Webapp assembled in [76 msecs]
[INFO] Building war: /home/dave/git/weblogic/dave-basic-webservice-project/target/basicWebservice.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS


Run mvn preintegration-test

INFO] Packaging webapp
[INFO] Assembling webapp [dave-basic-webservice-project] in [/home/dave/git/weblogic/dave-basic-webservice-project/target/generated-dave-basic-webservice-project]
[INFO] Processing war project
[INFO] Webapp assembled in [206 msecs]
[INFO] Building war: /home/dave/git/weblogic/dave-basic-webservice-project/target/basicWebservice.war
[INFO] 
[INFO] --- weblogic-maven-plugin:12.2.1-0-0:deploy (deployApp) @ dave-basic-webservice-project ---
[INFO] Command flags are: -noexit -deploy -username weblogic -password ******* -name basicWebservice -source /home/dave/git/weblogic/dave-basic-webservice-project/target/basicWebservice.war -verbose -adminurl t3://localhost:7001
weblogic.Deployer invoked with options:  -noexit -deploy -username weblogic -name basicWebservice -source /home/dave/git/weblogic/dave-basic-webservice-project/target/basicWebservice.war -verbose -adminurl t3://localhost:7001
<Sep 17, 2017 11:48:26 AM CEST> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating deploy operation for application, basicWebservice [archive: /home/dave/git/weblogic/dave-basic-webservice-project/target/basicWebservice.war], to configured targets.> 
Task 0 initiated: [Deployer:149026]deploy application basicWebservice on AdminServer.
Task 0 completed: [Deployer:149026]deploy application basicWebservice on AdminServer.
Target state: deploy completed on Server AdminServer

Target Assignments:
+ basicWebservice  AdminServer
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS


Test the application http://localhost:7001/basicWebservice/SayHello

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

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

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

Test using browser client
http://localhost:7001/ws_utc/?wsdlUrl=http://localhost:7001/basicWebservice/SayHello?wsdl

Friday, September 15, 2017

Weblogic wlfullclient.jar deprecated

Since Weblogic 12.1.3 wlfullclient.jar is deprecated https://docs.oracle.com/middleware/1213/wls/SACLT/t3.htm#SACLT130

The WebLogic full client, wlfullclient.jar, is deprecated as of WebLogic Server 12.1.3 and may be removed in a future release. Oracle recommends using the WebLogic Thin T3 client or other appropriate client depending on your environment. For more information on WebLogic client types, see WebLogic Server Client Types and Features.


Using https://jarscan.com/ we can found which jars are required to compile/run Weblogic applications


[dave@localhost lib]$ java -jar /home/dave/Downloads/jarscan.jar -class weblogic.application.ApplicationLifecycleListener
 
=========================
JarScan
written by Geoff Yaworski
gyaworski@hotmail.com
Version 2.0
=========================
 
 
Looking for class(es): [weblogic.application.ApplicationLifecycleListener]
 
Processed 223 directories containing 1139 files
found 127 libraries under the directory: /home/app/weblogic-12.2.1/wlserver/server/lib
 
1) spring-console.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/spring-console.jar]
2) diagnostics-console-extension.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/diagnostics-console-extension.jar]
3) spring-console-l10n.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/spring-console-l10n.jar]
4) weblogic-sca-console.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/weblogic-sca-console.jar]
5) diagnostics-console-extension-l10n.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/diagnostics-console-extension-l10n.jar]
6) coherence.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/coherence.jar]
7) core-partition-l10n.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/core-partition-l10n.jar]
8) wtc.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/wtc.jar]
9) core-connector.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/core-connector.jar]
10) jolt-l10n.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/jolt-l10n.jar]
11) jolt.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/jolt.jar]
12) core-ejb.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/core-ejb.jar]
13) core-jms.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/core-jms.jar]
14) core-partition.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/core-partition.jar]
15) coherence-l10n.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/coherence-l10n.jar]
16) wtc-l10n.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/autodeploy/wtc-l10n.jar]
17) weblogic-sca-console-l10n.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/console-ext/weblogic-sca-console-l10n.jar]
18) weblogic-spring.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/weblogic-spring.jar]
19) wljmsclient.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wljmsclient.jar]
20) wljmxclient.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wljmxclient.jar]
21) wlconnector.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wlconnector.jar]
22) wldeploy.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wldeploy.jar]
23) debugpatch-agent.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/debugpatch-agent.jar]
24) wls-api.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wls-api.jar]
25) osgi.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/osgi.jar]
26) wlthint3client.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wlthint3client.jar]
27) Eclipse-Installer.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/Eclipse-Installer.jar]
28) api.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/api.jar]
29) weblogic-launcher.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/weblogic-launcher.jar]
30) pcl2.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/pcl2.jar]
31) diagnostics-image-binding.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/schema/diagnostics-image-binding.jar]
32) diagnostics-binding.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/schema/diagnostics-binding.jar]
33) weblogic-domain-binding.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/schema/weblogic-domain-binding.jar]
34) weblogic-domain-binding-compatibility.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/schema/weblogic-domain-binding-compatibility.jar]
35) wlw-langx.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wlw-langx.jar]
36) wlnmclient.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wlnmclient.jar]
37) wl-j2ee-client.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wl-j2ee-client.jar]
38) wlfullclient.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wlfullclient.jar]
39) jrmpclient.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/jrmpclient.jar]
40) wlsafclient.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wlsafclient.jar]
41) console-zh_CN.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/console-zh_CN.jar]
42) l10n_taglib.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/l10n_taglib.jar]
43) portlet-container.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/portlet-container.jar]
44) console-pt_BR.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/console-pt_BR.jar]
45) standard.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/standard.jar]
46) console-it.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/console-it.jar]
47) console-de.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/console-de.jar]
48) netui-adapter.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/netui-adapter.jar]
49) wldfclient-min.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/wldfclient-min.jar]
50) netuix_common_web.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/netuix_common_web.jar]
51) console.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/console.jar]
52) beehive-netui-tags.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/beehive-netui-tags.jar]
53) skeleton_taglib.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/skeleton_taglib.jar]
54) beehive-netui-core.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/beehive-netui-core.jar]
55) prefs-spi.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/prefs-spi.jar]
56) console-zh_TW.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/console-zh_TW.jar]
57) beehive-controls.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/beehive-controls.jar]
58) console-ja.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/console-ja.jar]
59) render_taglib.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/render_taglib.jar]
60) console-fr.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/console-fr.jar]
61) struts.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/struts.jar]
62) console-ko.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/console-ko.jar]
63) struts-adapter.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/struts-adapter.jar]
64) netuix_servlet.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/netuix_servlet.jar]
65) console-es.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/console-es.jar]
66) client_taglib.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/webapp/WEB-INF/lib/client_taglib.jar]
67) console-help-html-l10n.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/virtualdirectory/console-help-html-l10n.jar]
68) console-help-html.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/virtualdirectory/console-help-html.jar]
69) l10n_taglib.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/l10n_taglib.jar]
70) portlet-container.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/portlet-container.jar]
71) standard.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/standard.jar]
72) netuix_common_web.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/netuix_common_web.jar]
73) console.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/console.jar]
74) beehive-netui-tags.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/beehive-netui-tags.jar]
75) skeleton_taglib.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/skeleton_taglib.jar]
76) beehive-netui-core.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/beehive-netui-core.jar]
77) prefs-spi.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/prefs-spi.jar]
78) render_taglib.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/render_taglib.jar]
79) struts.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/struts.jar]
80) jh.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/jh.jar]
81) struts-adapter.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/struts-adapter.jar]
82) netuix_servlet.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/consolehelp/WEB-INF/lib/netuix_servlet.jar]
83) netuix_common.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/netuix_common.jar]
84) commons-codec-1.3.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/commons-codec-1.3.jar]
85) wsrp-common.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/wsrp-common.jar]
86) jakarta-oro.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/jakarta-oro.jar]
87) netuix_system.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/netuix_system.jar]
88) commons-fileupload.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/commons-fileupload.jar]
89) standard.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/standard.jar]
90) jstl.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/jstl.jar]
91) wsrp-client.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/wsrp-client.jar]
92) p13n_system.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/p13n_system.jar]
93) commons-logging-1.0.4.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/commons-logging-1.0.4.jar]
94) com.bea.core.process_5.4.0.0.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/com.bea.core.process_5.4.0.0.jar]
95) p13n-schemas.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/p13n-schemas.jar]
96) commons-io-2.4.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/commons-io-2.4.jar]
97) netuix_schemas.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/netuix_schemas.jar]
98) log4j-1.2.8.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/log4j-1.2.8.jar]
99) commons-digester.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/commons-digester.jar]
100) struts.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/struts.jar]
101) p13n_common.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/p13n_common.jar]
102) commons-beanutils.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/commons-beanutils.jar]
103) commons-validator-1.4.1.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/commons-validator-1.4.1.jar]
104) wlw-system.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/consoleapp/APP-INF/lib/wlw-system.jar]
105) wlclient.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wlclient.jar]
106) jcom.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/jcom.jar]
107) wlsaft3client.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wlsaft3client.jar]
108) wlUserConfigCompatibility.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/compatibility/wlUserConfigCompatibility.jar]
109) wllog4j.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wllog4j.jar]
110) org.apache.felix.org.apache.felix.main.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/org.apache.felix.org.apache.felix.main.jar]
111) bea_wls_remote_deployer.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/bea_wls_remote_deployer.jar]
112) mejb.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/mejb.jar]
113) weblogic.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/weblogic.jar]
114) saml2-security-providers.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/mbeantypes/saml2-security-providers.jar]
115) wlManagementMBean.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/mbeantypes/wlManagementMBean.jar]
116) xacml-security-providers.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/mbeantypes/xacml-security-providers.jar]
117) system-password-validator-provider.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/mbeantypes/system-password-validator-provider.jar]
118) wlManagementImplSource.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/mbeantypes/wlManagementImplSource.jar]
119) wls-security-providers.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/mbeantypes/wls-security-providers.jar]
120) wls-api-part.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wls-api-part.jar]
121) weblogic-L10N.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/weblogic-L10N.jar]
122) sslj.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/sslj.jar]
123) javax.javaee-api.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/javax.javaee-api.jar]
124) cryptoj.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/cryptoj.jar]
125) diagnostics-agent.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/diagnostics-agent.jar]
126) jcmFIPS.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/jcmFIPS.jar]
127) wljarbuilder.jar [/home/app/weblogic-12.2.1/wlserver/server/lib/wljarbuilder.jar]
 
searching these jarfiles now ....
 
===============================================
Found: weblogic.application.ApplicationLifecycleListener
Class: weblogic.application.ApplicationLifecycleListener
Package: weblogic.application
Library Name: wls-api.jar
Library Path: /home/app/weblogic-12.2.1/wlserver/server/lib/wls-api.jar
===============================================
 
===============================================
Found: weblogic.application.ApplicationLifecycleListener
Class: weblogic.application.ApplicationLifecycleListener
Package: weblogic.application
Library Name: wlfullclient.jar
Library Path: /home/app/weblogic-12.2.1/wlserver/server/lib/wlfullclient.jar
===============================================
 
===============================================
Found: weblogic.application.ApplicationLifecycleListener
Class: weblogic.application.ApplicationLifecycleListener
Package: weblogic.application
Library Name: wls-api-part.jar
Library Path: /home/app/weblogic-12.2.1/wlserver/server/lib/wls-api-part.jar
===============================================
 
Search took: 2633 milliseconds.


Wednesday, November 2, 2016

Run Docker JBoss Wildfly image on AWS ECS

Install Docker on AWS ECS
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html


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

https://aws.amazon.com/amazon-linux-ami/2016.09-release-notes/
[ec2-user@ip-172-31-31-199 ~]$ sudo yum update -y
Loaded plugins: priorities, update-motd, upgrade-helper
No packages marked for update
[ec2-user@ip-172-31-31-199 ~]$  sudo yum install -y docker
Loaded plugins: priorities, update-motd, upgrade-helper
Resolving Dependencies
--> Running transaction check
---> Package docker.x86_64 0:1.11.2-1.6.amzn1 will be installed
--> Processing Dependency: xfsprogs for package: docker-1.11.2-1.6.amzn1.x86_64
--> Running transaction check
---> Package xfsprogs.x86_64 0:3.2.2-2.20.amzn1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package         Arch          Version                   Repository        Size
================================================================================
Installing:
 docker          x86_64        1.11.2-1.6.amzn1          amzn-main         17 M
Installing for dependencies:
 xfsprogs        x86_64        3.2.2-2.20.amzn1          amzn-main        1.7 M

Transaction Summary
================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 18 M
Installed size: 59 M
Downloading packages:
(1/2): docker-1.11.2-1.6.amzn1.x86_64.rpm                |  17 MB     00:00     
(2/2): xfsprogs-3.2.2-2.20.amzn1.x86_64.rpm              | 1.7 MB     00:00     
--------------------------------------------------------------------------------
Total                                               21 MB/s |  18 MB  00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : xfsprogs-3.2.2-2.20.amzn1.x86_64                             1/2 
  Installing : docker-1.11.2-1.6.amzn1.x86_64                                                        2/2 
  Verifying  : docker-1.11.2-1.6.amzn1.x86_64                                                        1/2 
  Verifying  : xfsprogs-3.2.2-2.20.amzn1.x86_64                                                      2/2 

Installed:
  docker.x86_64 0:1.11.2-1.6.amzn1                                                                       

Dependency Installed:
  xfsprogs.x86_64 0:3.2.2-2.20.amzn1                                                                     

Complete!
[ec2-user@ip-172-31-31-199 ~]$ sudo service docker start
Starting cgconfig service:                                 [  OK  ]
Starting docker:    .                                  [  OK  ]
[ec2-user@ip-172-31-31-199 ~]$ sudo usermod -a -G docker ec2-user
[ec2-user@ip-172-31-31-199 ~]$ 

Verify Docker status

[ec2-user@ip-172-31-31-199 ~]$ docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.11.2
Storage Driver: devicemapper
 Pool Name: docker-202:1-394626-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 10.74 GB
 Backing Filesystem: xfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 11.8 MB
 Data Space Total: 107.4 GB
 Data Space Available: 7.223 GB
 Metadata Space Used: 581.6 kB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.147 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 WARNING: Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning.
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.93-RHEL7 (2015-01-28)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: null host bridge
Kernel Version: 4.4.23-31.54.amzn1.x86_64
Operating System: Amazon Linux AMI 2016.09
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 995.4 MiB
Name: ip-172-31-31-199
ID: IEGJ:BLTG:7DGR:PNN7:SDZS:3M7H:L6LR:CB3M:52IV:SG2R:O3KF:NZPI
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): false
Registry: https://index.docker.io/v1/
[ec2-user@ip-172-31-31-199 ~]$ 


Run JBoss Wildfly Docker image

[ec2-user@ip-172-31-31-199 ~]$ docker run -it -p 8080:8080 jboss/wildfly 
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /opt/jboss/wildfly

  JAVA: /usr/lib/jvm/java/bin/java

  JAVA_OPTS:  -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

=========================================================================

21:14:22,924 INFO  [org.jboss.modules] (main) JBoss Modules version 1.5.2.Final
21:14:23,279 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
21:14:23,368 INFO  [org.jboss.as] (MSC service thread 1-1) WFLYSRV0049: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) starting


List Docker processes

[ec2-user@ip-172-31-31-199 ~]$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
0a5959e5cd9e        jboss/wildfly       "/opt/jboss/wildfly/b"   9 minutes ago       Up 9 minutes        0.0.0.0:8080->8080/tcp   adoring_allen


Connect to Wildfly with links browser from other shell

Install links and connect to http:localhost:8080



[ec2-user@ip-172-31-31-199 ~]$ yum install links

[ec2-user@ip-172-31-31-199 ~]$ links http://localhost:8080




Monday, October 31, 2016

Install Java EE7 application using JBoss Wildfly Docker image


Docker and WildFly Part 1 - Deployment via Docker volumes 

 
Docker and WildFly Part 2 - Deployment over management API


https://github.com/goldmann/wildfly-docker-deployment-example

Download JBoss Wildfly image
https://hub.docker.com/r/jboss/wildfly/


[dave@localhost wildfly]$ docker run -it jboss/wildfly
Unable to find image 'jboss/wildfly:latest' locally
latest: Pulling from jboss/wildfly

8d30e94188e7: Pull complete 
183bb107e46a: Pull complete 
9ea1527ac190: Pull complete 
d632efeddd98: Pull complete 
11af01a2d795: Pull complete 
Digest: sha256:2bed1e7a68245509de5837435b6250491efe61a86533f5ce6bf94927814076fb
Status: Downloaded newer image for jboss/wildfly:latest
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /opt/jboss/wildfly

  JAVA: /usr/lib/jvm/java/bin/java

  JAVA_OPTS:  -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

=========================================================================


Use port redirect to see Wildfly running in the browser

[dave@localhost wildfly]$ docker run -it -p 8080:8080 jboss/wildfly 

Wildfly home page
Add access to console using own Dockerfile

[dave@localhost wildfly]$ more Dockerfile 
FROM jboss/wildfly:latest

USER jboss
RUN /opt/jboss/wildfly/bin/add-user.sh admin MY_PASSWORD_TO_ACCESS --silent
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]


Build the Docker image

[dave@localhost wildfly]$ docker build --tag=wildfly-mgmt .
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM jboss/wildfly:latest
 ---> 4c99bd2cd264
Step 2 : USER jboss
 ---> Running in de10054221e5
 ---> f3b3e54e823b
Removing intermediate container de10054221e5
Step 3 : RUN /opt/jboss/wildfly/bin/add-user.sh admin MY_PASSWORD_TO_ACCESS --silent
 ---> Running in 9af7cd245555
 ---> 5a29ccf7bef0
Removing intermediate container 9af7cd245555
Step 4 : CMD /opt/jboss/wildfly/bin/standalone.sh -b 0.0.0.0 -bmanagement 0.0.0.0
 ---> Running in 642784343b49
 ---> 3ea63bcef45a
Removing intermediate container 642784343b49
Successfully built 3ea63bcef45a


Start with port 8080 and 9990 redirected

[dave@localhost wildfly]$ docker run -it -p 8080:8080 -p 9990:9990  wildfly-mgmt

Check the console access via browser on 9990


Deploy Java EE7 app using Maven

Source code for the application GitHub https://github.com/dveselka/wildfly/tree/master/dave-java-ee7-wildfly-full

[dave@localhost dave-java-ee7-wildfly-full]$  mvn clean package wildfly:deploy
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] dave-java-ee7-wildfly-full
[INFO] dave-java-ee7-wildfly-full: EJB Module
[INFO] dave-java-ee7-wildfly-full: WAR Module
[INFO] dave-java-ee7-wildfly-full: EAR Module
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building dave-java-ee7-wildfly-full 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ dave-java-ee7-wildfly-full ---
[INFO] 
[INFO] >>> wildfly-maven-plugin:1.0.2.Final:deploy (default-cli) > package @ dave-java-ee7-wildfly-full >>>
[INFO] 
[INFO] <<< wildfly-maven-plugin:1.0.2.Final:deploy (default-cli) < package @ dave-java-ee7-wildfly-full <<<
[INFO] 
[INFO] --- wildfly-maven-plugin:1.0.2.Final:deploy (default-cli) @ dave-java-ee7-wildfly-full ---

Deployment in Docker Widlfy

05:32:38,366 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started in 4639ms - Started 331 of 577 services (393 services are lazy, passive or on-demand)
05:43:49,778 INFO  [org.jboss.as.repository] (management-handler-thread - 1) WFLYDR0001: Content added at location /opt/jboss/wildfly/standalone/data/content/a1/58abbd7beeb79e23f10486bbefb72f55dc5368/content
05:43:49,861 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0027: Starting deployment of "dave-java-ee7-wildfly-full-ear.ear" (runtime-name: "dave-java-ee7-wildfly-full-ear.ear")
05:43:50,006 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0207: Starting subdeployment (runtime-name: "dave-java-ee7-wildfly-full-web.war")
05:43:50,006 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) WFLYSRV0207: Starting subdeployment (runtime-name: "dave-java-ee7-wildfly-full-ejb.jar")
05:43:50,168 WARN  [org.jboss.as.connector] (MSC service thread 1-1) WFLYJCA0091: -ds.xml file deployments are deprecated. Support may be removed in a future version.
05:43:50,620 INFO  [org.jboss.as.jpa] (MSC service thread 1-5) WFLYJPA0002: Read persistence.xml for primary
05:43:50,900 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) WFLYJCA0001: Bound data source [java:jboss/datasources/dave-java-ee7-wildfly-fullDS]
05:43:50,966 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 69) WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'dave-java-ee7-wildfly-full-ear.ear/dave-java-ee7-wildfly-full-ejb.jar#primary'
05:43:50,977 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) WFLYWELD0003: Processing weld deployment dave-java-ee7-wildfly-full-ear.ear
05:43:51,095 INFO  [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 69) HHH000204: Processing PersistenceUnitInfo [
    name: primary
    ...]
05:43:51,494 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-1) HV000001: Hibernate Validator 5.2.4.Final
05:43:51,653 INFO  [org.hibernate.Version] (ServerService Thread Pool -- 69) HHH000412: Hibernate Core {5.0.10.Final}
05:43:51,655 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 69) HHH000206: hibernate.properties not found
05:43:51,664 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 69) HHH000021: Bytecode provider name : javassist
05:43:51,864 INFO  [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 69) HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
05:43:52,082 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) WFLYWELD0003: Processing weld deployment dave-java-ee7-wildfly-full-ejb.jar
05:43:52,090 INFO  [org.jboss.weld.deployer] (MSC service thread 1-5) WFLYWELD0003: Processing weld deployment dave-java-ee7-wildfly-full-web.war
05:43:52,120 INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-1) WFLYEJB0473: JNDI bindings for session bean named 'MemberRegistration' in deployment unit 'subdeployment "dave-java-ee7-wildfly-full-ejb.jar" of deployment "dave-java-ee7-wildfly-full-ear.ear"' are as follows:

    java:global/dave-java-ee7-wildfly-full-ear/dave-java-ee7-wildfly-full-ejb/MemberRegistration!dave.service.MemberRegistration
    java:app/dave-java-ee7-wildfly-full-ejb/MemberRegistration!dave.service.MemberRegistration
    java:module/MemberRegistration!dave.service.MemberRegistration
    java:global/dave-java-ee7-wildfly-full-ear/dave-java-ee7-wildfly-full-ejb/MemberRegistration
    java:app/dave-java-ee7-wildfly-full-ejb/MemberRegistration
    java:module/MemberRegistration


Check the application in the browser

Tuesday, October 25, 2016

Run Arquillian test on JBoss EAP 7/ Wildfly 10 using Arquillian Chameleon Container

Arqullian

http://arquillian.org/guides/getting_started/

Arquillian Chameleon Container

 https://github.com/arquillian/arquillian-container-chameleon

 http://discuss.arquillian.org/t/proxy-container-for-all-jboss-as-jboss-eap-wildfly/124/7

 Add Maven dependency ( check for latest version )

<dependency>
    <groupId>org.arquillian.container</groupId>
    <artifactId>arquillian-container-chameleon</artifactId>
    <version>1.0.0.Alpha7</version>
</dependency>

Add container configuration into arquillian.xml file

<arquillian xmlns="http://jboss.org/schema/arquillian"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
    
     <container qualifier="chameleon" default="true">
        <configuration>
            <property name="chameleonTarget">jboss eap:7.0.1:remote</property>
            <property name="managementAddress">localhost</property>
            <property name="managementPort">9990</property>
            <property name="username">${jboss.admin.user}</property>
            <property name="password">${jboss.admin.password}!</property>
        </configuration>
    </container>
   
</arquillian>


Add Maven dependencies in multi-module project using shrinkwrap-resolver-impl-maven http://stackoverflow.com/questions/13001371/adding-all-maven-dependencies-to-arquillian

https://github.com/shrinkwrap/resolver


Add Chameleon container dependency ( using runTests profile )

<profile>
            <id>runTests</id>
            <activation>
                <property>
                    <name>runTests</name>
                    <value>true</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                     <groupId>org.arquillian.container</groupId>
                     <artifactId>arquillian-container-chameleon</artifactId>
                 </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <skipTests>false</skipTests>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

Run the single test using Maven command line

$ mvn clean install -PrunTests  -Dtest=ArqTestCase