Feed aggregator

Docker-Machine: how to create a docker vm on a remote virtualbox server

Dietrich Schroff - Sun, 2018-02-11 01:37
After doing some first steps with docker, i wanted to test docker-swarm. Because of the limited resources of my notebook, i was looking for a Linux with a minimal footprint. In the context of setting up VMs for docker-swarm i found a log of articles about doing that with the tool docker-machine.
It sounds like this tool can create VMs just with one command. (here the documentation).

So let's give it a try:
(You have to install docker-machine first, but you do not need to install docker itself)
~$ docker-machine create --driver virtualbox test
Creating CA: /home/schroff/.docker/machine/certs/ca.pem
Creating client certificate: /home/schroff/.docker/machine/certs/cert.pem
Running pre-create checks...
(test) Image cache directory does not exist, creating it at /home/schroff/.docker/machine/cache...
(test) No default Boot2Docker ISO found locally, downloading the latest release...
(test) Latest release for github.com/boot2docker/boot2docker is v17.11.0-ce
(test) Downloading /home/schroff/.docker/machine/cache/boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v17.11.0-ce/boot2docker.iso...
(test) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
Creating machine...
(test) Copying /home/schroff/.docker/machine/cache/boot2docker.iso to /home/schroff/.docker/machine/machines/test/boot2docker.iso...
(test) Creating VirtualBox VM...
(test) Creating SSH key...
(test) Starting the VM...
(test) Check network to re-create if needed...
(test) Found a new host-only adapter: "vboxnet0"
(test) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env testWow.
After this command inside my virtualbox a new machine shows up with 1GB RAM, 20 GB HDD (dynamic allocated), 2 network adapters (1x NAT, 1x host only).




But it is not possible to create VMs on a remote Virtualbox server. The CLI does not allow to give a remote server IP:

But for some other environments it is possible to deploy VMs on a remote site:

--vmwarevsphere-vcenter: IP/hostname for vCenter (or ESXi if connecting directly to a single host)If your preferred virtualization engine supports remote servers, you can check here:

Nevertheless docker-machine is an excellent tool. If you are interested in creating a swarm, read this tutorial.
The homepage of the OS boot2docker can be found here.

Calling the Oracle Apiary Mock Server from Java code (via JUnit and Maven)

Amis Blog - Sat, 2018-02-10 15:47

In my article “Oracle API Platform Cloud Service: Design-First approach and using Oracle Apiary”, I talked about using Oracle Apiary and interacting with its Mock Server by using code examples.
[https://technology.amis.nl/2018/01/31/oracle-api-platform-cloud-service-design-first-approach-using-oracle-apiary/]

One of the examples for the “HumanResourceService” API is about the action “Get all employees” in combination with “Java” as language. With that example, also the dependencies to be used in a Maven pom.xml (java6+) are given. This example triggered me to try out the Oracle JDeveloper, Maven and Java combination.

In this article the focus will there for be on calling the Oracle Apiary Mock Server from Java code, with the help of Oracle JDeveloper (in combination with JUnit and Maven).

For more information about using Maven, see: https://maven.apache.org

So this time I needed a recent version of Oracle JDeveloper and fortunately I already had a pre-built Oracle VM VirtualBox appliance, named: “Oracle SOA Suite VirtualBox Appliance [May 2016]”, available which contains the following:

  • Oracle Linux (64-bit) EL 6 Update 7
  • Oracle Database, Enterprise Edition 12.1.0.2
  • Oracle SOA Suite 12.2.1 (includes Service Bus, B2B, Oracle Enterprise Scheduler (ESS) and Business Activity Monitoring)
  • NEW: Oracle Real-Time Integration Business Insight 12.2.1
  • Oracle Managed File Transfer 12.2.1
  • Oracle Stream Explorer 12.2.1
  • Oracle JDeveloper 12.2.1
  • Java JDK 1.8.0_51-b16 (64-bit)

For this appliance see:
http://www.oracle.com/technetwork/middleware/soasuite/learnmore/soa-vm-2870913.html
and
http://www.oracle.com/technetwork/middleware/soasuite/learnmore/soasuite1221vbox-readme-2870943.pdf

For a newer version of an appliance with Oracle JDeveloper 12.2.1.1.0 and Java JDK 1.8.0_92(64-bit) [July 2016], take a look at for example:
http://www.oracle.com/technetwork/middleware/soasuite/learnmore/prebuiltvm-soasuite122110-3070567.html
or
http://www.oracle.com/technetwork/community/developer-vm/index.html

For the latest version of Oracle JDeveloper see:
http://www.oracle.com/technetwork/developer-tools/jdev/downloads/index.html

After importing (Integration_12.2.1_OTN.ova) and starting the appliance in VirtualBox, the desktop looks like:

Before starting the appliance I included a SharedFolder (visible on the desktop as sf_MySharedFolder).

Interacting with the Mock Server by using code examples

In Oracle Apiary, for the “HumanResourceService” API, one of the code examples for interacting with its Mock Server is about the action “Get all employees” in combination with “Java” as language.

// Maven : Add these dependecies to your pom.xml (java6+)
// <dependency>
//     <groupId>org.glassfish.jersey.core</groupId>
//     <artifactId>jersey-client</artifactId>
//     <version>2.8</version>
// </dependency>
// <dependency>
//     <groupId>org.glassfish.jersey.media</groupId>
//     <artifactId>jersey-media-json-jackson</artifactId>
//     <version>2.8</version>
// </dependency>

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.MediaType;

Client client = ClientBuilder.newClient();
Response response = client.target("https://private-b4874b1-humanresourceservice.apiary-mock.com/employees")
  .request(MediaType.TEXT_PLAIN_TYPE)
  .get();

System.out.println("status: " + response.getStatus());
System.out.println("headers: " + response.getHeaders());
System.out.println("body:" + response.readEntity(String.class));

With that example, also the dependencies to be used in a Maven pom.xml (java6+) are given.

Maven implementation in Oracle JDeveloper

I started Oracle JDeveloper and first I took a closer look at the Maven implementation.

Via menu Tools | Preferences.. | Maven you can manage the Maven implementation.

The first time, click on button “Load Extension”.

Then you can see that the JDeveloper Embedded Version (3.2.5) is used. Next I took a look at the other Maven preferences.

Logging/Error:

Phases/Goals:

The “Default” Goal Profile is used with the following phases:

  • clean (project cleaning)
  • compile (compile the source code of the project)
  • test (test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed)
  • package (take the compiled code and package it in its distributable format, such as a JAR)
  • install (install the package into the local repository, for use as a dependency in other projects locally)
  • site (project site documentation)

[https://docs.oracle.com/middleware/1221/jdev/user-guide/GUID-609458B4-79BD-4F5E-8ABE-C5C616576E7D.htm#OJDUG5847]

For more information about Maven build lifecycles and phases, see:
https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html

Repositories:

Here you can see which repositories are used.
A Maven repository holds build artifacts and dependencies of varying types.

The local repository refers to a copy on your own installation that is a cache of the remote downloads. It also contains the temporary build artifacts that you have not yet released.

By default the local repository is located at ${user.home}/.m2/repository/. You can change the path and repository name by clicking the Edit button
[Oracle JDeveloper Help, Maven: Repositories Dialog]

The “Maven Central” repository is a remote repository. The URL for the Maven central repository is http://repo1.Maven.org/Maven2
[Oracle JDeveloper Help, Maven: Repositories Dialog]

For more information about Maven repositories, see:
https://maven.apache.org/guides/introduction/introduction-to-repositories.html

Settings:

Here you can specify the location of the Maven settings.xml file and specify command line options for Maven.

The content of file /home/oracle/.m2/setting.xml is:

<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <proxies>
    <proxy>
      <port>80</port>
      <host>www-proxy.us.oracle.com</host>
      <nonProxyHosts>localhost|127.0.0.0/8|integration|integration.oracle.com|*.us.oracle.com|localhost.localdomain|127.0.0.1|[::1]|127.0.0.1</nonProxyHosts>
    </proxy>
  </proxies>
</settings>

For more information about Maven Settings, see:
https://maven.apache.org/settings.html

Maven standard directory layout

Having a common directory layout would allow for users familiar with one Maven project to immediately feel at home in another Maven project. The advantages are analogous to adopting a site-wide look-and-feel.
[https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html]

For calling the Oracle Apiary Mock Server from Java code, I used the following maven standard directory layout:

To match the default maven structure in JDeveloper I created a Custom Application.

Be aware that there are other options in JDeveloper to work with Maven projects. For example by using Maven Archetypes.
[https://docs.oracle.com/middleware/1221/jdev/user-guide/GUID-609458B4-79BD-4F5E-8ABE-C5C616576E7D.htm#OJDUG6528%5d]

Creating a Custom Application

Via menu File | New | Application.. | Custom Application an application can be created that matches the default maven structure (maven standard directory layout).
[https://docs.oracle.com/middleware/1221/jdev/user-guide/GUID-609458B4-79BD-4F5E-8ABE-C5C616576E7D.htm#OJDUG6874]

In the wizard, I created application “ServicesApplication” with Application Package Prefix “nl.xyz.services”.

After clicking on the button “Next >” I filled in the Project Name “HumanResourceServiceProject” and as Project Features, selected “Maven”.

In the next screen, I changed the default Group ID from nl.xyz.services to nl.xyz.services.humanresourceservice.

Also the checkbox was checked, to modify the normal project structure to match the default maven structure.

In the next screen, “Use Maven” was chosen.

After finishing the wizard, the Applications window for the “ServicesApplication” looked like:

The Project level Maven POM file overview screen looks like:

The “HumanResourceServiceProject”, Project Properties look like:

In the “Project Source Paths” screen, I changed the Default Package from nl.xyz.services to nl.xyz.services.humanresourceservice.

Here you can see that the Project Source Path settings are set in the Project level Maven POM file. The Java Source Path (matching the default maven structure) is set to:
/u02/oracle/developer/mywork/ServicesApplication/HumanResourceServiceProject/src/main/java

After finishing the wizard, the Application level pom.xml content is:

<?xml version="1.0" encoding="UTF-8" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
  <modelVersion>4.0.0</modelVersion>
  <groupId>nl.xyz.services</groupId>
  <artifactId>ServicesApplication</artifactId>
  <version>1.0-SNAPSHOT</version>
  <description>Super POM for ServicesApplication</description>
  <modules>
    <module>HumanResourceServiceProject</module>
  </modules>
  <packaging>pom</packaging>
  <dependencies>
    <dependency>
      <groupId>nl.xyz.services.humanresourceservice</groupId>
      <artifactId>HumanResourceServiceProject</artifactId>
      <version>1.0-SNAPSHOT</version>
      <type>jar</type>
    </dependency>
  </dependencies>
</project>

After finishing the wizard, the Project level pom.xml content is:

<?xml version="1.0" encoding="UTF-8" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
  <modelVersion>4.0.0</modelVersion>
  <groupId>nl.xyz.services.humanresourceservice</groupId>
  <artifactId>HumanResourceServiceProject</artifactId>
  <version>1.0-SNAPSHOT</version>
  <description>Project for HumanResourceServiceProject</description>
  <build>
    <resources>
      <resource>
        <directory>${basedir}</directory>
        <includes>
          <include>*</include>
        </includes>
      </resource>
      <resource>
        <directory>src/main/resources/</directory>
        <includes>
          <include>*</include>
        </includes>
      </resource>
    </resources>
  </build>
</project>
Creating Java classes “Employee” and “Department”

As described in my previous article, the “Human Resource Service” API contains actions for “Employees” and “Departments”.

So there for I decided to create two Java classes corresponding with them.

Via menu File | New | Java Class…, I created a Java class called “Employee” and in the wizard, I unchecked “Implement Abstract Methods”.

package nl.xyz.services.humanresourceservice;

public class Employee {
    public Employee() {
        super();
    }
}

In the same way I created a Java class called “Department”.

package nl.xyz.services.humanresourceservice;

public class Department {
    public Department() {
        super();
    }
}

After creating the Java classes, the Applications window for the “ServicesApplication” looked like:

The two Java classes (with extension .java) where created in directory:
/u02/oracle/developer/mywork/ServicesApplication/HumanResourceServiceProject/src/main/java/nl/xyz/services/humanresourceservice

Apache Maven – compile

So far so good. In JDeveIoper, I created an Application, Project and two Java classes. Time to put Maven to work.

Via a right-click on the pom.xml | Run Maven, the Phases/Goals you can choose from, become visible:

After choosing “compile”, the following popped-up:

Here I clicked the button “Yes”. After this, the content of file /home/oracle/.m2/setting.xml is:

<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <proxies/>
</settings>

Remark:
The JDeveloper proxy settings (see Tools | Preferences | Web Browser and Proxy) were set on: Use System Default Proxy Settings.

With this option, the server uses the default proxy settings on your machine. These are taken from the operation system (in the case of Windows and MacOS) or from the window manager (in the case of Linux).
[Oracle JDeveloper Help, Preferences Dialog – Web Browser and Proxy Page – Proxy Settings]

The content of Apache Maven – compile – Log is:

[INFO] Compiling 2 source files to /u02/oracle/developer/mywork/ServicesApplication/HumanResourceServiceProject/target/classes
[INFO] ————————————————————————
[INFO] BUILD SUCCESS
[INFO] ————————————————————————
[INFO] Total time: 7.375 s
[INFO] Finished at: 2018-02-06T13:23:45-08:00
[INFO] Final Memory: 14M/133M
[INFO] ————————————————————————
Process exited with exit code 0.

The two compiled Java classes (with extension .class) where created in directory:
/u02/oracle/developer/mywork/ServicesApplication/HumanResourceServiceProject/target/classes/nl/xyz/services/humanresourceservice

Java class “Employee” interacting with the Mock Server

In Oracle Apiary, for the “HumanResourceService” API, one of the code examples for interacting with its Mock Server is about the action “Get all employees”.

There for I changed the code for Java class “Employee” and used the Java code example from Oracle Apiary.

package nl.xyz.services.humanresourceservice;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.MediaType;

public class Employee {
    public Employee() {
        super();
    }
    
    public Response getAllEmployees() {
        Client client = ClientBuilder.newClient();
        Response response = client.target("https://private-b4874b1-humanresourceservice.apiary-mock.com/employees")
          .request(MediaType.TEXT_PLAIN_TYPE)
          .get();

        System.out.println("status: " + response.getStatus());
        System.out.println("headers: " + response.getHeaders());
        System.out.println("body:" + response.readEntity(String.class));
        return response;
    }
}

Of course then there were several issues found.

In line with the comment (// Maven : Add these dependecies to your pom.xml (java6+)) in the Java code example from Oracle Apiary, dependencies had to be added in the Project level Maven POM file.

Based on the following comment:

// Maven : Add these dependecies to your pom.xml (java6+)
// <dependency>
//    <groupId>org.glassfish.jersey.core</groupId>
//    <artifactId>jersey-client</artifactId>
//    <version>2.8</version>
// </dependency>

// <dependency>
//    <groupId>org.glassfish.jersey.media</groupId>
//    <artifactId>jersey-media-json-jackson</artifactId>
//    <version>2.8</version>
// </dependency>

I added the dependency in the Project level Maven POM file overview screen, tab “Dependencies” (by using the icon +):

After doing that, the Project level pom.xml content was:

<?xml version="1.0" encoding="UTF-8" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
  <modelVersion>4.0.0</modelVersion>
  <groupId>nl.xyz.services.humanresourceservice</groupId>
  <artifactId>HumanResourceServiceProject</artifactId>
  <version>1.0-SNAPSHOT</version>
  <description>Project for HumanResourceServiceProject</description>
  <build>
    <resources>
      <resource>
        <directory>${basedir}</directory>
        <includes>
          <include>*</include>
        </includes>
      </resource>
      <resource>
        <directory>src/main/resources/</directory>
        <includes>
          <include>*</include>
        </includes>
      </resource>
    </resources>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.glassfish.jersey.core</groupId>
      <artifactId>jersey-client</artifactId>
      <version>2.8</version>
    </dependency>
  </dependencies>
</project>

The other comment part I copied / pasted in the tab Source of the pom.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
  <modelVersion>4.0.0</modelVersion>
  <groupId>nl.xyz.services.humanresourceservice</groupId>
  <artifactId>HumanResourceServiceProject</artifactId>
  <version>1.0-SNAPSHOT</version>
  <description>Project for HumanResourceServiceProject</description>
  <build>
    <resources>
      <resource>
        <directory>${basedir}</directory>
        <includes>
          <include>*</include>
        </includes>
      </resource>
      <resource>
        <directory>src/main/resources/</directory>
        <includes>
          <include>*</include>
        </includes>
      </resource>
    </resources>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.glassfish.jersey.core</groupId>
      <artifactId>jersey-client</artifactId>
      <version>2.8</version>
    </dependency>
    <dependency>
       <groupId>org.glassfish.jersey.media</groupId>
       <artifactId>jersey-media-json-jackson</artifactId>
       <version>2.8</version>
    </dependency>
  </dependencies>
</project>

After saving the pom.xml, the dependencies where being resolved.

The Maven local repository was updated, with among others, the following two jar files:

See also:
http://repo1.maven.org/maven2/org/glassfish/jersey/core/jersey-client/2.8/
respectively:
http://repo1.maven.org/maven2/org/glassfish/jersey/media/jersey-media-json-jackson/2.8/

JUnit

In order to invoke the Oracle Apiary Mock Server for the action “Get all employees” from the Java class “Employee”, I decided to use a JUnit TestCase class.

For this I had to install an Oracle Extension for Oracle JDeveloper. Via menu Help | Check for Updates…, from the list of Available Updates, I choose “JUnit Integration” and installed it.

After the install, a JDeveloper restart was done.

For more information about JUnit, see:
https://junit.org/junit4

Creating Java class “EmployeeTest”

In the Applications window for the “ServicesApplication”, after a right-click on package nl.xyz.services.humanresourceservice, via the menu File | New | From gallery… | General | Unit Tests | Test Case, a wizard was started.

In the dropdown box I selected the Java class “Employee”, checked the check box for method getAllEmployees() and clicked on button “Next >”.

After clicking on Next and then Finish (in the screen above) a Java class “EmployeeTest” was created.

There were several issues found. The needed JUnit library seemed not to be part of the classpath.
A right-click on Java class “EmployeeTest” followed by Make and then followed by Reformat fixed the problem and the issues disappeared.

After creating the JUnit TestCase class, the Project level pom.xml content was:

<?xml version="1.0" encoding="UTF-8" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
  <modelVersion>4.0.0</modelVersion>
  <groupId>nl.xyz.services.humanresourceservice</groupId>
  <artifactId>HumanResourceServiceProject</artifactId>
  <version>1.0-SNAPSHOT</version>
  <description>Project for HumanResourceServiceProject</description>
  <build>
    <resources>
      <resource>
        <directory>${basedir}</directory>
        <includes>
          <include>*</include>
        </includes>
      </resource>
      <resource>
        <directory>src/main/resources/</directory>
        <includes>
          <include>*</include>
        </includes>
      </resource>
    </resources>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.glassfish.jersey.core</groupId>
      <artifactId>jersey-client</artifactId>
      <version>2.8</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.media</groupId>
      <artifactId>jersey-media-json-jackson</artifactId>
      <version>2.8</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>JUnit-4-Runtime</artifactId>
      <version>12.2.1-0-0</version>
      <type>pom</type>
      <scope>provided</scope>
    </dependency>
  </dependencies>
</project>

Notice that a dependency for JUnit was automatically added to the Project level POM file.

After creating the JUnit TestCase class, the Applications window for the “ServicesApplication” looked like:

Remark:
Of course you can also create a dedicated project in the application for testing. See also the tab “Test Settings” in the Project level Maven POM file overview screen.

Apache Maven – test

After a right-click on the pom.xml | Run Maven | test, the content of Apache Maven – test – Log is:


INFO] — maven-surefire-plugin:2.12.4:test (default-test) @ HumanResourceServiceProject —
[INFO] No tests to run.
[INFO] ————————————————————————
[INFO] BUILD SUCCESS
[INFO] ————————————————————————
[INFO] Total time: 1.160 s
[INFO] Finished at: 2018-02-08T12:10:12-08:00
[INFO] Final Memory: 9M/191M
[INFO] ————————————————————————
Process exited with exit code 0.

There were no test classes found! This is because the Java class “EmployeeTest” is not in the correct default maven structure (maven standard directory layout).
To fix this, the JUnit TestCase class has to be in the right subdirectory under the src/test/java (Test sources) directory. This can be done in several ways, but I used File | Save As… .

In the Save As screen, via repeated use of the icon “Create new subdirectory”, I created the following subdirectory: src/test/java/nl/xyz/services/humanresourceservice and then clicked on button “Save”.

In the “Save Warning” pop-up I clicked on button “Yes”.

In the “Add to Project Content” pop-up, I selected “Java Paths” and clicked on button “OK”.

Then the Java class “EmployeeTest” was deleted, via right-click | Delete.

In the “Confirm Delete” pop-up, I clicked on button “OK”.

After a right-click on the pom.xml | Run Maven | test, the content of Apache Maven – test – Log is:

[INFO] — maven-surefire-plugin:2.12.4:test (default-test) @ HumanResourceServiceProject —
[INFO] Surefire report directory: /u02/oracle/developer/mywork/ServicesApplication/HumanResourceServiceProject/target/surefire-reports

——————————————————-
T E S T S
——————————————————-
Running nl.xyz.services.humanresourceservice.EmployeeTest
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.013 sec <<< FAILURE!
nl.xyz.services.humanresourceservice.EmployeeTest.testGetAllEmployees() Time elapsed: 0.008 sec <<< FAILURE!
java.lang.AssertionError: Unimplemented
at org.junit.Assert.fail(Assert.java:88)
at nl.xyz.services.humanresourceservice.EmployeeTest.testGetAllEmployees(EmployeeTest.java:15)

Results :

Failed tests: nl.xyz.services.humanresourceservice.EmployeeTest.testGetAllEmployees(): Unimplemented

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

[INFO] ————————————————————————
[INFO] BUILD FAILURE
[INFO] ————————————————————————
[INFO] Total time: 2.473 s
[INFO] Finished at: 2018-02-08T12:42:57-08:00
[INFO] Final Memory: 15M/200M
[INFO] ————————————————————————
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project HumanResourceServiceProject: There are test failures.
[ERROR]
[ERROR] Please refer to /u02/oracle/developer/mywork/ServicesApplication/HumanResourceServiceProject/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Process exited with exit code 1.

There was a test class found, but it failed. This was an expected outcome, because of the org.junit.Assert.fail(String message) method, which fails a test with the given message.
[https://junit.org/junit4/javadoc/4.12/org/junit/Assert.html#fail(java.lang.String)]

package nl.xyz.services.humanresourceservice;

import static org.junit.Assert.*;
import org.junit.Test;

public class EmployeeTest {
    public EmployeeTest() {
    }

    /**
     * @see Employee#getAllEmployees()
     */
    @Test
    public void testGetAllEmployees() {
        fail("Unimplemented");
    }
}
Making Java class “EmployeeTest” visible in the Applications window

In order to make the Java class “EmployeeTest” visible in the Applications window for the “ServicesApplication”, the Project level POM file had to be modified.

I added a resource directory in the Project level Maven POM file overview screen, tab “Source Paths”, part “Resources | Resource Directories” (by using the icon +):

Where I selected the src/test/java subdirectory.

After adding the resource directory, the Project level pom.xml content is:

<?xml version="1.0" encoding="UTF-8" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
  <modelVersion>4.0.0</modelVersion>
  <groupId>nl.xyz.services.humanresourceservice</groupId>
  <artifactId>HumanResourceServiceProject</artifactId>
  <version>1.0-SNAPSHOT</version>
  <description>Project for HumanResourceServiceProject</description>
  <build>
    <resources>
      <resource>
        <directory>${basedir}</directory>
        <includes>
          <include>*</include>
        </includes>
      </resource>
      <resource>
        <directory>src/main/resources/</directory>
        <includes>
          <include>*</include>
        </includes>
      </resource>
      <resource>
        <directory>src/test/java/</directory>
      </resource>
    </resources>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.glassfish.jersey.core</groupId>
      <artifactId>jersey-client</artifactId>
      <version>2.8</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.media</groupId>
      <artifactId>jersey-media-json-jackson</artifactId>
      <version>2.8</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>JUnit-4-Runtime</artifactId>
      <version>12.2.1-0-0</version>
      <type>pom</type>
      <scope>provided</scope>
    </dependency>
  </dependencies>
</project>

After adding the resource directory, the Applications window for the “ServicesApplication” looked like:

Modifying Java class “EmployeeTest”

Then I modified the Java class “EmployeeTest” in order the make it call the Java class “Employee”:

package nl.xyz.services.humanresourceservice;

import javax.ws.rs.core.Response;

import static org.junit.Assert.*;
import org.junit.Test;

public class EmployeeTest {
    public EmployeeTest() {
    }

    private Employee employee = new Employee();

    /**
     * @see Employee#getAllEmployees()
     */
    @Test
    public void testGetAllEmployees() {
        Response response = employee.getAllEmployees();
    }
}

After a right-click on the pom.xml | Run Maven | test, the content of Apache Maven – test – Log:
(Remark: I shortened the response list of employees)



[INFO] — maven-surefire-plugin:2.12.4:test (default-test) @ HumanResourceServiceProject —
[INFO] Surefire report directory: /u02/oracle/developer/mywork/ServicesApplication/HumanResourceServiceProject/target/surefire-reports

——————————————————-
T E S T S
——————————————————-
Running nl.xyz.services.humanresourceservice.EmployeeTest
status: 200
headers: {Server=[Cowboy], Access-Control-Allow-Origin=[*], Access-Control-Allow-Methods=[OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE,CONNECT], Connection=[keep-alive], X-Apiary-Ratelimit-Limit=[120], Date=[Thu, 08 Feb 2018 21:29:12 GMT], Via=[1.1 vegur], X-Apiary-Transaction-Id=[5a7cc1282efcd107002bce05], Content-Length=[15519], Access-Control-Max-Age=[10], X-Apiary-Ratelimit-Remaining=[119], Content-Type=[application/json]}
body:{
“items”: [
{
“employee_id”: 100,
“first_name”: “Steven”,
“last_name”: “King”,
“email”: “SKING”,
“phone_number”: “515.123.4567”,
“hire_date”: “1987-06-17T04:00:00Z”,
“job_id”: “AD_PRES”,
“salary”: 24000,
“commission_pct”: null,
“manager_id”: null,
“department_id”: 90,
“links”: [
{
“rel”: “self”,
“href”: “http://localhost:9090/ords/hr/employees/100”
}
]
},
{
“employee_id”: 101,
“first_name”: “Neena”,
“last_name”: “Kochhar”,
“email”: “NKOCHHAR”,
“phone_number”: “515.123.4568”,
“hire_date”: “1989-09-21T04:00:00Z”,
“job_id”: “AD_VP”,
“salary”: 17000,
“commission_pct”: null,
“manager_id”: 100,
“department_id”: 90,
“links”: [
{
“rel”: “self”,
“href”: “http://localhost:9090/ords/hr/employees/101”
}
]
},

{
“employee_id”: 123,
“first_name”: “Shanta”,
“last_name”: “Vollman”,
“email”: “SVOLLMAN”,
“phone_number”: “650.123.4234”,
“hire_date”: “1997-10-10T04:00:00Z”,
“job_id”: “ST_MAN”,
“salary”: 6500,
“commission_pct”: null,
“manager_id”: 100,
“department_id”: 50,
“links”: [
{
“rel”: “self”,
“href”: “http://localhost:9090/ords/hr/employees/123”
}
]
},
{
“employee_id”: 124,
“first_name”: “Kevin”,
“last_name”: “Mourgos”,
“email”: “KMOURGOS”,
“phone_number”: “650.123.5234”,
“hire_date”: “1999-11-16T05:00:00Z”,
“job_id”: “ST_MAN”,
“salary”: 5800,
“commission_pct”: null,
“manager_id”: 100,
“department_id”: 50,
“links”: [
{
“rel”: “self”,
“href”: “http://localhost:9090/ords/hr/employees/124”
}
]
}
],
“hasMore”: true,
“limit”: 25,
“offset”: 0,
“count”: 25,
“links”: [
{
“rel”: “self”,
“href”: “http://localhost:9090/ords/hr/employees/”
},
{
“rel”: “edit”,
“href”: “http://localhost:9090/ords/hr/employees/”
},
{
“rel”: “describedby”,
“href”: “http://localhost:9090/ords/hr/metadata-catalog/employees/”
},
{
“rel”: “first”,
“href”: “http://localhost:9090/ords/hr/employees/”
},
{
“rel”: “next”,
“href”: “http://localhost:9090/ords/hr/employees/?offset=25”
}
]
}
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.147 sec

Results :

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

[INFO] ————————————————————————
[INFO] BUILD SUCCESS
[INFO] ————————————————————————
[INFO] Total time: 4.570 s
[INFO] Finished at: 2018-02-08T13:33:14-08:00
[INFO] Final Memory: 16M/246M
[INFO] ————————————————————————
Process exited with exit code 0.

Looking at this output it was obvious that interacting with the Oracle Apiary MockServer action “Get all employees” from Java class “Employee” via the Java class “EmployeeTest” worked correctly.

API Inspector

I then started Oracle Apiary, via: https://apiary.io/ , where I signed in and looked at the API Inspector.

Each request and response from the Mock Server is logged in the API Inspector, which can be found by clicking “Inspector” in the Apiary header. There you will see each request received, each response given, and any validation errors that were found.
[https://help.apiary.io/tools/api-inspector/]

There I could see, the request that was made from the Java class “EmployeeTest”:

For that request (by clicking on it) more details are available:

Completing the HumanResourceServiceProject

So now a successful call to the Oracle Apiary MockServer action “Get all employees” was made, from Java class “Employee” via the Java class “EmployeeTest”.

There were other actions that had to be implemented, and also in the Java class “Department”. So, in the same way as Java class “EmployeeTest”, I created Java class “Department Test”.

After adding the Java class, the Applications window for the “ServicesApplication” looks like:

Below you can find the code for the Java classes.

Remark:
All the Java code in this article is not suitable for a production environment, but meant as simple examples.

Java class “Employee”:

package nl.xyz.services.humanresourceservice;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.MediaType;

public class Employee {
    private String mockServerURI;

    public Employee(String mockServerURI) {
        this.mockServerURI = mockServerURI;
    }

    public Response getAllEmployees() {
        Client client = ClientBuilder.newClient();
        String requestURI = this.mockServerURI + "/employees";
        System.out.println("requestURI: " + requestURI);
        Response response = client.target(requestURI).request(MediaType.TEXT_PLAIN_TYPE).get();

        System.out.println("status: " + response.getStatus());
        System.out.println("headers: " + response.getHeaders());
        System.out.println("body:" + response.readEntity(String.class));
        return response;
    }

    public Response getEmployee(int id) {
        Client client = ClientBuilder.newClient();
        String requestURI = this.mockServerURI + "/employees/" + id;
        System.out.println("requestURI: " + requestURI);
        Response response = client.target(requestURI).request(MediaType.TEXT_PLAIN_TYPE).get();

        System.out.println("status: " + response.getStatus());
        System.out.println("headers: " + response.getHeaders());
        System.out.println("body:" + response.readEntity(String.class));
        return response;
    }

    public Response createEmployee() {
        Client client = ClientBuilder.newClient();
        String requestURI = this.mockServerURI + "/employees";
        System.out.println("requestURI: " + requestURI);
        Entity payload =
            Entity.json("{  'LAST_NAME': 'TESTINSERT',  'FIRST_NAME': 'TESTFIRST',  'EMAIL': 'TESTMAIL',  'HIRE_DATE': '25-JUN-15',  'JOB_ID': 'IT_PROG',  'SALARY': 6000,  'MANAGER_ID': 103,  'DEPARTMENT_ID': 60}");
        Response response = client.target(requestURI).request(MediaType.APPLICATION_JSON_TYPE).post(payload);

        System.out.println("status: " + response.getStatus());
        System.out.println("headers: " + response.getHeaders());
        System.out.println("body:" + response.readEntity(String.class));
        return response;
    }

    public Response updateEmployee(int id) {
        Client client = ClientBuilder.newClient();
        String requestURI = this.mockServerURI + "/employees/" + id;
        System.out.println("requestURI: " + requestURI);
        Entity payload =
            Entity.json("{  'LAST_NAME': 'TESTUPDATE',  'JOB_ID': 'SA_REP',  'SALARY': 8000,  'DEPARTMENT_ID': 80}");
        Response response = client.target(requestURI).request(MediaType.APPLICATION_JSON_TYPE).put(payload);

        System.out.println("status: " + response.getStatus());
        System.out.println("headers: " + response.getHeaders());
        System.out.println("body:" + response.readEntity(String.class));
        return response;
    }
}

Java class “EmployeeTest”:

package nl.xyz.services.humanresourceservice;

import javax.ws.rs.core.Response;

import static org.junit.Assert.*;
import org.junit.Test;

public class EmployeeTest {
    private static final String HTTP_STATUS_CODE = "HTTP status code";
    private static final int HTTP_STATUS_CODE_OK = 200;
    private static final int HTTP_STATUS_CODE_CREATED = 201;
    private Employee employee = new Employee("https://private-b4874b1-humanresourceservice.apiary-mock.com");

    public EmployeeTest() {
    }

    /**
     * @see Employee#getAllEmployees()
     */
    @Test
    public void testGetAllEmployees() {
        Response response = employee.getAllEmployees();
        assertEquals(HTTP_STATUS_CODE, HTTP_STATUS_CODE_OK, response.getStatus());
    }

    /**
     * @see Employee#getEmployee()
     */
    @Test
    public void testGetEmployee() {
        int id = 100;
        Response response = employee.getEmployee(id);
        assertEquals(HTTP_STATUS_CODE, HTTP_STATUS_CODE_OK, response.getStatus());
    }

    /**
     * @see Employee#createEmployee()
     */
    @Test
    public void testCreateEmployee() {
        Response response = employee.createEmployee();
        assertEquals(HTTP_STATUS_CODE, HTTP_STATUS_CODE_CREATED, response.getStatus());
    }

    /**
     * @see Employee#updateEmployee()
     */
    @Test
    public void testUpdateEmployee() {
        int id = 220;
        Response response = employee.updateEmployee(id);
        assertEquals(HTTP_STATUS_CODE, HTTP_STATUS_CODE_OK, response.getStatus());
    }
}

Java class “Department”:

package nl.xyz.services.humanresourceservice;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.MediaType;

public class Department {
    private String mockServerURI;

    public Department(String mockServerURI) {
        this.mockServerURI = mockServerURI;
    }

    public Response getDepartment(int id) {
        Client client = ClientBuilder.newClient();
        String requestURI = this.mockServerURI + "/department/" + id;
        System.out.println("requestURI: " + requestURI);
        Response response = client.target(requestURI).request(MediaType.TEXT_PLAIN_TYPE).get();

        System.out.println("status: " + response.getStatus());
        System.out.println("headers: " + response.getHeaders());
        System.out.println("body:" + response.readEntity(String.class));
        return response;
    }

    public Response getDepartmentEmployee(int department_id, int employee_id) {
        Client client = ClientBuilder.newClient();
        String requestURI = this.mockServerURI + "/departments/" + department_id + "/employees/" + employee_id;
        System.out.println("requestURI: " + requestURI);
        Response response = client.target(requestURI).request(MediaType.TEXT_PLAIN_TYPE).get();

        System.out.println("status: " + response.getStatus());
        System.out.println("headers: " + response.getHeaders());
        System.out.println("body:" + response.readEntity(String.class));
        return response;
    }
}

Java class “DepartmentTest”:

package nl.xyz.services.humanresourceservice;

import javax.ws.rs.core.Response;

import static org.junit.Assert.*;
import org.junit.Test;

public class DepartmentTest {
    private static final String HTTP_STATUS_CODE = "HTTP status code";
    private static final int HTTP_STATUS_CODE_OK = 200;    
    private Department department = new Department("https://private-b4874b1-humanresourceservice.apiary-mock.com");

    public DepartmentTest() {
    }

    /**
     * @see Department#getDepartment(int)
     */
    @Test
    public void testGetDepartment() {
        int id = 30;
        Response response = department.getDepartment(id);
        assertEquals(HTTP_STATUS_CODE, HTTP_STATUS_CODE_OK, response.getStatus());
    }

    /**
     * @see Department#getDepartmentEmployee(int,int)
     */
    @Test
    public void testGetDepartmentEmployee() {
        int department_id = 30;
        int employee_id = 119;
        Response response = department.getDepartmentEmployee(department_id, employee_id);
        assertEquals(HTTP_STATUS_CODE, HTTP_STATUS_CODE_OK, response.getStatus());
    }
}

After a right-click on the pom.xml | Run Maven | test, the content of Apache Maven – test – Log:
(Remark: I shortened the response list of employees)


[INFO] — maven-surefire-plugin:2.12.4:test (default-test) @ HumanResourceServiceProject —
[INFO] Surefire report directory: /u02/oracle/developer/mywork/ServicesApplication/HumanResourceServiceProject/target/surefire-reports

——————————————————-
T E S T S
——————————————————-
Running nl.xyz.services.humanresourceservice.DepartmentTest
requestURI: https://private-b4874b1-humanresourceservice.apiary-mock.com/department/30
status: 200
headers: {Server=[Cowboy], Access-Control-Allow-Origin=[*], Access-Control-Allow-Methods=[OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE,CONNECT], Connection=[keep-alive], X-Apiary-Ratelimit-Limit=[120], Date=[Fri, 09 Feb 2018 20:10:55 GMT], Via=[1.1 vegur], X-Apiary-Transaction-Id=[5a7e004fc5c2ab07003caec1], Content-Length=[112], Access-Control-Max-Age=[10], X-Apiary-Ratelimit-Remaining=[119], Content-Type=[application/json]}
body:{
“department_id”: 30,
“department_name”: “Purchasing”,
“manager_id”: 114,
“location_id”: 1700
}
requestURI: https://private-b4874b1-humanresourceservice.apiary-mock.com/departments/30/employees/119
status: 200
headers: {Server=[Cowboy], Access-Control-Allow-Origin=[*], Access-Control-Allow-Methods=[OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE,CONNECT], Connection=[keep-alive], X-Apiary-Ratelimit-Limit=[120], Date=[Fri, 09 Feb 2018 20:10:56 GMT], Via=[1.1 vegur], X-Apiary-Transaction-Id=[5a7e005099b117070044215c], Content-Length=[146], Access-Control-Max-Age=[10], X-Apiary-Ratelimit-Remaining=[118], Content-Type=[application/json]}
body:{
“department_id”: 30,
“department_name”: “Purchasing”,
“employee_id”: 119,
“first_name”: “Karen”,
“last_name”: “Colmenares”
}
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.909 sec
Running nl.xyz.services.humanresourceservice.EmployeeTest
requestURI: https://private-b4874b1-humanresourceservice.apiary-mock.com/employees
status: 201
headers: {Server=[Cowboy], Access-Control-Allow-Origin=[*], Access-Control-Allow-Methods=[OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE,CONNECT], Connection=[keep-alive], X-Apiary-Ratelimit-Limit=[120], Date=[Fri, 09 Feb 2018 20:10:57 GMT], Via=[1.1 vegur], X-Apiary-Transaction-Id=[5a7e005179e3cd0700eedbb3], Content-Length=[301], Access-Control-Max-Age=[10], X-Apiary-Ratelimit-Remaining=[117], Content-Type=[application/json]}
body:{
“employee_id”: 220,
“first_name”: “TESTFIRST”,
“last_name”: “TESTINSERT”,
“email”: “TESTMAIL”,
“phone_number”: null,
“hire_date”: “2015-06-25T04:00:00Z”,
“job_id”: “IT_PROG”,
“salary”: 6000,
“commission_pct”: null,
“manager_id”: 103,
“department_id”: 60
}
requestURI: https://private-b4874b1-humanresourceservice.apiary-mock.com/employees/220
status: 200
headers: {Server=[Cowboy], Access-Control-Allow-Origin=[*], Access-Control-Allow-Methods=[OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE,CONNECT], Connection=[keep-alive], X-Apiary-Ratelimit-Limit=[120], Date=[Fri, 09 Feb 2018 20:10:58 GMT], Via=[1.1 vegur], X-Apiary-Transaction-Id=[5a7e00520fb27c07004e4008], Content-Length=[300], Access-Control-Max-Age=[10], X-Apiary-Ratelimit-Remaining=[116], Content-Type=[application/json]}
body:{
“employee_id”: 220,
“first_name”: “TESTFIRST”,
“last_name”: “TESTUPDATE”,
“email”: “TESTMAIL”,
“phone_number”: null,
“hire_date”: “2015-06-25T04:00:00Z”,
“job_id”: “SA_REP”,
“salary”: 8000,
“commission_pct”: null,
“manager_id”: 103,
“department_id”: 80
}
requestURI: https://private-b4874b1-humanresourceservice.apiary-mock.com/employees/100
status: 200
headers: {Server=[Cowboy], Access-Control-Allow-Origin=[*], Access-Control-Allow-Methods=[OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE,CONNECT], Connection=[keep-alive], X-Apiary-Ratelimit-Limit=[120], Date=[Fri, 09 Feb 2018 20:10:59 GMT], Via=[1.1 vegur], X-Apiary-Transaction-Id=[5a7e005399b117070044215f], Content-Length=[806], Access-Control-Max-Age=[10], X-Apiary-Ratelimit-Remaining=[115], Content-Type=[application/json]}
body:{
“employee_id”: 100,
“first_name”: “Steven”,
“last_name”: “King”,
“email”: “SKING”,
“phone_number”: “515.123.4567”,
“hire_date”: “1987-06-17T04:00:00Z”,
“job_id”: “AD_PRES”,
“salary”: 24000,
“commission_pct”: null,
“manager_id”: null,
“department_id”: 90,
“links”: [
{
“rel”: “self”,
“href”: “http://localhost:9090/ords/hr/employees/100”
},
{
“rel”: “edit”,
“href”: “http://localhost:9090/ords/hr/employees/100”
},
{
“rel”: “describedby”,
“href”: “http://localhost:9090/ords/hr/metadata-catalog/employees/item”
},
{
“rel”: “collection”,
“href”: “http://localhost:9090/ords/hr/employees/”
}
]
}
requestURI: https://private-b4874b1-humanresourceservice.apiary-mock.com/employees
status: 200
headers: {Server=[Cowboy], Access-Control-Allow-Origin=[*], Access-Control-Allow-Methods=[OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE,CONNECT], Connection=[keep-alive], X-Apiary-Ratelimit-Limit=[120], Date=[Fri, 09 Feb 2018 20:11:00 GMT], Via=[1.1 vegur], X-Apiary-Transaction-Id=[5a7e00540fb27c07004e400b], Content-Length=[15519], Access-Control-Max-Age=[10], X-Apiary-Ratelimit-Remaining=[119], Content-Type=[application/json]}
body:{
“items”: [
{
“employee_id”: 100,
“first_name”: “Steven”,
“last_name”: “King”,
“email”: “SKING”,
“phone_number”: “515.123.4567”,
“hire_date”: “1987-06-17T04:00:00Z”,
“job_id”: “AD_PRES”,
“salary”: 24000,
“commission_pct”: null,
“manager_id”: null,
“department_id”: 90,
“links”: [
{
“rel”: “self”,
“href”: “http://localhost:9090/ords/hr/employees/100”
}
]
},
{
“employee_id”: 101,
“first_name”: “Neena”,
“last_name”: “Kochhar”,
“email”: “NKOCHHAR”,
“phone_number”: “515.123.4568”,
“hire_date”: “1989-09-21T04:00:00Z”,
“job_id”: “AD_VP”,
“salary”: 17000,
“commission_pct”: null,
“manager_id”: 100,
“department_id”: 90,
“links”: [
{
“rel”: “self”,
“href”: “http://localhost:9090/ords/hr/employees/101”
}
]
},

{
“employee_id”: 123,
“first_name”: “Shanta”,
“last_name”: “Vollman”,
“email”: “SVOLLMAN”,
“phone_number”: “650.123.4234”,
“hire_date”: “1997-10-10T04:00:00Z”,
“job_id”: “ST_MAN”,
“salary”: 6500,
“commission_pct”: null,
“manager_id”: 100,
“department_id”: 50,
“links”: [
{
“rel”: “self”,
“href”: “http://localhost:9090/ords/hr/employees/123”
}
]
},
{
“employee_id”: 124,
“first_name”: “Kevin”,
“last_name”: “Mourgos”,
“email”: “KMOURGOS”,
“phone_number”: “650.123.5234”,
“hire_date”: “1999-11-16T05:00:00Z”,
“job_id”: “ST_MAN”,
“salary”: 5800,
“commission_pct”: null,
“manager_id”: 100,
“department_id”: 50,
“links”: [
{
“rel”: “self”,
“href”: “http://localhost:9090/ords/hr/employees/124”
}
]
}
],
“hasMore”: true,
“limit”: 25,
“offset”: 0,
“count”: 25,
“links”: [
{
“rel”: “self”,
“href”: “http://localhost:9090/ords/hr/employees/”
},
{
“rel”: “edit”,
“href”: “http://localhost:9090/ords/hr/employees/”
},
{
“rel”: “describedby”,
“href”: “http://localhost:9090/ords/hr/metadata-catalog/employees/”
},
{
“rel”: “first”,
“href”: “http://localhost:9090/ords/hr/employees/”
},
{
“rel”: “next”,
“href”: “http://localhost:9090/ords/hr/employees/?offset=25”
}
]
}
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.594 sec

Results :

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

[INFO] ————————————————————————
[INFO] BUILD SUCCESS
[INFO] ————————————————————————
[INFO] Total time: 8.834 s
[INFO] Finished at: 2018-02-09T12:15:04-08:00
[INFO] Final Memory: 15M/198M
[INFO] ————————————————————————
Process exited with exit code 0.

In the Oracle Apiary API Inspector, I could see, the 6 request that were made in total from the Java classes “EmployeeTest” and “DepartementTest” during the last Maven test run:

Apache Maven – clean

After a right-click on the pom.xml | Run Maven | clean, the content of Apache Maven – clean – Log is:

INFO] — maven-clean-plugin:2.5:clean (default-clean) @ HumanResourceServiceProject —
[INFO] Deleting /u02/oracle/developer/mywork/ServicesApplication/HumanResourceServiceProject/target
[INFO] ————————————————————————
[INFO] BUILD SUCCESS
[INFO] ————————————————————————
[INFO] Total time: 0.316 s
[INFO] Finished at: 2018-02-09T07:51:02-08:00
[INFO] Final Memory: 8M/151M
[INFO] ————————————————————————
Process exited with exit code 0.

This results in subdirectory target being deleted from the file system.

Apache Maven – package

After a right-click on the pom.xml | Run Maven | package, the content of Apache Maven – package – Log is:

[INFO] Scanning for projects…
[INFO]
[INFO] ————————————————————————
[INFO] Building HumanResourceServiceProject 1.0-SNAPSHOT
[INFO] ————————————————————————
[INFO]
[INFO] — maven-resources-plugin:2.6:resources (default-resources) @ HumanResourceServiceProject —
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO] Copying 0 resource
[INFO] Copying 2 resources
[INFO]
[INFO] — maven-compiler-plugin:3.1:compile (default-compile) @ HumanResourceServiceProject —
[INFO] Nothing to compile – all classes are up to date
[INFO]
[INFO] — maven-resources-plugin:2.6:testResources (default-testResources) @ HumanResourceServiceProject —
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /u02/oracle/developer/mywork/ServicesApplication/HumanResourceServiceProject/src/test/resources
[INFO]
[INFO] — maven-compiler-plugin:3.1:testCompile (default-testCompile) @ HumanResourceServiceProject —
[INFO] Changes detected – recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 2 source files to /u02/oracle/developer/mywork/ServicesApplication/HumanResourceServiceProject/target/test-classes
[INFO]
[INFO] — maven-surefire-plugin:2.12.4:test (default-test) @ HumanResourceServiceProject —
[INFO] Surefire report directory: /u02/oracle/developer/mywork/ServicesApplication/HumanResourceServiceProject/target/surefire-reports

——————————————————-
T E S T S

Results :

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

[INFO]
[INFO] — maven-jar-plugin:2.4:jar (default-jar) @ HumanResourceServiceProject —
[INFO] Building jar: /u02/oracle/developer/mywork/ServicesApplication/HumanResourceServiceProject/target/HumanResourceServiceProject-1.0-SNAPSHOT.jar
[INFO] ————————————————————————
[INFO] BUILD SUCCESS
[INFO] ————————————————————————
[INFO] Total time: 8.963 s
[INFO] Finished at: 2018-02-09T12:36:23-08:00
[INFO] Final Memory: 17M/201M
[INFO] ————————————————————————
Process exited with exit code 0.

In the log above, you can see that after compiling code and running the tests, the following jar file is made:
/u02/oracle/developer/mywork/ServicesApplication/HumanResourceServiceProject/target/HumanResourceServiceProject-1.0-SNAPSHOT.jar

Summary

As a follow up from my previous article, in this article the focus is on calling the Oracle Apiary Mock Server from Java code.

One of the examples for the “HumanResourceService” API is about the action “Get all employees” in combination with “Java” as language. With that example, also the dependencies to be used in a Maven pom.xml (java6+) are given. This example triggered me to try out the Oracle JDeveloper, Maven and Java combination.

This article shows you how, with the help of Oracle JDeveloper 12.2.1 in combination with JUnit and Maven, a successful call to the Oracle Apiary MockServer action “Get all employees” from a Java class was made, and also to other actions for “Employees” and “Departments”.

The post Calling the Oracle Apiary Mock Server from Java code (via JUnit and Maven) appeared first on AMIS Oracle and Java Blog.

APEX Alpe Adria - A New APEX Conference That You Should Attend

Joel Kallman - Sat, 2018-02-10 13:47


Have you heard of APEX Alpe Adria?  It's the latest "All APEX" conference, joining APEX World and APEX Connect as high-quality conferences dedicated to Oracle APEX developers and related technologies.

APEX Alpe Adria is a very modestly-priced one-day conference occurring on April 20, 2018 in Graz, Austria.  The list of speakers that they have organized is unbelievably impressive - they are all very knowledgeable & experienced, as well as very polished presenters.  All presentations will be in English.  Also, the evening before the conference, there will be an Ask an ACE session, where you can ask any question to a panel of highly experienced Oracle ACEs.

APEX Alpe Adria is the creation of three different Oracle partners, Dario Bilić from BiLog d.o.o., Aljaž Mali from Abakus Plus d.o.o., and Peter Raganitsch from FOEX Gmbh.  As Peter told me, they are not organizing this conference for commercial purposes.  Instead, their primary goal is to bring a high-quality dedicated APEX conference to a region where there is significant demand.  And they've developed a 100% APEX Conference - everyone and everything is driven by Oracle APEX:  the conference Web site, abstract submission, abstract voting, the back-end administration apps, everything.  The conference is already a great testament of what is possible with the Oracle Database & Oracle APEX.

While the location primarily caters to Austria, Slovenia and Croatia, the appeal stretches far beyond the immediate region.  As you can see in the map below, Graz is a short 500 miles (1.5 hour flight) from many places in central Europe.  And even though it may be a bit longer to travel for those outside the circle, I'm hoping that this conference will attract many of our other customers and partners from Eastern Europe and the Middle East.  Tickets have already been sold to conference attendees from Austria, Czech Republic, Germany, United Kingdom, Croatia, Macedonia, Russia, Slovenia, and the USA.  If you want an easy way to get connected and immersed into the global APEX community, please attend APEX Alpe Adria.  It's that simple.

Patrick Wolf & Christian Neumueller from the Oracle APEX Development team will be joining me to kick off this inaugural conference and show our support for this growing APEX community.  We hope to see you there!


Active Schema objects

Tom Kyte - Sat, 2018-02-10 04:46
How to find a list of active views in an Oracle schema? The dba_objects, all_views and other sys tables included the dropped views as well, but we would like to get active list.
Categories: DBA Blogs

Windows Server – Service not starting with ‘Error 1067: The process terminated unexpectedly’

Yann Neuhaus - Sat, 2018-02-10 02:30

Some time ago, we were installing a Migration Center (from fmeAG) on a Windows Server and at the end of the installation, the service named Migration Center Job Server is configured and finally started. Unfortunately this didn’t go well and the start command wasn’t working at all. We were using a dedicated technical account (AD account) to do the installation and to run this service. This is the error we got:

fmeAG_MC_Service_Start_Fail_Error

 

The error code 1067 means ‘ERROR_PROCESS_ABORTED’. This was the first time I saw this error, ever, so I wanted to know more about it. I performed a lot of tests on this environment to try to narrow down the issue and the following tests in particular were quite relevant:

  • Changing the Log On As user to something else
    • The service is able to start
    • It means that the issue is somehow linked to this particular technical user
  • Checking the ‘Log On As a service’ Local Policies
    • The technical user is listed and allowed to start the service so there is no issue there
  • Using the technical user to start a service on another Windows Server
    • The service is able to start
    • It means that the issue is not linked to the technical user globally

 

So with all these information, it appeared that the issue was linked to this particular technical user but only locally to this Windows Server… When working with AD accounts, it is always possible to face some issues with local profile VS domain profile (thanks Stéphane Haby for pointing that out to me, I’m not a Windows expert ;)) so I tried to work on that and after some time, I found a workaround to this issue. The workaround is simply to delete the local profile…

Since this is an AD account (that I will call <SYS_AD_ACCOUNT> below), it is possible to remove the local profile, it will just be recreated automatically when needed, you just need to remove it properly and for that, there are particular steps:

  1. Login to the Windows Server with another administrator account
  2. Log out all <SYS_AD_ACCOUNT> sessions: stop all services running with this account, all processes (from the task manager, there should be nothing on the “users” tab), aso… Alternatively, you can also disable the services (or manual mode) and then reboot the Windows Server
  3. Delete the complete folder C:\Users\<SYS_AD_ACCOUNT>. If you already tried this but did not remove the registry properly, you might end up with a C:\Users\TEMP folder… If this is the case, remove it now too.
  4. Delete the registry key matching <SYS_AD_ACCOUNT> (check the “ProfileImagePath” parameter) under “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList”
  5. Reboot the Windows Server
  6. Login to the Windows Server with the administrator account used for the step 1.
  7. Set <SYS_AD_ACCOUNT> for the “Log On As” of the target Service
  8. Start the target Service => It should now be working
  9. Login to the Windows Server with the <SYS_AD_ACCOUNT> account
  10. Open a cmd prompt => The current folder should be C:\Users\<SYS_AD_ACCOUNT> and not C:\Users\TEMP

 

I am not saying that this workaround will fix each and every issues linked to an error code 1067… Sometimes, this error will be linked to the fact that the service cannot find the executable for example. But in my case, it fixed the issue so if you are running out of options, maybe you can just give it a try ;).

 

 

Cet article Windows Server – Service not starting with ‘Error 1067: The process terminated unexpectedly’ est apparu en premier sur Blog dbi services.

Documentum – DA 7.3 showing java.lang.NullPointerException on every actions

Yann Neuhaus - Sat, 2018-02-10 01:45

Last year, we started to upgrade some Documentum Administrator from 7.2 to 7.3 and directly after, we started to see some NullPointerException on the log files. We are using DA 7.3 on some recent WebLogic Servers versions (12.1.3, 12.2.1.2). We usually deploy DA as a WAR file (so not exploded) with just the dfc.properties, keystores and logs outside of it. This is the kind of errors we started to see as soon as it was upgraded to 7.3 in the startup log file (nohup log file in our case):

java.lang.NullPointerException
        at java.io.FileInputStream.<init>(FileInputStream.java:130)
        at java.io.FileInputStream.<init>(FileInputStream.java:93)
        at com.documentum.web.form.WebformTag.fetchExtnNativeVersion(WebformTag.java:282)
        at com.documentum.web.form.WebformTag.renderExtnJavaScript(WebformTag.java:268)
        at com.documentum.web.form.WebformTag.doStartTag(WebformTag.java:159)
        at jsp_servlet._custom._jsp.__loginex._jsp__tag3(__loginex.java:1687)
        at jsp_servlet._custom._jsp.__loginex._jspService(__loginex.java:272)
        at weblogic.servlet.jsp.JspBase.service(JspBase.java:35)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
        at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:489)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:376)
        ...

 

The stack on the line 7 and 8 changed, depending on the action that was being performed. For example an access to the login page would print the following:

        at jsp_servlet._custom._jsp.__loginex._jsp__tag3(__loginex.java:1687)
        at jsp_servlet._custom._jsp.__loginex._jspService(__loginex.java:272)

 

Then once logged in, you would see each component printing the same kind of stack, with the following lines 7 and 8:

        at jsp_servlet._webtop._main.__mainex._jsp__tag0(__mainex.java:286)
        at jsp_servlet._webtop._main.__mainex._jspService(__mainex.java:116)

 

        at jsp_servlet._webtop._classic.__classic._jsp__tag0(__classic.java:408)
        at jsp_servlet._webtop._classic.__classic._jspService(__classic.java:112)

 

        at jsp_servlet._webtop._titlebar.__titlebar._jsp__tag0(__titlebar.java:436)
        at jsp_servlet._webtop._titlebar.__titlebar._jspService(__titlebar.java:175)

 

        at jsp_servlet._webtop._messagebar.__messagebar._jsp__tag0(__messagebar.java:145)
        at jsp_servlet._webtop._messagebar.__messagebar._jspService(__messagebar.java:107)

 

aso…

We were working with OpenText on this issue. As mentioned in the stack trace, this is actually because DA is trying to fetch the “ExtnNativeVersion”. This is a property file located there: wdk/extension/client/EMC/ContentXfer/com.emc.wdk.native/1. Unfortunately, when DA 7.3 is trying to locate this file, it does not work but the file is really present… It does not work because the DA is deployed as a WAR file (an archive) and therefore the path to the file is wrong. I suspect this is something that Documentum changed recently, using the getRealPath(). To change the behavior of the getRealPath function, you have to set the property “Archived Real Path Enabled” to true so it returns the canonical path of the file…

So to remove these exceptions, you have two options:

I. At the domain level:
  1. Login to the WebLogic Administration Console using your weblogic account
  2. Navigate to the correct page: DOMAIN > Configuration > Web Applications
  3. Click on the ‘Lock & Edit’ button
  4. Check the ‘Archived Real Path Enabled’ checkbox ( = set it to true)
  5. Click on the ‘Save’ and then ‘Activate Changes’ buttons

This will add the configuration to the global config.xml file so it is enabled for the whole domain. As often, I would not recommend that but rather configuring this at the application level because you might have other applications that do NOT want this setting to be set to true… So that is why you have the option number two:

II. At the application level:

The high level steps to do that would be the following ones:

  1. Extract the weblogic.xml file from the application war file
  2. Add the ‘Archived Real Path Enabled’ property in it and set it to true
  3. Repackage the war file and redeploy it

This is pretty simple:

[weblogic@weblogic_server_01 ~]$ cd $APPS_HOME
[weblogic@weblogic_server_01 apps]$ jar -xvf da.war WEB-INF/weblogic.xml
 inflated: WEB-INF/weblogic.xml
[weblogic@weblogic_server_01 apps]$
[weblogic@weblogic_server_01 apps]$ vi WEB-INF/weblogic.xml
[weblogic@weblogic_server_01 apps]$
[weblogic@weblogic_server_01 apps]$ tail -6 WEB-INF/weblogic.xml

   <container-descriptor>
      <show-archived-real-path-enabled>true</show-archived-real-path-enabled>
   </container-descriptor>

</weblogic-web-app>
[weblogic@weblogic_server_01 apps]$
[weblogic@weblogic_server_01 apps]$ jar -uvf da.war WEB-INF/weblogic.xml
adding: WEB-INF/weblogic.xml(in = 989) (out= 398)(deflated 59%)
[weblogic@weblogic_server_01 apps]$

 

Then, you just need to update the deployment in the WebLogic Administration Console and that’s it, the exceptions should be gone now. As far as I’m aware of, these exceptions did not have any impact on the proper behavior of Documentum Administrator but it is still very ugly to have hundreds of them in the log file…

 

 

Cet article Documentum – DA 7.3 showing java.lang.NullPointerException on every actions est apparu en premier sur Blog dbi services.

WebLogic – SSO/Atn/Atz – Infinite loop

Yann Neuhaus - Sat, 2018-02-10 01:00

This blog will be the last of my series around the WebLogic SSO (how to enable logs, 403 N°1, 403 N°2) which I started some weeks ago. Several months ago on a newly built High Availability Environment (2 WebLogic Servers behind a Load Balancer), an application team was deploying their D2 Client as always. After the deployment, it appeared to the tester that the Single Sign-On was not working when using the SSO URL through the Load Balancer. For this user, the URL was going crazy on an infinite loop between the LB URL and the SAML2 Partner URL. When I tried to replicate the issue, the SSO was working fine for me…

The only possible reason for the infinite loop for some users but not for all is that there is an issue with the SSO setup/configuration on one of the two WebLogic Servers only… Indeed, the Load Balancer (with sticky session) probably redirected the tester on the WLS with the issue while my session was redirected to the other one. Enabling the debug logs (on both WLS) quickly confirmed that all communications that were going through the first WebLogic Server were working properly (with SSO) while the second WebLogic Server had this infinite loop issue.

The logs from the WebLogic Server 1 and 2 were identical up to a certain point (basically all the SAML2 part), except some elements such as the local hostname, the date/hour and some IDs (like java class instances, aso…). This is the common content on both WLS logs:

<Nov 21, 2017 9:25:39 AM UTC> <Debug> <SecuritySAML2Service> <SAML2Filter: Processing request on URI '/D2/X3_Portal.jsp'>
<Nov 21, 2017 9:25:39 AM UTC> <Debug> <SecuritySAML2Service> <getServiceTypeFromURI(): request URI is '/D2/X3_Portal.jsp'>
<Nov 21, 2017 9:25:39 AM UTC> <Debug> <SecuritySAML2Service> <getServiceTypeFromURI(): request URI is not a service URI>
<Nov 21, 2017 9:25:39 AM UTC> <Debug> <SecuritySAML2Service> <getServiceTypeFromURI(): returning service type 'SPinitiator'>
<Nov 21, 2017 9:25:39 AM UTC> <Debug> <SecuritySAML2Service> <SP initiating authn request: processing>
<Nov 21, 2017 9:25:39 AM UTC> <Debug> <SecuritySAML2Service> <SP initiating authn request: partner id is null>
<Nov 21, 2017 9:25:39 AM UTC> <Debug> <SecuritySAML2Service> <SP initiating authn request: use partner binding HTTP/POST>
<Nov 21, 2017 9:25:39 AM UTC> <Debug> <SecuritySAML2Service> <post from template url: null>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Service> <SAML2Servlet: Processing request on URI '/saml2/sp/acs/post'>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Service> <getServiceTypeFromURI(): request URI is '/saml2/sp/acs/post'>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Service> <getServiceTypeFromURI(): service URI is '/sp/acs/post'>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Service> <getServiceTypeFromURI(): returning service type 'ACS'>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Service> <Assertion consumer service: processing>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Service> <get SAMLResponse from http request:PBvbnNSJ1cXMlFtZzaXM6bmHhtbG5zm46NhwOlJlOnNhbWxHbWxIb2Fc3wP6dGM6
U0FiB4bWxuczp4NTAwPSJ1cm46b2FzNTDoyLjA6YXNzZXJ0aW9uIaXM6bmFtZXM6
U0FdG9jb2wiIHhtbG5zOmRzaWc9Imh0dHA6Ly93NTDoyLjA6cHJvd3cudzMub3Jn
aHR0cDoa5vcmcvMjAwMS9W5zdGFuY2vL3d3dy53MyYTUxTY2hlbWEtUiIERlc3Rp
MWNxM2FjNzI1ZDjYmIVhNDM1Zlzc3VlSW5zdGFudD0ijhlNjc3OTkiIEMjAxNy0x
LzINpZyMiIHhtwMDAvMDkveG1sZHbG5DovL3d3dy53My5vczOmVuYz0iaHR0cmcv
...
YWRpb24+P1sOkF1ZGllbHJpY3mPHNhNlUmVzdC9zYW1sOkNvbmRpdGlvbnM+bWw6
YXNzUzpjbYW1YXNpczpuIuMlmVmPnVybjpvDphYxzp0YzpTQU1MOjGFzc2VzOlBh
OjAXh0Pj0OjUyWiI+PHNsOkF1dGhuQhxzYW129udGV4bWw6QXV0aG5Db250ZdENs
UmVnRlepBdXRobkNvbzYWmPjwvc2FtbDF1dGhuU1sOkHQ+PC93RhdGVtZW50Pjwv
c2F9zY25zZtbDpBcW1scDpSZXNwb3NlcnRpb24+PCT4=
>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Service> <BASE64 decoded saml message:<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:enc="http://www.w3.org/2001/04/xmlenc#" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:x500="urn:oasis:names:tc:SAML:2.0:profiles:attribute:X500" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Destination="https://weblogic_server_01/saml2/sp/acs/post" ID="id-HpDtn7r5XxxAQFYnwSLXZmkuVgIHTExrlreEDZ4-" InResponseTo="_0x7258edc52961ccbd5a435fb13ac67799" IssueInstant="2017-11-21T9:25:55Z" Version="2.0"><saml:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">https://idp_partner_01/fed/idp</saml:Issuer><dsig:Signature><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><dsig:Reference URI="#id-HpDtn7r5XxxAQFYnwSLXZmkuVgIHTExrlreEDZ4-"><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>YGtUZvsfo3z51AsBo7UDhbd6Ts=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>al8sJwbqzjh1qgM3Sj0QrX1aZjwyI...JB6l4jmj91BdQrYQ7VxFzvNLczZ2brJSdLLig==</dsig:SignatureValue><dsig:KeyInfo><dsig:X509Data><dsig:X509Certificate>MIwDQUg+nhYqGZ7pCgBQAwTTELMAkGA1UEBhMCQk1ZhQ...aATPRCd113tVqsvCkUwpfQ5zyUHaKw4FkXmiT2nzxxHA==</dsig:X509Certificate></dsig:X509Data></dsig:KeyInfo></dsig:Signature><samlp:Status><samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/></samlp:Status><saml:Assertion ID="id-0WrMNbOz6wsuZdFPhfjnw7WIXXQ6k89-1AgHZ9Oi" IssueInstant="2017-11-21T9:25:55Z" Version="2.0"><saml:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">https://idp_partner_01/fed/idp</saml:Issuer><dsig:Signature><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><dsig:Reference URI="#id-0WrMNbOz6wsuZdFPhfjnw7WIXXQ6k89-1AgHZ9Oi"><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>7+jZtq8SpY3BKVaFjIFeEJm51cA=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>GIlXt4B4rVFoDJRxidpZO73gXB68Dd+mcpoV9DKrjBBjLRz...zGTDcEYY2MG8FgtarZhVQGc4zxkkSg8GRT6Wng3NEuTUuA==</dsig:SignatureValue><dsig:KeyInfo><dsig:X509Data><dsig:X509Certificate>MIwDQUg+nhYqGZ7pCgBQAwTTELMAkGA1UEBhMCQk1ZhQ...aATPRCd113tVqsvCkUwpfQ5zyUHaKw4FkXmiT2nzxxHA==</dsig:X509Certificate></dsig:X509Data></dsig:KeyInfo></dsig:Signature><saml:Subject><saml:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">PATOU_MORGAN</saml:NameID><saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"><saml:SubjectConfirmationData InResponseTo="_0x7258edc52961ccbd5a435fb13ac67799" NotOnOrAfter="2017-11-21T9:30:55Z" Recipient="https://weblogic_server_01/saml2/sp/acs/post"/></saml:SubjectConfirmation></saml:Subject><saml:Conditions NotBefore="2017-11-21T9:25:55Z" NotOnOrAfter="2017-11-21T9:30:55Z"><saml:AudienceRestriction><saml:Audience>SAML2_Entity_ID_01</saml:Audience></saml:AudienceRestriction></saml:Conditions><saml:AuthnStatement AuthnInstant="2017-11-21T9:25:55Z" SessionIndex="id-oX9wXdpGmt9GQlVffvY4hEIRULEd25nrxDzE8D7w" SessionNotOnOrAfter="2017-11-21T9:40:55Z"><saml:AuthnContext><saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef></saml:AuthnContext></saml:AuthnStatement></saml:Assertion></samlp:Response>>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Service> <<samlp:Response> is signed.>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.IdentityAssertionServiceImpl.assertIdentity(SAML2.Assertion.DOM)>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.IdentityAssertionTokenServiceImpl.assertIdentity(SAML2.Assertion.DOM)>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Atn> <SAML2IdentityAsserterProvider: start assert SAML2 token>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Atn> <SAML2IdentityAsserterProvider: SAML2IdentityAsserter: tokenType is 'SAML2.Assertion.DOM'>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Atn> <SAML2Assert: Start verify assertion signature>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Atn> <SAML2Assert: The assertion is signed.>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Atn> <SAML2Assert: End verify assertion signature>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Atn> <SAML2Assert: Start verify assertion attributes>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Atn> <SAML2Assert: End verify assertion attributes>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Atn> <SAML2Assert: Start verify assertion issuer>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Atn> <SAML2Assert: End verify assertion issuer>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Atn> <SAML2Assert: Start verify assertion conditions>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Atn> <SAML2Assert: End verify assertion conditions>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Atn> <SAML2Assert: Start verify assertion subject>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Atn> <SAML2Assert: End verify assertion subject>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Atn> <SAML2NameMapperCache.getNameMapper: Found name mapper in the cache>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Atn> <SAML2Assert.processAttributes - processAttrs: false, processGrpAttrs: true>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Atn> <DefaultSAML2NameMapperImpl: mapName: Mapped name: qualifier: null, name: PATOU_MORGAN>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Atn> <SAMLIACallbackHandler: SAMLIACallbackHandler(true, PATOU_MORGAN, null)>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.IdentityAssertionCallbackServiceImpl.assertIdentity>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.IdentityAssertionCallbackServiceImpl.assertIdentity>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Atn> <SAMLIACallbackHandler: callback[0]: NameCallback: setName(PATOU_MORGAN)>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.IdentityAssertionCallbackServiceImpl.assertIdentity returning PATOU_MORGAN>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.IdentityCacheServiceImpl.getCachedIdentity(idm:_def_Idmusr:PATOU_MORGAN)>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.IdentityCacheServiceImpl.getCachedIdentity(idm:_def_Idmusr:PATOU_MORGAN) returning null>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.IdentityAssertionCallbackServiceImpl.assertIdentity did not find a cached identity.>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.CallbackHandlerWrapper.constructor>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.JAASIdentityAssertionConfigurationServiceImpl.getJAASIdentityAssertionConfigurationName()>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <weblogic.security.service.internal.WLSJAASLoginServiceImpl$ServiceImpl.authenticate>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.JAASLoginServiceImpl.login ClassLoader=sun.misc.Launcher$AppClassLoader@7d4991ad>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.JAASLoginServiceImpl.login ThreadContext ClassLoader Original=com.bea.common.security.utils.SAML2ClassLoader@625ecb90>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.JAASIdentityAssertionConfigurationServiceImpl.getAppConfigurationEntry(com.bea.common.security.internal.service.JAASIdentityAssertionConfigurationServiceImpl0)>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.JAASIdentityAssertionConfigurationServiceImpl.getAppConfigurationEntry>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.legacy.service.JAASIdentityAssertionProviderImpl$V1Wrapper.getAssertionModuleConfiguration>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.JAASIdentityAssertionConfigurationServiceImpl$JAASProviderImpl.getProviderAppConfigurationEntry returning LoginModuleClassName=weblogic.security.providers.authentication.LDAPAtnLoginModuleImpl, ControlFlag=LoginModuleControlFlag: sufficient>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.legacy.service.JAASIdentityAssertionProviderImpl$V1Wrapper.getClassLoader>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.LoginModuleWrapper.wrap LoginModuleClassName=weblogic.security.providers.authentication.LDAPAtnLoginModuleImpl>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.LoginModuleWrapper.wrap ClassLoader=java.net.URLClassLoader@108c7fe5>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.LoginModuleWrapper.wrap ControlFlag=LoginModuleControlFlag: sufficient>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.legacy.service.JAASIdentityAssertionProviderImpl$V1Wrapper.getAssertionModuleConfiguration>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.JAASIdentityAssertionConfigurationServiceImpl$JAASProviderImpl.getProviderAppConfigurationEntry returning LoginModuleClassName=weblogic.security.providers.authentication.LDAPAtnLoginModuleImpl, ControlFlag=LoginModuleControlFlag: required>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.legacy.service.JAASIdentityAssertionProviderImpl$V1Wrapper.getClassLoader>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.LoginModuleWrapper.wrap LoginModuleClassName=weblogic.security.providers.authentication.LDAPAtnLoginModuleImpl>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.LoginModuleWrapper.wrap ClassLoader=java.net.URLClassLoader@108c7fe5>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.LoginModuleWrapper.wrap ControlFlag=LoginModuleControlFlag: required>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.JAASLoginServiceImpl.login created LoginContext>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.JAASLoginServiceImpl.login ThreadContext ClassLoader Current=com.bea.common.security.utils.SAML2ClassLoader@625ecb90>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.LoginModuleWrapper.initialize LoginModuleClassName=weblogic.security.providers.authentication.LDAPAtnLoginModuleImpl>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.LoginModuleWrapper.initialize ClassLoader=java.net.URLClassLoader@108c7fe5>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.LoginModuleWrapper.initialize created delegate login module>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <LDAP ATN LoginModule initialized>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.LoginModuleWrapper.initialize delegated>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.LoginModuleWrapper.login>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <LDAP Atn Login>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.CallbackHandlerWrapper.handle>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.CallbackHandlerWrapper.handle callbcacks[0] will be delegated>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.CallbackHandlerWrapper.handle callbcacks[0] will use NameCallback to retrieve name>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.CallbackHandlerWrapper.handle will delegate all callbacks>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Atn> <SAMLIACallbackHandler: callback[0]: NameCallback: setName(PATOU_MORGAN)>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.CallbackHandlerWrapper.handle delegated callbacks>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.CallbackHandlerWrapper.handle got username from callbacks[0], UserName=PATOU_MORGAN>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <LDAP Atn Login username: PATOU_MORGAN>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <getUserDNName? user:PATOU_MORGAN>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <getDNForUser search("ou=people,ou=internal,dc=company,dc=com", "(&(uid=PATOU_MORGAN)(objectclass=companyperson))", base DN & below)>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <getConnection return conn:LDAPConnection {ldaps://ldap.company.com:3636 ldapVersion:3 bindDN:"ou=bind_user,ou=applications,ou=internal,dc=company,dc=com"}>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <ConnSetupMgr><Connecting to host=ldap.company.com, ssl port=3636>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <ConnSetupMgr><Successfully connected to host=ldap.company.com, ssl port=3636>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <Retrieved guid:c6e6f021-2b29d761-8284c0aa-df200d0f>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <DN for user PATOU_MORGAN: uid=PATOU_MORGAN,ou=people,ou=internal,dc=company,dc=com>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <found user from ldap, user:PATOU_MORGAN, userDN=uid=PATOU_MORGAN,ou=people,ou=internal,dc=company,dc=com>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <Retrieved username from LDAP :PATOU_MORGAN>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <returnConnection conn:LDAPConnection {ldaps://ldap.company.com:3636 ldapVersion:3 bindDN:"ou=bind_user,ou=applications,ou=internal,dc=company,dc=com"}>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <LDAP Atn Asserted Identity for PATOU_MORGAN>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <List groups that member: PATOU_MORGAN belongs to>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <DN for user PATOU_MORGAN: uid=PATOU_MORGAN,ou=people,ou=internal,dc=company,dc=com>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <Retrieved dn:uid=PATOU_MORGAN,ou=people,ou=internal,dc=company,dc=com for user:PATOU_MORGAN>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <search("ou=bind_user,ou=applications,ou=internal,dc=company,dc=com", "(&(uniquemember=uid=PATOU_MORGAN,ou=people,ou=internal,dc=company,dc=com)(objectclass=groupofuniquenames))", base DN & below)>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <getConnection return conn:LDAPConnection {ldaps://ldap.company.com:3636 ldapVersion:3 bindDN:"ou=bind_user,ou=applications,ou=internal,dc=company,dc=com"}>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <Result has more elements: false>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <search("ou=bind_user,ou=applications,ou=internal,dc=company,dc=com", "(objectclass=groupofURLs)", base DN & below)>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <returnConnection conn:LDAPConnection {ldaps://ldap.company.com:3636 ldapVersion:3 bindDN:"ou=bind_user,ou=applications,ou=internal,dc=company,dc=com"}>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <DN for user PATOU_MORGAN: uid=PATOU_MORGAN,ou=people,ou=internal,dc=company,dc=com>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <Retrieved dn:uid=PATOU_MORGAN,ou=people,ou=internal,dc=company,dc=com for user:PATOU_MORGAN>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <login succeeded for username PATOU_MORGAN>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.LoginModuleWrapper.login delegated, returning true>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.LoginModuleWrapper.commit>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <LDAP Atn Commit>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <LDAP Atn Principals Added>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.LoginModuleWrapper.commit delegated, returning true>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.JAASLoginServiceImpl.login logged in>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.JAASLoginServiceImpl.login subject=Subject:
        Principal: PATOU_MORGAN
        Private Credential: PATOU_MORGAN
>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <weblogic.security.service.internal.WLSIdentityServiceImpl.getIdentityFromSubject Subject: 1
        Principal = class weblogic.security.principal.WLSUserImpl("PATOU_MORGAN")
>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.PrincipalValidationServiceImpl.sign(Principals)>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.PrincipalValidationServiceImpl.sign(Principal) Principal=PATOU_MORGAN>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.PrincipalValidationServiceImpl.sign(Principal) PrincipalClassName=weblogic.security.principal.WLSUserImpl>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.PrincipalValidationServiceImpl.sign(Principal) trying PrincipalValidator for interface weblogic.security.principal.WLSPrincipal>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.PrincipalValidationServiceImpl.sign(Principal) PrincipalValidator handles this PrincipalClass>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <Generated signature and signed WLS principal PATOU_MORGAN>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.PrincipalValidationServiceImpl.sign(Principal) PrincipalValidator signed the principal>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.PrincipalValidationServiceImpl.sign(Principal) All required PrincipalValidators signed this PrincipalClass, returning true>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.JAASLoginServiceImpl.login identity=Subject: 1
        Principal = class weblogic.security.principal.WLSUserImpl("PATOU_MORGAN")
>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <weblogic.security.service.internal.WLSJAASLoginServiceImpl$ServiceImpl.authenticate authenticate succeeded for user PATOU_MORGAN, Identity=Subject: 1
        Principal = class weblogic.security.principal.WLSUserImpl("PATOU_MORGAN")
>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <weblogic.security.service.internal.WLSJAASLoginServiceImpl$ServiceImpl.authenticate login succeeded and PATOU_MORGAN was not previously locked out>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.IdentityCacheServiceImpl.cachedIdentity(Subject: 1
        Principal = class weblogic.security.principal.WLSUserImpl("PATOU_MORGAN")
),cacheKe y= idm:_def_Idmusr:PATOU_MORGAN>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Service> <Using redirect URL from request cache: 'https://d2.company.com:443/D2/X3_Portal.jsp'>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Service> <Redirecting to URL: https://d2.company.com:443/D2/X3_Portal.jsp>

 

At this point, the SAML2 exchange is successful and the user has been found in the LDAP successfully. So the only thing remaining is the validation of the user on WebLogic side as well as the access to the Application (D2 in this case). That’s where the logs of the WLS started to diverge.

On the WebLogic Server 1 (no issue), we can see WebLogic validating the user and finally granting access to the application:

<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.IdentityCacheServiceImpl.cachedIdentity(Subject: 1
        Principal = class weblogic.security.principal.WLSUserImpl("PATOU_MORGAN")
),cacheKe y= idm:_def_Idmusr:PATOU_MORGAN>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Service> <Using redirect URL from request cache: 'https://d2.company.com:443/D2/X3_Portal.jsp'>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecuritySAML2Service> <Redirecting to URL: https://d2.company.com:443/D2/X3_Portal.jsp>

<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <PrincipalAuthenticator.validateIdentity>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <PrincipalAuthenticator.validateIdentity will use common security service>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.PrincipalValidationServiceImpl.validate(Principals)>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.PrincipalValidationServiceImpl.validate(Principal) Principal=PATOU_MORGAN>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.PrincipalValidationServiceImpl.validate(Principal) PrincipalClassName=weblogic.security.principal.WLSUserImpl>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.PrincipalValidationServiceImpl.validate(Principal) trying PrincipalValidator for interface weblogic.security.principal.WLSPrincipal>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.PrincipalValidationServiceImpl.validate(Principal) PrincipalValidator handles this PrincipalClass>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <Validate WLS principal PATOU_MORGAN returns true>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.PrincipalValidationServiceImpl.validate(Principal) PrincipalValidator said the principal is valid>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.PrincipalValidationServiceImpl.validate(Principal) One or more PrincipalValidators handled this PrincipalClass, returning true>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.PrincipalValidationServiceImpl.validate(Principals) validated all principals>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <AuthorizationManager will use common security for ATZ>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <weblogic.security.service.WLSAuthorizationServiceWrapper.isAccessAllowed>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <com.bea.common.security.internal.service.AccessDecisionServiceImpl.isAccessAllowed Identity=Subject: 1
        Principal = class weblogic.security.principal.WLSUserImpl("PATOU_MORGAN")
>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <com.bea.common.security.internal.service.AccessDecisionServiceImpl.isAccessAllowed Roles=[ "Anonymous" "consumer" ]>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <com.bea.common.security.internal.service.AccessDecisionServiceImpl.isAccessAllowed Resource=type=<url>, application=D2, contextPath=/D2, uri=/X3_Portal.jsp, httpMethod=GET>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <com.bea.common.security.internal.service.AccessDecisionServiceImpl.isAccessAllowed Direction=ONCE>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <XACML Authorization isAccessAllowed(): input arguments:>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> < Subject: 1
        Principal = weblogic.security.principal.WLSUserImpl("PATOU_MORGAN")
>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> < Roles:Anonymous, consumer>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> < Resource: type=<url>, application=D2, contextPath=/D2, uri=/X3_Portal.jsp, httpMethod=GET>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> < Direction: ONCE>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> < Context Handler: >
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <Accessed Subject: Id=urn:oasis:names:tc:xacml:2.0:subject:role, Value=[Anonymous,consumer]>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <Evaluate urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of([consumer,consumer],[Anonymous,consumer]) -> true>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <primary-rule evaluates to Permit>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <urn:bea:xacml:2.0:entitlement:resource:type@E@Furl@G@M@Oapplication@ED2@M@OcontextPath@E@UD2@M@Ouri@E@U@K@M@OhttpMethod@EGET, 1.0 evaluates to Permit>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <XACML Authorization isAccessAllowed(): returning PERMIT>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <com.bea.common.security.internal.service.AccessDecisionServiceImpl.isAccessAllowed AccessDecision returned PERMIT>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <com.bea.common.security.internal.service.AuthorizationServiceImpl.isAccessAllowed returning adjudicated: true>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <AuthorizationManager will use common security for ATZ>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <weblogic.security.service.WLSAuthorizationServiceWrapper.isAccessAllowed>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <com.bea.common.security.internal.service.AccessDecisionServiceImpl.isAccessAllowed Identity=Subject: 1
        Principal = class weblogic.security.principal.WLSUserImpl("PATOU_MORGAN")
>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <com.bea.common.security.internal.service.AccessDecisionServiceImpl.isAccessAllowed Roles=[ "Anonymous" "consumer" ]>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <com.bea.common.security.internal.service.AccessDecisionServiceImpl.isAccessAllowed Resource=type=<url>, application=D2, contextPath=/D2, uri=/x3_portal/x3_portal.nocache.js, httpMethod=GET>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <com.bea.common.security.internal.service.AccessDecisionServiceImpl.isAccessAllowed Direction=ONCE>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <XACML Authorization isAccessAllowed(): input arguments:>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <        Subject: 1
        Principal = weblogic.security.principal.WLSUserImpl("PATOU_MORGAN")
>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <        Roles:Anonymous, consumer>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <        Resource: type=<url>, application=D2, contextPath=/D2, uri=/x3_portal/x3_portal.nocache.js, httpMethod=GET>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <        Direction: ONCE>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <        Context Handler: >
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <Accessed Subject: Id=urn:oasis:names:tc:xacml:2.0:subject:role, Value=[Anonymous,consumer]>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <Evaluate urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of([consumer,consumer],[Anonymous,consumer]) -> true>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <primary-rule evaluates to Permit>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <urn:bea:xacml:2.0:entitlement:resource:type@E@Furl@G@M@Oapplication@ED2@M@OcontextPath@E@UD2@M@Ouri@E@U@K@M@OhttpMethod@EGET, 1.0 evaluates to Permit>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <XACML Authorization isAccessAllowed(): returning PERMIT>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <com.bea.common.security.internal.service.AccessDecisionServiceImpl.isAccessAllowed AccessDecision returned PERMIT>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <com.bea.common.security.internal.service.AuthorizationServiceImpl.isAccessAllowed returning adjudicated: true>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <AuthorizationManager will use common security for ATZ>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <weblogic.security.service.WLSAuthorizationServiceWrapper.isAccessAllowed>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <com.bea.common.security.internal.service.AccessDecisionServiceImpl.isAccessAllowed Identity=Subject: 1
        Principal = class weblogic.security.principal.WLSUserImpl("PATOU_MORGAN")
>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <com.bea.common.security.internal.service.AccessDecisionServiceImpl.isAccessAllowed Roles=[ "Anonymous" "consumer" ]>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <com.bea.common.security.internal.service.AccessDecisionServiceImpl.isAccessAllowed Resource=type=<url>, application=D2, contextPath=/D2, uri=/x3_portal/79E87564DA9D026D7ADA9326E414D4FC.cache.js, httpMethod=GET>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <com.bea.common.security.internal.service.AccessDecisionServiceImpl.isAccessAllowed Direction=ONCE>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <XACML Authorization isAccessAllowed(): input arguments:>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <        Subject: 1
        Principal = weblogic.security.principal.WLSUserImpl("PATOU_MORGAN")
>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <        Roles:Anonymous, consumer>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <        Resource: type=<url>, application=D2, contextPath=/D2, uri=/x3_portal/79E87564DA9D026D7ADA9326E414D4FC.cache.js, httpMethod=GET>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <        Direction: ONCE>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <        Context Handler: >
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <Accessed Subject: Id=urn:oasis:names:tc:xacml:2.0:subject:role, Value=[Anonymous,consumer]>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <Evaluate urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of([consumer,consumer],[Anonymous,consumer]) -> true>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <primary-rule evaluates to Permit>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <urn:bea:xacml:2.0:entitlement:resource:type@E@Furl@G@M@Oapplication@ED2@M@OcontextPath@E@UD2@M@Ouri@E@U@K@M@OhttpMethod@EGET, 1.0 evaluates to Permit>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <XACML Authorization isAccessAllowed(): returning PERMIT>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <com.bea.common.security.internal.service.AccessDecisionServiceImpl.isAccessAllowed AccessDecision returned PERMIT>
<Nov 21, 2017 9:25:55 AM UTC> <Debug> <SecurityAtz> <com.bea.common.security.internal.service.AuthorizationServiceImpl.isAccessAllowed returning adjudicated: true>

 

On the other hand, the WebLogic Server 2 (with issue) didn’t even start to validate the user, it just started again the full SAML2 process:

<Nov 21, 2017 10:34:53 AM UTC> <Debug> <SecurityAtn> <com.bea.common.security.internal.service.IdentityCacheServiceImpl.cachedIdentity(Subject: 1
        Principal = class weblogic.security.principal.WLSUserImpl("PATOU_MORGAN")
),cacheKe y= idm:_def_Idmusr:PATOU_MORGAN>
<Nov 21, 2017 10:34:53 AM UTC> <Debug> <SecuritySAML2Service> <Using redirect URL from request cache: 'https://d2.company.com:443/D2/X3_Portal.jsp'>
<Nov 21, 2017 10:34:53 AM UTC> <Debug> <SecuritySAML2Service> <Redirecting to URL: https://d2.company.com:443/D2/X3_Portal.jsp>

<Nov 21, 2017 10:34:53 AM UTC> <Debug> <SecuritySAML2Service> <SAML2Filter: Processing request on URI '/D2/X3_Portal.jsp'>
<Nov 21, 2017 10:34:53 AM UTC> <Debug> <SecuritySAML2Service> <getServiceTypeFromURI(): request URI is '/D2/X3_Portal.jsp'>
<Nov 21, 2017 10:34:53 AM UTC> <Debug> <SecuritySAML2Service> <getServiceTypeFromURI(): request URI is not a service URI>
<Nov 21, 2017 10:34:53 AM UTC> <Debug> <SecuritySAML2Service> <getServiceTypeFromURI(): returning service type 'SPinitiator'>
<Nov 21, 2017 10:34:53 AM UTC> <Debug> <SecuritySAML2Service> <SP initiating authn request: processing>
<Nov 21, 2017 10:34:53 AM UTC> <Debug> <SecuritySAML2Service> <SP initiating authn request: partner id is null>
<Nov 21, 2017 10:34:54 AM UTC> <Debug> <SecuritySAML2Service> <SP initiating authn request: use partner binding HTTP/POST>
<Nov 21, 2017 10:34:54 AM UTC> <Debug> <SecuritySAML2Service> <post from template url: null>
<Nov 21, 2017 10:34:54 AM UTC> <Debug> <SecuritySAML2Service> <SAML2Servlet: Processing request on URI '/saml2/sp/acs/post'>
<Nov 21, 2017 10:34:54 AM UTC> <Debug> <SecuritySAML2Service> <getServiceTypeFromURI(): request URI is '/saml2/sp/acs/post'>
<Nov 21, 2017 10:34:54 AM UTC> <Debug> <SecuritySAML2Service> <getServiceTypeFromURI(): service URI is '/sp/acs/post'>
<Nov 21, 2017 10:34:54 AM UTC> <Debug> <SecuritySAML2Service> <getServiceTypeFromURI(): returning service type 'ACS'>
<Nov 21, 2017 10:34:54 AM UTC> <Debug> <SecuritySAML2Service> <Assertion consumer service: processing>

 

This WebLogic Server 2 is acting just like if it was a completely new request and not an existing one… And this is the reaction I had when I saw this log so I checked the session identifier!

Whenever you configure an Application to support SAML2 SSO, then the session identifier must be the default one. If you set something else, then you will have this infinite loop of authentication because WebLogic will consider a successful authentication as a non-authenticated one. This is described in the Oracle documentation.

So to solve this issue, that’s pretty simple… Either comment the session identifier or set it to the default value (below I’m just resetting it to the default value):

[weblogic@weblogic_server_01 ~]$ cd $APPS_HOME
[weblogic@weblogic_server_01 apps]$ jar -xvf D2.war WEB-INF/weblogic.xml
 inflated: WEB-INF/weblogic.xml
[weblogic@weblogic_server_01 apps]$
[weblogic@weblogic_server_01 apps]$ sed -i 's,<cookie-name>[^<]*<,<cookie-name>JSESSIONID<,' WEB-INF/weblogic.xml
[weblogic@weblogic_server_01 apps]$
[weblogic@weblogic_server_01 apps]$ grep -A3 -B2 cookie-name WEB-INF/weblogic.xml

  <session-descriptor>
    <cookie-name>JSESSIONID</cookie-name>
    <cookie-http-only>false</cookie-http-only>
  </session-descriptor>

[weblogic@weblogic_server_01 apps]$
[weblogic@weblogic_server_01 apps]$ jar -uvf D2.war WEB-INF/weblogic.xml
adding: WEB-INF/weblogic.xml(in = 901) (out= 432)(deflated 52%)
[weblogic@weblogic_server_01 apps]$

 

Then you obviously need to redeploy your application and it will be working. :)

 

 

Cet article WebLogic – SSO/Atn/Atz – Infinite loop est apparu en premier sur Blog dbi services.

Server process name in Postgres and Oracle

Yann Neuhaus - Fri, 2018-02-09 16:01

Every database analysis should start with system load analysis. If the host is in CPU starvation, then looking at other statistics can be pointless. With ‘top’ on Linux, or equivalent such as process explorer on Windows, you see the process (and threads). If the name of the process is meaningful, you already have a clue about the active sessions. Postgres goes further by showing the operation (which SQL command), the state (running or waiting), and the identification of the client.

Postgres

By default ‘top’ displays the program name (like ‘comm’ in /proc or in ‘ps’ format), which will be ‘postgres’ for all PostgreSQL processes. But you can also display the command line with ‘c’ in interactive mode, or directly starting with ‘top -c’, which is the same as the /proc/$pid/cmdline or ‘cmd’ or ‘args’ in ‘ps’ format.


top -c
 
Tasks: 263 total, 13 running, 250 sleeping, 0 stopped, 0 zombie
%Cpu(s): 24.4 us, 5.0 sy, 0.0 ni, 68.5 id, 0.9 wa, 0.0 hi, 1.2 si, 0.0 st
KiB Mem : 4044424 total, 558000 free, 2731380 used, 755044 buff/cache
KiB Swap: 421884 total, 418904 free, 2980 used. 2107088 avail Mem
 
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
20347 postgres 20 0 394760 11660 8696 S 7.6 0.3 0:00.49 postgres: demo demo 192.168.56.125(37664) DELETE
20365 postgres 20 0 393816 11448 8736 S 6.9 0.3 0:00.37 postgres: demo demo 192.168.56.125(37669) idle
20346 postgres 20 0 393800 11440 8736 S 6.6 0.3 0:00.37 postgres: demo demo 192.168.56.125(37663) UPDATE
20356 postgres 20 0 396056 12480 8736 S 6.6 0.3 0:00.42 postgres: demo demo 192.168.56.125(37667) INSERT
20357 postgres 20 0 393768 11396 8736 S 6.6 0.3 0:00.40 postgres: demo demo 192.168.56.125(37668) DELETE waiting
20366 postgres 20 0 394728 11652 8736 S 6.6 0.3 0:00.35 postgres: demo demo 192.168.56.125(37670) UPDATE
20387 postgres 20 0 394088 11420 8720 S 6.6 0.3 0:00.41 postgres: demo demo 192.168.56.125(37676) UPDATE
20336 postgres 20 0 395032 12436 8736 S 6.3 0.3 0:00.37 postgres: demo demo 192.168.56.125(37661) UPDATE
20320 postgres 20 0 395032 12468 8736 R 5.9 0.3 0:00.33 postgres: demo demo 192.168.56.125(37658) DROP TABLE
20348 postgres 20 0 395016 12360 8736 R 5.9 0.3 0:00.33 postgres: demo demo 192.168.56.125(37665) VACUUM
20371 postgres 20 0 396008 12708 8736 R 5.9 0.3 0:00.40 postgres: demo demo 192.168.56.125(37673) INSERT
20321 postgres 20 0 396040 12516 8736 D 5.6 0.3 0:00.31 postgres: demo demo 192.168.56.125(37659) INSERT
20333 postgres 20 0 395016 11920 8700 R 5.6 0.3 0:00.36 postgres: demo demo 192.168.56.125(37660) UPDATE
20368 postgres 20 0 393768 11396 8736 R 5.6 0.3 0:00.43 postgres: demo demo 192.168.56.125(37671) UPDATE
20372 postgres 20 0 393768 11396 8736 R 5.6 0.3 0:00.36 postgres: demo demo 192.168.56.125(37674) INSERT
20340 postgres 20 0 394728 11700 8736 S 5.3 0.3 0:00.40 postgres: demo demo 192.168.56.125(37662) idle
20355 postgres 20 0 394120 11628 8672 S 5.3 0.3 0:00.32 postgres: demo demo 192.168.56.125(37666) DELETE waiting
20389 postgres 20 0 395016 12196 8724 R 5.3 0.3 0:00.37 postgres: demo demo 192.168.56.125(37677) UPDATE
20370 postgres 20 0 393768 11392 8736 S 4.6 0.3 0:00.34 postgres: demo demo 192.168.56.125(37672) DELETE
20376 postgres 20 0 393816 11436 8736 S 4.6 0.3 0:00.37 postgres: demo demo 192.168.56.125(37675) DELETE waiting
20243 postgres 20 0 392364 5124 3696 S 1.0 0.1 0:00.06 postgres: wal writer process

This is very useful information. Postgres changes the process title when it executes a statement. In this example:

  • ‘postgres:’ is the name of the process
  • ‘demo demo’ are the database name and the user name
  • ‘192.168.56.125(37664)’ are the IP address and port of the client.
  • DELETE, UPDATE… are the commands. They are more or less the command name used in the feed back after the command completion
  • ‘idle’ is for sessions not currently running a statement
  • ‘waiting’ is added when the session is waiting on a blocker session (enqueued on a lock for example)
  • ‘wal writer process’ is a background process

This is very useful information, especially because we have, on the same sampling, the Postgres session state (idle, waiting or running an operation) with the Linux process state (S when sleeping, R when runnable or running, D when in I/O,… ).

Oracle

With Oracle, you can have ASH to sample session state, but being able to see it at OS level would be great. It would also be a safeguard if we need to kill a process.

But, the Oracle processes do not change while running. They are set at connection time.

The background processes mention the Oracle process name and the Instance name:

[oracle@VM122 ~]$ ps -u oracle -o pid,comm,cmd,args | head
 
PID COMMAND CMD COMMAND
1873 ora_pmon_cdb2 ora_pmon_CDB2 ora_pmon_CDB2
1875 ora_clmn_cdb2 ora_clmn_CDB2 ora_clmn_CDB2
1877 ora_psp0_cdb2 ora_psp0_CDB2 ora_psp0_CDB2
1880 ora_vktm_cdb2 ora_vktm_CDB2 ora_vktm_CDB2
1884 ora_gen0_cdb2 ora_gen0_CDB2 ora_gen0_CDB2

The foreground processes mention the instance and the connection type, LOCAL=YES for bequeath, LOCAL=NO for remote via listener.


[oracle@VM122 ~]$ ps -u oracle -o pid,comm,cmd,args | grep -E "[ ]oracle_|[ ]PID"
 
PID COMMAND CMD COMMAND
21429 oracle_21429_cd oracleCDB2 (LOCAL=NO) oracleCDB2 (LOCAL=NO)
21431 oracle_21431_cd oracleCDB2 (LOCAL=NO) oracleCDB2 (LOCAL=NO)
21451 oracle_21451_cd oracleCDB2 (LOCAL=NO) oracleCDB2 (LOCAL=NO)
21517 oracle_21517_cd oracleCDB1 (LOCAL=NO) oracleCDB1 (LOCAL=NO)

You need to join V$PROCESS with V$SESSION on (V$PROCESS.ADDR=V$SESSION.PADDR) to find the state, operation and client information

For the fun, you can change the program name (ARGV0) and arguments (ARGS).

The local connections can change the name in the BEQueath connection string:


sqlplus -s system/oracle@"(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=$ORACLE_HOME/bin/oracle)(ARGV0=postgres)(ARGS='(DESCRIPTION=(LOCAL=MAYBE)(ADDRESS=(PROTOCOL=BEQ)))')(ENVS='OLE_HOME=$ORACLE_HOME,ORACLE_SID=CDB1'))" <<< "host ps -u oracle -o pid,comm,cmd,args | grep -E '[ ]oracle_|[ ]PID'"
 
PID COMMAND CMD COMMAND
21155 oracle_21155_cd oracleCDB2 (LOCAL=NO) oracleCDB2 (LOCAL=NO)
21176 oracle_21176_cd oracleCDB2 (LOCAL=NO) oracleCDB2 (LOCAL=NO)
21429 oracle_21429_cd oracleCDB2 (LOCAL=NO) oracleCDB2 (LOCAL=NO)
21431 oracle_21431_cd oracleCDB2 (LOCAL=NO) oracleCDB2 (LOCAL=NO)
21451 oracle_21451_cd oracleCDB2 (LOCAL=NO) oracleCDB2 (LOCAL=NO)
21517 oracle_21517_cd oracleCDB1 (LOCAL=NO) oracleCDB1 (LOCAL=NO)
22593 oracle_22593_cd postgres (DESCRIPTION=(LOCA postgres (DESCRIPTION=(LOCAL=MAYBE)(ADDRESS=(PROTOCOL=BEQ)))

The remote connection can have the name changed from the static registration, adding an ARVG0 value on the listener side:


LISTENER=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
SID_LIST_LISTENER=(SID_LIST=
(SID_DESC=(GLOBAL_DBNAME=MYAPP)(ARGV0=myapp)(SID_NAME=CDB1)(ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1))
(SID_DESC=(GLOBAL_DBNAME=CDB1_DGMGRL)(SID_NAME=CDB1)(ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1))
(SID_DESC=(GLOBAL_DBNAME=CDB2_DGMGRL)(SID_NAME=CDB2)(ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1))
)

When reloading the listener with this (ARGV0=myapp) to identify connection from this MYAPP service

[oracle@VM122 ~]$ sqlplus -s system/oracle@//localhost/MYAPP <<< "host ps -u oracle -o pid,comm,cmd,args | grep -E '[ ]oracle_|[ ]PID'"
PID COMMAND CMD COMMAND
21155 oracle_21155_cd oracleCDB2 (LOCAL=NO) oracleCDB2 (LOCAL=NO)
21176 oracle_21176_cd oracleCDB2 (LOCAL=NO) oracleCDB2 (LOCAL=NO)
21429 oracle_21429_cd oracleCDB2 (LOCAL=NO) oracleCDB2 (LOCAL=NO)
21431 oracle_21431_cd oracleCDB2 (LOCAL=NO) oracleCDB2 (LOCAL=NO)
21451 oracle_21451_cd oracleCDB2 (LOCAL=NO) oracleCDB2 (LOCAL=NO)
21517 oracle_21517_cd oracleCDB1 (LOCAL=NO) oracleCDB1 (LOCAL=NO)
24261 oracle_24261_cd myapp (LOCAL=NO) myapp (LOCAL=NO)

However, I would not recommend to change the default. This can be very confusing for people expecting ora_xxxx_SID and oracleSID process names.

 

Cet article Server process name in Postgres and Oracle est apparu en premier sur Blog dbi services.

The Transition (or: How I Learned to Stop Worrying and Love PostgreSQL)

Don Seiler - Fri, 2018-02-09 14:31
Note: Yes I re-(ab)used the title.



As some of you may know (if you follow me on twitter), after 16 years as an Oracle DBA, I made a career shift last summer. I hung up the Oracle spurs (and that sweet Oracle Ace vest) and threw on a pair of PostgreSQL chaps. I had always been a fan and very casual user of PostgreSQL for many years, even gently lobbying the folks at Pythian to add PostgreSQL DBA services to their offering (to no avail).

I'm taking this fresh start to also jump-start my blogging, hoping to write about interesting notes as I dive deeper in the PostgreSQL world (and even some Hadoop as I get into that). I'm just over 6 months into my new adventure and loving it. I'm excited to be dealing a lot more with an open source community, and interacting daily with some contributors via Slack.

Over the past 6 months, I've compiled a list of topics to write about. If I can remember the details or find my notes, I'll hopefully be writing regularly on these topics!

So, I hope to see more of you regularly here. Stay tuned!
Categories: DBA Blogs

Collaborate 2018 Workshops

Jim Marion - Fri, 2018-02-09 13:16

I will be delivering two workshops at Collaborate 2018:

  • Creating Fluid Pages // Sunday, April 22, 2018 // 12:30 PM - 4:00 PM // Through hands-on activities, students will gain experience and confidence building Fluid pages. Activities include building a Fluid page using the standard and two-column layouts, using delivered class names for layout, using PeopleCode to initialize the layout, and much more. Because this is a hands-on training class, bring your laptop to participate in exercises. This course is designed for Functional Business Analysts as well as Developers.
  • Using Fluid to Build Better-than-breadcrumb Navigation // Thursday, April 26, 2018 // 8:30 AM - 12:00 PM // The most common reason organizations retain Classic instead of migrating to Fluid is navigation. Users love their Classic breadcrumbs and do not appreciate the Navbar. Through hands-on activities, students will learn how to build next-generation navigation that rivals breadcrumbs. This is a hands-on training session, so bring your laptop to participate in exercises. This course is for subject matter experts, functional business analysts, developers, and administrators.

These are hands-on workshops. Please be sure to add these workshops to your registration when you register for Collaborate. If you are already registered, you may want to revisit your registration to add these workshops. A full list of workshops and workshop details is available on the Quest PeopleSoft Workshop page.

I look forward to seeing you in April!

Weblogic 12c + SAML2: publish your metadata over an URL

Darwin IT - Fri, 2018-02-09 13:09
This week I got to do a SAML2 implementation again for APEX against ADFS. Actually the same setup as last year. One pitfall I fell into with open eyes, was the Redirect URI on the 'Web SSO Partner Provider'. I entered /ords/f*, but it had to be with out the wild-card: /ords/f. But that aside.

At one step in the setup of a SAML2 configuration is that you have to publish the metadata, by clicking a button. Some SAML2 capabable middleware solutions can publish the metadata over an URL. ADFS does support a URL to get the metadata from the Service Provider, being Weblogic12c servicing your application. This prevents that you need to hand over the xml file every time you change/update your configuration. For instance because of expired certificates. How nice would it be if Weblogic supported this?

Well, actually, you can! Sort of... Weblogic does support to service a document-folder, like the htdocs folder of Apache. To do so, you need to create a war file, with only a weblogic.xml file that couples a context-root to a certain folder. And apparently Glassfish can do so too!

When you install ORDS on Weblogic, following the steps, you generate an i.war that is actually the example for this post. You could extract that file and adapt it for this purpose. But I wanted to be able to generate it. Doing so I could reuse this for several other purposes if I would need to.

So I started with a new Saml2MetaData project folder and created a src folder, with a WEB-INF folder beneath it.
Then I copied the three deployment descriptors:
  • sun-web.xml
  • web.xml
  • weblogic.xml
 The sun-web.xml (not being the travel company):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD GlassFish Application Server 3.0 Servlet 3.0//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_3_0-0.dtd">
<sun-web-app>
<!-- This element specifies the context path the static resources are served from -->
<context-root>${samlMetaData.contextRoot}</context-root>
<!-- This element specifies the location on disk where the static resources are located -->
<property name="alternatedocroot_1" value="from=/* dir=${samlMetaData.home}"/>
</sun-web-app>

As you can see I placed the ${samlMetaData.contextRoot} the property in the context-root-tag and the property named alternatedocroot_1 got the directory reference containing the ${samlMetaData.home}.

The web.xml is there for completeness, but does not contain a directory reference:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
<web-app>
<!-- This Web-App leverages the alternate doc-root functionality in WebLogic and GlassFish to serve static content
For WebLogic refer to the weblogic.xml file in this folder
For GlassFish refer to the sun-web.xml file in this folder
-->
</web-app>

And then the weblogic.xml: including the same properties referencing the context-root and folder:
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
<!-- This element specifies the context path the static resources are served from -->
<context-root>${samlMetaData.contextRoot}</context-root>
<virtual-directory-mapping>
<!-- This element specifies the location on disk where the static resources are located -->
<local-path>${samlMetaData.home}</local-path>
<url-pattern>/*</url-pattern>
</virtual-directory-mapping>
</weblogic-web-app>

Then I need an ANT build file that copies these files replacing the properties. I would have done it with WLST if I had found a way to wrap the lot into a war file, that quickly. But ANT does the job well. First I need a build.properties file, that denotes the properties values:
build.dir=${basedir}/build
dist.dir=${basedir}/dist
src.dir=${basedir}/src
samlMetaData.home=c:\\certs\\saml2
samlMetaData.contextRoot=/samlMetaData


And then the ANT build.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<project name="SamlMetaData" basedir="." default="build">
<property file="build.properties" />
<!-- Clean & Init -->
<target name="clean">
<echo>Delete build and dist folder</echo>
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
</target>
<target name="init" depends="clean">
<echo>Create build and dist folder</echo>
<mkdir dir="${build.dir}" />
<mkdir dir="${dist.dir}" />
</target>
<!-- war the project -->
<target name="war">
<property name="war.dir" value="${dist.dir}/${ant.project.name}" />
<property name="war.file" value="${war.dir}/${ant.project.name}.war" />
<echo>Create war file ${war.file} from ${build.dir}</echo>
<mkdir dir="${war.dir}" />
<jar destfile="${war.file}" basedir="${build.dir}">
<manifest />
</jar>
</target>
<!-- Build the war file -->
<target name="build" depends="init">
<echo>Copy ${src.dir} to ${build.dir}, expanding properties</echo>
<copy todir="${build.dir}">
<fileset dir="${src.dir}" />
<filterchain>
<expandproperties />
</filterchain>
</copy>
<ant target="war" />
</target>
</project>

Run this with ANT andit will create a build and a dist  folder with the war file.
This can be deployed to Weblogic that results in a context root as configured in the build.properties. Everything placed in the folder as configured in the samlMetaData.home folder can be fetched through Weblogic.

So just publish your metadata to that folder and the IdentityProvider can get it auto-magically.

Forms & Reports Developer 10g Requires Windows 7

Steven Chan - Fri, 2018-02-09 12:02

Forms & Reports Developer 10g (10.1.2.3) is required to maintain customizations in EBS 12.1 and 12.2. We previously announced certifications for Windows 10 (32-bit and 64-bit) and Windows 8.1 (32-bit and 64-bit) clients for Forms & Reports Developer 10g.

Since those certifications were announced, we have identified issues that prevent us from delivering fixes for those configurations. Unfortunately, we must rescind those certifications.

EBS 12.1 and 12.2 system administrators must retain a Windows 7 (32-bit) PC to maintain customizations using Forms & Reports Developer 10g (10.1.2.3).

References

Categories: APPS Blogs

instance,Database&DB Components.

Tom Kyte - Fri, 2018-02-09 10:26
Hi, I know the difference between Instance and Database. but i have few doubts about version of Instance and Data Base. 1). Can the versions be different for Instance and Database or they must have same version. 2). i did not understand what ar...
Categories: DBA Blogs

EXTPROC querying Oracle User

Tom Kyte - Fri, 2018-02-09 10:26
I've been using EXTPROC functions for a while but recently came across a use case that requires one to determine if the EXTPROC call should have access to external resources based on who the calling Oracle user is. The first thing that comes to mi...
Categories: DBA Blogs

expdp command subquery

Tom Kyte - Fri, 2018-02-09 10:26
Good Morning..!! Q: I've come up with a requirement where I will need to do table export where status ='YES'. My requirement is to get this WHERE clause from input table into variable and put it at expdp command in shell script Ex: SELECT...
Categories: DBA Blogs

Does a 10g oracle client work with 12.2c server?

Tom Kyte - Fri, 2018-02-09 10:26
Does a 10g oracle client work with 12.2c server?
Categories: DBA Blogs

How to install the Notepad++ 64-bit plugin manager

Darwin IT - Fri, 2018-02-09 06:08
I'm a Notepad++ fan for years. And as soon as a 64-bit version arose I adopted it.
But since a few months I have a new laptop, and I apparently didn't get the plugin manager with the latest new install.  And only now I took the opportunity to sort it out and write about it.

I found that the plugin manager is available since April 2017 on GitHub, version 1.49. I downloaded the zip from the mentioned location, I choose the _x64 version:
Then unzipped it into my Notepad++ folder:

Then started Notepad++ and the plugin manager appears:

So now I can format my XML files again...

Table Level Privileges for Read Only Access

Tom Kyte - Thu, 2018-02-08 16:06
Hi, I have new DB installed and configured by sys user. then i will execute following script to create new schema identified by CS4 <i>create user cs4 identified by cs4; grant connect to cs4; grant create session to cs4; grant dba to cs4;...
Categories: DBA Blogs

Issues with a query returning occasionally a ORA-00932: inconsistent datatypes: expected - got -

Tom Kyte - Thu, 2018-02-08 16:06
Dear Tom-successors, I have a problem which I cannot track down as it seems to happen randomly. First of all, I'm using: <code>Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production PL/SQL Release 11.2.0.4.0 - Production...
Categories: DBA Blogs

Best Practice to convert 400 million rows table with 3 TB of CLOB to partition table

Tom Kyte - Thu, 2018-02-08 16:06
Hi, I am converting a non-partitioned table to Partitioned(range or Ref). For test scenario, I have a table with 50 GB data (300 million rows) and 100 GB CLOB column data. I tested below options and timings are not as per my satisfaction level. 1. ...
Categories: DBA Blogs

Pages

Subscribe to Oracle FAQ aggregator