Problems with Connection validation when provisioning an Oracle Java Cloud Service-Virtual Image instance with Oracle Database Cloud Service 12.1 VI

A connection validation error may occur when you attempt to provision an Oracle Java Cloud Service —Virtual Image instance with Oracle Database Cloud Service—Virtual Image 12.1.

Provisioning fails and gives this error message:

Could not connect to Database Cloud Service. Error Details: [No match found]

This error occurs because the database deployment has been created without a domain name.

To work around this issue:
  1. Log on to the database deployment’s VM:
    ssh -i <private-key> opc@ip-address-of-db-vm
  2. Change to user oracle.
    sudo -s -u oracle
  3. Connect to the PDB as sysdba.
    $ORACLE_HOME/bin/sqlplus sys/<password>@"<host>:<port>/<pdb name> as sysdba
  4. Create a service using a domain name.
    exec dbms_service.create_service('<pdb name>.<domain name>', '<pdb name>.<domain name>');

    For example, the domain name could be:

    <identity domain>.oraclecloud.internal
  5. Start the service.
    exec dbms_service.start_service('<pdb name>.<domain name>');
  6. Using the Oracle Java Cloud Service provisioning wizard to provision an instance, enter a connect string.

    For example:

    1521/<pdb name>.<domain name>
  7. Continue to provision the Oracle Java Cloud Service instance.