Showing posts with label unix. Show all posts
Showing posts with label unix. Show all posts

Sunday, 14 October 2018

SOA 12c : Shell Script to set Environment variables

This is what you you should do if you want to use a shell script to set your environment variable.

1. Create a .sh file ex: setEnv.sh
2. Edit and add like below:

#!/bin/sh

#*****************************************************************************
# This script is used to set up your environment for development with WebLogic
# Server.  It sets the following variables:
#
# JAVA_HOME    - Location of the version of Java
# ANT_HOME     - Location of the version of ANT
#*****************************************************************************

JAVA_HOME="/jdk/jdk1.8.0_131"
ANT_HOME="/oracle_common/modules/org.apache.ant_1.9.2"

export JAVA_HOME ANT_HOME
echo "Your environment has been set."


3. Edit paths based on you machine/environment.
4. Save
5. Execute the script using the command . ./setEnv.sh

6. Validate by executing the command echo $JAVA_HOME

You can add other variables as required.


Helpful? Please comment.

Happy Learning!!

Tuesday, 10 October 2017

SOA 12c : SunCertPathBuilderException: unable to find valid certification path to requested target

Here is what you should do if you are exposing your SOA or any other service securely and on invocation getting  the below error.

Error- 

javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Message send failed: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Cause-

The reason for the error is that the certificates are not part of the trust store or when a server changed their HTTPS SSL certificate, the older version of Java did not recognize the root certificate authority (CA).

Solution-

1. Access the HTTPS service in the browser. Click on the HTTPS certificate chain (there is lock icon in the Internet Explorer, or the domain name left of the URL in Firefox) and navigate the certificate hierarchy
2. Export the certificates, generally Root, Secure and your certificate.crt to a tmp directory
3. To verify the root certificates, determine where the cacerts file is located. By default it is in jre/lib/security/cacerts under your JDK home
4. Navigate to directory and execute the below command:
  
keytool -list -v keystore ./cacerts


You will be prompted for password, Enter password  and check if the certificates are present inside the file.

5. Assuming that the certificates are called; exampleroot.crt, examplesecure.crt and example.crt type the command below:

keytool -keystore ./cacerts -import -alias exampleroot -file /tmp/exampleroot.crt

6. You will be prompted for password, Enter password. and Respond 'yes' to trust this key.
7. Repeat for remaining certificates.
8. Restart your JVM and test.  

Now you will be able to access/invoke HTTPS URL. 

Note: If you are using custom trust store, make sure that the key-store is  part of the startup parameter of your server.



Helpful? Please Comment.

Happy Learning!!
 

Saturday, 7 October 2017

SOA 12c : Setting up Environment variables on Unix/Windows

Generally before we begin our local installation or execute commands on Windows or Unix/Linux systems we should setup the environment variables so that we do not face any issues.

In this post we will learn how to setup the environment variables.



1.       Windows (one-time activity):
a.       Right click on MyComputer/This PC > Properties
b.       On left pane click on ‘Advanced system settings’
c.       On System Properties pop up click on ‘Advanced’ tab
d.       Click on button ‘Environment Variables’
e.       Under System variables box, click on New
f.        Insert Variable name and Variable values as below





 

g.       Add above variables to ‘Path’ variable by selecting on Path and clicking on Edit
h.       Add  %JAVA_HOME%\bin
i.     Apply and Save.
j.        Open command-prompt, type echo %JAVA_HOME% to validate.

 


1.       Unix/Linux (on every login):
a.       Login to box
b.       Identify dir path for variable
c.       Run command to set environment variable for JAVA_HOME like below

                            export JAVA_HOME=/java/jdk/jdk1.8.0_131
 
d.       Run command echo %JAVA_HOME% to validate

Note: Paths may differ based on how installation has been done.

If you want to set path permanently on Linux box, edit you ~/.profile or ~/.bash_profile and add the export commands.

You can also check the post on How to create a shell script which is easier to execute every time.


Helpful? Please Comment.


Happy Learning!!





OSB 12c : Dynamic Routing to Business/Proxy Service

Dynamic routing is a kind of  Content-based Routing pattern, which is used when the BusinessService/ProxyService path is required to be de...