Feed aggregator

Virtual Workshop - Security Monitoring & Analysis (SMA) - Configuration & Compliance ...

Security Monitoring and Analysis (SMA) and Configuration Compliance Cloud Services @OMC Tuesday, February 20, 2018 ...

We share our skills to maximize your revenue!
Categories: DBA Blogs

Oracle Demonstrates Advances in Autonomous Cloud, Extending Autonomous Capabilities Across Entire Cloud Platform

Oracle Press Releases - Mon, 2018-02-12 07:04
Press Release
Oracle Demonstrates Advances in Autonomous Cloud, Extending Autonomous Capabilities Across Entire Cloud Platform Self-driving services use AI and machine learning to help organizations lower cost, reduce risk, accelerate innovation, and get predictive insights

Oracle CloudWorld, NEW YORK—Feb 12, 2018

Oracle President of Product Development Thomas Kurian demonstrated the latest advances in Oracle Cloud Platform, expanding its Oracle Cloud Platform Autonomous Services beyond the Oracle Autonomous Database, to make all Oracle Cloud Platform services self-driving, self-securing and self-repairing. With its enhanced suite of autonomous Cloud Platform services, Oracle is setting a new industry standard for autonomous cloud capabilities. Oracle is applying AI and machine learning to its entire next-generation Cloud Platform services to help customers lower cost, reduce risk, accelerate innovation, and get predictive insights.

As organizations focus on delivering innovation fast, they want a secure set of comprehensive, integrated cloud services to build new applications and run their most demanding enterprise workloads. Only Oracle’s cloud services can automate key operational functions like tuning, patching, backups and upgrades while running to deliver maximum performance, high availability, and secure enterprise IT systems. In addition, to accelerate innovation and smarter decision making, Oracle Cloud Platform is incorporating additional autonomous capabilities specific to application development, mobile and bots, app and data integration, analytics, security and management. 

“The future of tomorrow’s successful enterprise IT organization is in full end-to-end automation,” said Kurian. “At Oracle, we are making this a reality.We are weaving autonomous capabilities into the fabric of our cloud to help customers safeguard their systems, drive innovation faster, and deliver the ultimate competitive advantage with smarter real-time decisions.”

Oracle’s autonomous capabilities are integral to the entire Oracle Cloud Platform, including the world’s first autonomous database unveiled at Oracle OpenWorld. The Oracle Autonomous Database uses advanced AI and machine learning to eliminate human labor, human error and manual tuning delivering unprecedented availability, high performance and security at a much lower cost. Multiple autonomous database services, each tuned to a specific workload, will be available in 2018, including Oracle Autonomous Data Warehouse Cloud Service for analytics, Oracle Autonomous Database OLTP for transactional and mixed workloads, and Oracle Autonomous NoSQL Database for fast, massive-scale reads and writes.

In addition to the Oracle Autonomous Database, Oracle Cloud Platform autonomous capabilities for application development, mobile and bots, integration, analytics, security and system management, are scheduled to be available in the first half of calendar year 2018. Oracle Cloud Platform services all share foundational autonomous capabilities including:

  • Self-Driving to Lower Costs and Increase Productivity: Eliminate human labor to provision, secure, monitor, backup, recover and troubleshoot. Automatically upgrade and patch itself while running. Instantly grow and shrink compute or storage without downtime.
  • Self-Securing to Lower Risk: Protect from external attacks and malicious internal users. Automatically apply security updates while running to protect against cyberattacks, and automatically encrypt all data.
  • Self-Repairing for Higher Availability: Provide automated protection from all planned and unplanned downtime with up to 99.995 percent availability, resulting in less than 2.5 minutes of downtime per month including planned maintenance.
 

Examples of additional autonomous capabilities being added to functional areas across the rest of the Oracle Cloud Platform include: 

Application Development

  • Automated artifact discovery, dependency management, and policy-based dependency updates increasing code quality and developer productivity
  • Automated identification and remediation of security issues throughout the CI/CD pipeline significantly reducing security risks
  • Automated code generation with single button deployment enabling rapid application development even by line of business users
 

Mobile and Bots

  • Self-learning chatbots observing interaction patterns and preferences to automate frequently performed end-user actions freeing up time for higher productivity tasks
  • Unsupervised, smart bots using machine learning to learn from user conversations enabling fluid, contextual conversations
  • Automated caching of API calls to the nearest data center in real time for lowest latency responses based on end user location
 

Application and Data Integration

  • Self-defining integrations automate business processes across different SaaS and on-premises apps
  • Self-defining data flows with automated data lake and data prep pipeline creation for ingesting data (streaming and batch)
 

Analytics

  • Automated data discovery and preparation
  • Automated analysis for key findings along with visualization and narration delivering quicker real time insights
 

Security and Management

  • Machine learning-driven user and entity behavior analytics to automatically isolate and eliminate suspicious and malicious users
  • Preventative controls to intercept data leaks across structured and unstructured data repositories
  • Unified data repository across log, performance, user experience and configuration data with applied AI/ML, eliminating need to set and manage performance and security monitoring “metadata” such as thresholds, server topology, and configuration drift
 

Oracle today also demonstrated a single Oracle Digital Assistant for users to interact across Oracle’s SaaS and PaaS services including analytics. Oracle Digital Assistant provides centralized connection for the user to converse across the user’s CRM, ERP, HCM, custom applications and business intelligence data and uses AI to intelligently correlate data and automate user behavior. Oracle Digital Assistant capabilities include:

  • Integration to speech-based devices like Amazon Echo (Alexa), Apple Siri, Google Home and Speech, Harman Kardon (Cortana), and Microsoft Cortana
  • Deep neural net based machine learning algorithms to process the message from the voice based devices to understand end user input and take action
  • Intelligent routing to the Bot with the knowledge to process the end user input
  • Deep insights into user behavior, context, preferences and routines that is used by the Oracle Digital Assistant to self-learn to recommend and automate across all data sets on behalf of the user
 

“Platform as a Service has become a critical component of the cloud delivery model to help drive business agility and innovation for enterprises,” said Saurabh Sharma, Principal Analyst, Ovum. “With Oracle revealing its AI and machine learning-based Autonomous PaaS, Oracle is bringing productivity gains, cost reduction and human error reduction to the forefront of enterprises looking for possible ways to drive faster innovation. Oracle Cloud Platform’s autonomous PaaS capabilities will let enterprises scale, back-up, upgrade, diagnose, correct and secure enterprise PaaS cloud services.”

Contact Info
Nicole Maloney
Oracle
+1.650.506.0806
nicole.maloney@oracle.com
Greg Lunsford
Oracle
+1.650.506.6523
greg.lunsford@oracle.com
About Oracle

The Oracle Cloud offers complete SaaS application suites for ERP, HCM and CX, plus best-in-class database Platform as a Service (PaaS) and Infrastructure as a Service (IaaS) from data centers throughout the Americas, Europe and Asia. For more information about Oracle (NYSE:ORCL), please visit us at www.oracle.com.

Trademarks

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Talk to a Press Contact

Nicole Maloney

  • +1.650.506.0806

Greg Lunsford

  • +1.650.506.6523

Oracle Protects Customers with Industry’s Strongest and Most Comprehensive Cloud Guarantee

Oracle Press Releases - Mon, 2018-02-12 07:00
Press Release
Oracle Protects Customers with Industry’s Strongest and Most Comprehensive Cloud Guarantee Only cloud provider offering SLAs for enterprise-grade cloud performance, manageability, and availability

Oracle CloudWorld, NEW YORK—Feb 12, 2018

Oracle today expanded the breadth and depth of its enterprise service level agreements (SLAs), delivering a superior experience for customers and helping enterprises that want to shift critical workloads to the cloud today.  Building on the strength of its recently announced, industry-leading 99.995 percent availability guarantee for Oracle Autonomous Database, Oracle today unveiled the industry’s first end-to-end financially backed cloud warranty for Infrastructure-as-a-Service (IaaS).  With these comprehensive SLAs, Oracle is now the only cloud infrastructure provider offering guaranteed service levels across performance, manageability, and availability: the three key characteristics defining how enterprises measure cloud infrastructure providers.

“No cloud provider in the world can match what Oracle guarantees,” said Thomas Kurian, President of Product Development, Oracle. “Our competitors offer narrow commitments and countless exclusions in fine print while Oracle’s SLAs deliver an industry first: guaranteed performance, manageability and availability in the cloud.”

Enterprise customers require critical business applications to perform at consistent and reliable levels.  For example, they need to know back office applications are not going to bog down as they are trying to close the quarter or doing strategic analysis. In addition, enterprises expect to have the ability to immediately add resources if they need extra compute power for urgent business intelligence or to handle spikes in demand.

Oracle’s new SLAs are an integral part of the company’s strategy to deliver the best cloud infrastructure for enterprise production workloads. These industry-first SLAs provide reassurance to customers that want to shift workloads to the cloud and require not only continual availability, but also consistent performance and the ongoing ability to manage and modify the cloud infrastructure that runs their mission-critical applications and databases. In addition, Oracle plans to extend these SLAs to all of its Oracle Cloud Platform Autonomous Services including those for database, application development, mobile and bots, application and data integration, analytics, security and management.

“Customers expect service level commitments for uptime to mean that their applications are not only available, but manageable and performing as expected, regardless of where that application may be located,” said Al Gillen, GVP, Software Development and Open Source, IDC. “Unfortunately, many cloud SLAs don’t make that broad commitment. Oracle’s revised SLAs provide customers the guarantees they need to allow them to run mission-critical enterprise applications in cloud environments with confidence.”

Under terms of the new performance SLA, Oracle Cloud Infrastructure guarantees it will deliver more than 90 percent of published performance every day in a given month.  If it falls below that level for even as few as 44 minutes a month, customers may claim service credits according to Oracle’s terms of service. By contrast, other vendors offer no guarantees around performance. Their cloud resources can be delivering 1 percent of published performance targets, and the customer must continue to pay full price for the degraded services.  As the only cloud infrastructure provider guaranteeing performance, manageability, and availability within its SLAs, Oracle provides the most protection for customers and meets the needs of enterprises who want to shift critical workloads to the cloud today.

N2N Services is onboarding production customers of Illuminate, their API management platform and cloud integration gateway, to Oracle Cloud Infrastructure. “With prior cloud providers, we had limited leverage when it came to dedicated infrastructure,” said Kiran Kodithala, chief executive officer, N2N Services. “With Oracle Cloud Infrastructure, we not only have the ability to have dedicated bare metal infrastructure, but we also have an end-to-end cloud service guarantee, ensuring we have full access and control over our cloud infrastructure services as well as consistent performance.”

Contact Info
Nicole Maloney
Oracle
+1.650.506.0806
nicole.maloney@oracle.com
Greg Lunsford
Oracle
+1.650.506.6523
greg.lunsford@oracle.com
About Oracle

The Oracle Cloud offers complete SaaS application suites for ERP, HCM and CX, plus best-in-class database Platform as a Service (PaaS) and Infrastructure as a Service (IaaS) from data centers throughout the Americas, Europe and Asia. For more information about Oracle (NYSE:ORCL), please visit us at www.oracle.com.

Trademarks

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Talk to a Press Contact

Nicole Maloney

  • +1.650.506.0806

Greg Lunsford

  • +1.650.506.6523

Oracle Cloud Growth Driving Aggressive Global Expansion

Oracle Press Releases - Mon, 2018-02-12 06:15
Press Release
Oracle Cloud Growth Driving Aggressive Global Expansion Significantly expands its current regional cloud infrastructure footprint to deliver Oracle Cloud services to an increasing number of customers and partners

Oracle CloudWorld, NEW YORK—Feb 12, 2018

Driven by strong customer demand for its cloud services worldwide, Oracle today announced plans to significantly expand its modern cloud infrastructure footprint. The company’s rapid expansion plans include the opening of 12 new datacenter regions and increase the breadth and depth of Oracle Cloud services available across Asia, Europe, and the Americas. With this news, Oracle continues its industry leadership position, delivering a complete and integrated portfolio of cloud services (SaaS, PaaS, and IaaS) and new services in security, Blockchain, and Artificial Intelligence. 

“The future of IT is autonomous. With our expanded, modern data centers, Oracle is uniquely suited to deliver the most autonomous technologies in the world,” said Oracle CEO Mark Hurd. “As we invest, our margins will continue to expand. And with our global datacenter expansion, we are able to help customers lower IT costs, mitigate risks and compete like they never have before.”

The regional expansion of Oracle’s cloud footprint will include locations in Asia including China, India, Japan, Saudi Arabia, Singapore, and South Korea; Europe including Amsterdam and Switzerland; and North America including two in Canada and two new US locations to support U.S. Department of Defense workloads.

Since launching Oracle Cloud, the company has seen an ever-growing set of customers, across the Global 2000, as well as small and medium businesses. Organizations continue to turn to Oracle at record-rates to build, deploy, and extend game-changing applications and run business-critical workloads in a low-latency, highly available, reliable and secure cloud environment. Today, customers in more than 195 countries are running their most demanding applications on Oracle Cloud Platform and Oracle Cloud Infrastructure.

Contact Info
Nicole Maloney
Oracle
+1.650.506.0806
nicole.maloney@oracle.com
Greg Lunsford
Oracle
+1.650.506.6523
greg.lunsford@oracle.com
About Oracle

The Oracle Cloud offers complete SaaS application suites for ERP, HCM and CX, plus best-in-class database Platform as a Service (PaaS) and Infrastructure as a Service (IaaS) from data centers throughout the Americas, Europe and Asia. For more information about Oracle (NYSE:ORCL), please visit us at www.oracle.com.

Trademarks

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Talk to a Press Contact

Nicole Maloney

  • +1.650.506.0806

Greg Lunsford

  • +1.650.506.6523

The curious case of the blank plugin page in OEM13c

Amis Blog - Mon, 2018-02-12 04:05

After an upgrade of Oracle Enterprise Manager from 12.1.0.5 to 13.2, I wanted to deploy  a new version of the plugin oracle.sysman.db. Downloaded the new version and got to the plugin-management page to apply the patch. But all I got was a blank page. Cost me quite a while to figure out what the – almost humiliating – workaround / solution eventually was.

Which page am I talking about:  Setup—> Extensibility –> Plug-ins.

image

And the blank page appears.

image

But.. it could be Microsoft Explorer.

image

Tried it in Firefox:

image

Had no Google Chrome to test it out (working in a Citrix client environment, can’t install stuff ).

Examined the html-page source: there is some content, but nothing is shown. Checked the enablement of Java script (unlikely cause, rest is working.  Put the browsers in compatibility mode (yes it can): didn’t help either.

Googled, searched My Oracle Support and the community, got 1 good hit, no solution.

Took too much time, back to the command-line for deploying my plugin.

So, checked the plugins through EMCLI.

$ ./emcli list_plugins_on_server
OMS name is <server>:4889_Management_Service
Plug-in Name                                 Plugin-id                     Version [revision]


Oracle Database Appliance                    oracle.dba.odba               13.1.1.1.0
Oracle Cloud Framework                       oracle.sysman.cfw             13.2.1.0.0
Oracle Database                              oracle.sysman.db              13.2.1.0.0
Oracle Fusion Middleware                     oracle.sysman.emas            13.2.1.0.0
Systems Infrastructure                       oracle.sysman.si              13.2.1.0.0
Oracle Exadata                               oracle.sysman.xa              13.2.1.0.0

Deployed the plugin by first exporting the config, deploy the plugin, checked the status (requires downtime):

./emctl exportconfig oms -sysman_pwd “Oracle123#” -dir /home/oracle/job
./emcli deploy_plugin_on_server -plugin=”oracle.sysman.db:13.2.2.0.0″ -repo_backup_taken
./emcli get_plugin_deployment_status -plugin=oracle.sysman.db

So, I moved on, but it really bothers me, back to the browser… must be the browser…

And really, astonished is the right word I think: when zooming out (ctrl – scrolling wheel), the following appears:

image

Pulled the bar down, scrolled back to the original format, and voilà:

image

Worked for both browsers. Incredible simple workaround in the end, quite an unexpected feature….

Regardz

 

The post The curious case of the blank plugin page in OEM13c appeared first on AMIS Oracle and Java Blog.

Oracle Cloud Infrastructure services and third-party backup tools (CloudBerry)

Syed Jaffar - Mon, 2018-02-12 02:46
As part of the Cloud Infrastructure services, Oracle offers below persistent I/O intensive block storage and high-throughput storage options, which is manageable through the console and by CLI:

  • Oracle Cloud Infrastructure Block Volumes
  • Oracle Cloud Infrastructure Object Storage
  • Oracle Cloud Infrastructure Archive Storage
  • Oracle Cloud Infrastructure File Storage
  • Oracle Cloud Infrastructure Data Transfer Service
 To understand the details, features, pricing and etc, visit the URL below:
 https://cloud.oracle.com/en_US/infrastructure/storage

One of the customers was struggling to delete the backup data from the Oracle Cloud to avoid the charges. Oracle support requested to use the CloudBerry tools for easy management. Below is the excerpt from the CloudBerry website :

"With CloudBerry Backup you can use Oracle Storage Cloud Service as a cost-effective, remote backup solution for your enterprise data and applications. By backing up your data and applications to Oracle Storage Cloud Service, you can avoid large capital and operating expenditures in acquiring and maintaining storage hardware. By automating your backup routine to run at scheduled intervals, you can further reduce the operating cost of running your backup process. In the event of a disaster at your site, the data is safe in a remote location, and you can restore it quickly to your production systems"

CloudBerry offers below Oracle tools :
  • CloudBerry Explorer
  • CloudBerry Backup
  • CloudBerry Managed Backup
  • CloudBerry Drive
 Visit their website to explore more about these tools:

https://www.cloudberrylab.com/solutions/oracle-cloud

We then used CloudBerry Backup tool (15 days free trail) to move the backup files from the Oracle cloud storage and removed it from the cloud.

You may download the 15 days free trail and give a try.




Oracle Utilities Customer To Meter V2.6.0.1.0 is now available

Anthony Shorten - Sun, 2018-02-11 21:19

With the release of Oracle Utilities Customer Care and Billing V2.6.0.1.0, the Oracle Utilities Customer To Meter product has also been updated to V2.6.0.1.0. This release is now available from Oracle Software Delivery Cloud.

The release notes available from those download sites contains a full list of new, updated and deprecated functionality available for Oracle Utilities Customer To Meter V2.6.0.1.0 and Oracle Utilities Application Framework V4.3.0.5.0. Please refer to these documents for details.

The documentation also covers upgrading from previous versions of Oracle Utilities Customer Care And Billing as well as Oracle Utilities Customer To Meter V2.6.0.0.0.

public-yum.oracle.com / yum.oracle.com now support https

Wim Coekaerts - Sun, 2018-02-11 13:06

Might have taken us a while but you can now use https in your .repo files to connect to our yum repositories.

We will transition the repo files we ship over time but we don't want to break people that have customizations.

So in the meantime, if you have repo files in /etc/yum.repos.d that point to http://yum.oracle.com or http://public-yum.oracle.com you can just do a search/replace.

Something like:

sed 's/http:\/\/public-yum.oracle.com/https:\/\/public-yum.oracle.com/g; s/http:\/\/yum.oracle.com/https:\/\/yum.oracle.com/g' public-yum-ol7.repo > public-yum-ol7.repo.new

and then replace the repo file.

Goldengate REPORTING

Michael Dinh - Sun, 2018-02-11 08:52

There were performance issues due to a new table being introduced to replication and I was asked to gather number of DMLs on table for 1 day.

Using DBA_TAB_MODIFICATIONS did not meet the requirements since statistics were gather about a week ago and over inflated.

Next thought process was why not use Goldengate since it captures all the changes and report on it.

This may or may not provide the required data if reporting is not properly configured.

Some will tell you to never rollover the report while others will rollover the report on a weekly basis.

From most recent experience, I would rollover report on daily basis because data can always be aggregated.

Here is an example of what I had to deal with.

$ grep -i report dirprm/e_hawk.prm

REPORTCOUNT EVERY 10 MINUTES, RATE

$ grep “activity since” dirtpt/E*.rpt|sort

E_HAWK0.rpt:Report at 2018-02-09 12:28:49 (activity since 2018-02-08 22:01:15)
--- How are you going to get daily activities accurately from aggregation over 2 months time frame?
E_HAWK1.rpt:Report at 2018-02-08 21:48:37 (activity since 2017-11-27 18:24:26)

Corresponding data from the report.
$ grep -A5 “From Table SCOTT.RATETEST” dirrpt/E_*rpt

E_HAWK0.rpt:Report at 2018-02-09 12:28:49 (activity since 2018-02-08 22:01:15)
dirrpt/E_HAWK0.rpt:From Table SCOTT.RATETEST:
dirrpt/E_HAWK0.rpt-       #                   inserts:       977
dirrpt/E_HAWK0.rpt-       #                   updates:  10439912
dirrpt/E_HAWK0.rpt-       #                   befores:  10439912
dirrpt/E_HAWK0.rpt-       #                   deletes:         0
dirrpt/E_HAWK0.rpt-       #                  discards:         0
--
E_HAWK1.rpt:Report at 2018-02-08 21:48:37 (activity since 2017-11-27 18:24:26)
dirrpt/E_HAWK1.rpt:From Table SCOTT.RATETEST:
dirrpt/E_HAWK1.rpt-       #                   inserts:     87063
dirrpt/E_HAWK1.rpt-       #                   updates: 821912582
dirrpt/E_HAWK1.rpt-       #                   befores: 821912582
dirrpt/E_HAWK1.rpt-       #                   deletes:         0
dirrpt/E_HAWK1.rpt-       #                  discards:         0

How did I end up getting the data?

From Goldengate report above which is better as it provides the exact data processed by Goldengate.

I was lucky! Extract was restarted when table was added and removed.

Example of Better Configuration:

global_ggenv.inc

STATOPTIONS RESETREPORTSTATS
REPORT AT 00:01
REPORTROLLOVER AT 00:01
REPORTCOUNT EVERY 60 MINUTES, RATE
DISCARDROLLOVER AT 00:01

e_hawk.prm
EXTRACT E_HAWK

EXTRACT e_hawk
EXTTRAIL ./dirdat/bb
-- CHECKPARAMS
INCLUDE ./dirprm/global_macro.inc
INCLUDE ./dirprm/global_dbenv.inc
INCLUDE ./dirprm/global_ggenv.inc
Reference:

REPORTROLLOVER

Use the REPORTROLLOVER parameter to force report files to age on a regular schedule, instead of when a process starts. 
For long or continuous runs, setting an aging schedule controls the size of the active report file and provides a more predictable set of archives that can be included in your archiving routine.
Report statistics are carried over from one report to the other. To reset the statistics in the new report, use the STATOPTIONS parameter with the RESETREPORTSTATS option.

DBA_TAB_MODIFICATIONS

INSERTS/UPDATES/DELETES - Approximate number since the last time statistics were gathered.

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.

Pages

Subscribe to Oracle FAQ aggregator