Sofbang Tech Team Tips Series: Configuring Database Cloud (DbaaS) with Java Cloud for Application Deployment

In this post of Tech Team Tips Series, I am going to show how to migrate existing ADF web application deployed on-premise WebLogic 12c to Oracle Java Cloud Service.

I will use an existing WebLogic 12c ADF sample web application for migration. Before deploying the application, it is essential to configure these important steps:

Create Schema in Database Cloud (DbaaS)

Configure Data source in JCS

I encountered few slips while configuring these pre-requisites at first time. The following is what I encountered and how you can avoid and/or troubleshoot these slips:

1. Schema Creation through SQL Developer:

a. The “ORA–65096” error:

SQL Error: ORA–65096: invalid common user or role name

The Cause: An attempt was made to create a common user or role with a name that was not valid for common users or roles. In addition to the usual rules for user and role names, common user and role names must start with C## or c## and consist only of ASCII characters.

b. The “ORA–6048” error:

 SQL Error: ORA–65048: error encountered when processing the current DDL statement in pluggable database PDB1
 ORA–01955: DEFAULT ROLE ‘CONNECT’ not granted to user
 65048.00000 - “error encountered when processing the current DDL statement in pluggable database %s”

The Cause: An error was encountered when executing a statement in one of the pluggable databases.

2. JNDI Creation Error from JCS WebLogic console.
a. Connection test failed. Error ORA–01045.

Error ORA–01045: User C##TEST lacks CREATE SESSION privilege; logon denied
 oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:466)
 oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)
 oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:391)

b. Connection test failed. Error ORA–01017:

Error ORA–01017: invalid username/password; logon denied
 oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:466)
 oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)
 oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:391)

Don’t worry about these errors, just follow the steps below to configure your cloud environment properly for smooth running.

Create Schema in Database Cloud (DbaaS)

To avoid these Database permission and privileges errors, create your schema from the Database EM console instead of SQL Developer. The EM console automatically handles the schema creation and synchronization for CDB (Container Database) and associated PDB (Pluggable Databases) for your database instance.

Here’s how:

  1. Login to your Database Cloud instance
  2. Open the DbaaS dashboard click the Hamburger Icon and select Open EM console.
    Picture1
  3. Login as system or SYS user.
  4. Click Security and select Users.
    Picture2
  5. Click Create Users.
  6. Enter user details and click  icon.
    Picture3
  7. Leave Tablespaces to default settings and click.
    Picture4
  8. Select the Connect, Resource Roles and Unlimited Tablespace Privilege. Click next.
    Picture5
    The Tablespace privilege is required to create tables & to execute DML statements.
  9. Click OK to create user.
    Picture6
  10. Import you existing schema objects to the DbaaS schema. Importing of schema is not scope of this post.

Configure Data source in JCS

  1. Login to your Java Cloud Service instance.
  2. Click the Hamburger Icon and select Open WebLogic Server Console.
    Picture7
  3. Enter your login details with administrative privileges.
  4. Select Data Sources from the Services section to the open data sources.
    Picture8
  5. Click Lock & Edit to activate the new data source button.
    Picture9
  6. Click New & Select Generic Data Source.
    Picture10
  7. Enter your desired data source details and click Next.
    Picture11
  8. Select driver and click Next. You must select Oracle Driver (Thin) for instance connection; Versions: Any driver if you are going to use it with your ADF web application.
    Picture12
  9. Keep default settings and Click next.
  10. Enter Database details.
    Picture13
  11. Use DbaaS EM console to get the DB Name & Host Name.
    i. Login to DbaaS EM console with System User.
    ii. From the Status section you can easily get your DB Name & Host Name
    Picture14
    iii. Extract and fill following details and click NextEnter Database details.
    1. Database Name: DEV (case sensitive). Never use you Container Name i.e. PDB1 in most of the cases.
    2. Host Name: db1 (case sensitive)
    3. User Name: Your schema name
    4. Password: Your password
  12. Test Configuration
    Picture15
  13. Click Test Configuration. “Connection test succeeded.” A message will be displayed if your connection is successful. Click Next.
  14. Select Data Source Target Server.
    Picture16
  15. Select Finish
  16. Select Activate Changes from change center.

 

That’s it! Now you’re ready to deploy you application to JCS.

Deploy your application

Now that you are set to deploy your application to Java Cloud instance, you should familiarize with the deployment steps. There are many ways to deploy applications to WebLogic. In this example I simply used the WebLogic console to deploy my application. You can choose any method according to your preference.
I suggest following these simple steps to deploy an application to Java Cloud using WebLogic console

  1. Login to you Java Cloud Service Dashboard
  2. Click the Hamburger Icon and select Open WebLogic Server Console
    Picture7
  3. Enter login details with administrative privileges.
  4. Select Deployments under Domain Structure to open the Deployments Home.
  5. Click Lock & Edit to enable the install option for deployments and click Install.
  6. Click the Upload Your File link from Install Application assistance to upload your Ear/War file.
  7. Browse for your application.
    Picture20
  8. Select the Ear/War file that you want to deploy and click Next.
    Picture21
  9. Keep default settings and click Next.
  10. Select Deployment Targets and click Next.
  11. Keep default settings and click Next.
  12. Keep default settings and click Finish.
  13. Click Activate Changes to activate your application deployment changes.
  14. Make sure your application is deployed and in Active state to service the requests.
    Picture22

Congratulations! You have migrated your on premise ADF web application to Java Cloud Service.

Leave a Reply

Your email address will not be published. Required fields are marked *


By submitting this form, you are granting: Sofbang, 17 North State Street, Chicago, IL, 60602, permission to email you. You may unsubscribe via the link found at the bottom of every email. (See our Email Privacy Policy (http://constantcontact.com/legal/privacy-statement) for details.) Emails are serviced by Constant Contact.