Saturday, September 24, 2016

SOA 12c: Change JVM Heap Size for Integrated WebLogic Server Domain


Follow these steps:

1. Open JDeveloper
2. Go to the Application Servers tab
3. Right click on the IntegratedWebLogicServer -> Properties
4. Go to Lauch Settings tab
5. Click on "More Launch Settings"



6. Click on Environment variables and select  USER_MEM_ARGS.



7. Change the memory size and click on ok.
8. Restart  JDeveloper

You can also directly go to the file system and change memory size

Go to

C:\Users\User\AppData\Roaming\JDeveloper\system12.1.3.0.41.140521.1008\DefaultDomain\bin

and modify  setStartupEnv.cmd file

@REM 64 bit JVM memory settings
    set SERVER_MEM_ARGS_64=-Xms1024m -Xmx2048m
    set SERVER_MEM_ARGS_64HotSpot=-Xms1024m -Xmx2048m -XX:PermSize=512m -XX:MaxPermSize=1024m
    set SERVER_MEM_ARGS_64JRockit=-Xms1024m -Xmx2048m


Start the IntegratedWeblogicDomain and see the new values.

Friday, September 23, 2016

OSB 12C - Lookup DVM definition in another project



In OSB 12C we can perform DVM definition look-up into another OSB project using dvm:lookup function.

dvm:lookup function returns a string by looking up the value for the target column in a domain value map, where the source column contains the given source value.

dvm:lookup(dvm-location, src-column, src-value, target-column, default-value)


For DVM look-up  use following format

<Project_Name>/DVM/<DVM_FileName.dvm>

E.g.

OSBPrj1/DVM/country.dvm


In look-up function use

dvm:lookup("OSBPrj1/DVM/country.dvm", "xxx", "xxx", "xxx", "xxx")


Tuesday, September 20, 2016

SOA/OSB 12C - Install Oracle Cloud Adapters on SOA/OSB 12.1.3.0.3 (BP3)


When JDeveloper 12.1.3 is installed, the Sales force adapter is already available by default but the other cloud adapters like Sales Cloud, Right Now, HCM Cloud, Oracle Eloqua Cloud Service etc.  need to be installed separately.

12.1.3.0.3 BP3 is the latest release supported with the Oracle Cloud Adapters, though there are later Bundle Patch releases available.

A . Steps to follow if you have not installed cloud adapter 12.1.3 before


 1)   Download CloudAdapter Pack from OTN site: http://www.oracle.com/technetwork/middleware/adapters/downloads/index.html

        >   Oracle Cloud Adapters 12.1.3.0.1 Size: 11.35 MB, Check Sum: 4133412259 11905615
        >   Filename: fmw_12.1.3.0.1_cloud_adapters_Disk1_1of1.zip


  2)   Extract Patch 20780464 from "fmw_12.1.3.0.1_cloud_adapters_Disk1_1of1.zip" to 'Patch Top' directory as directed in associated Readme.txt file.

  3)   Download Patch 21473608 from My Oracle Support 'Patches and Updates' tab, and extract to 'Patch top' directory as directed in associated Readme.txt file.

  4)   Shutdown the Domain servers and JDeveloper.

  5)   Install SOA/OSB 12.1.3 BP3 Patch 20900599, if not already installed.

  6)   Install OSB Patch 20780464 from 'Patch Top' directory on top of Patch 20900599 BP3.

  7)   Install Patch 21473608 from 'Patch Top' directory on top of Patch 20900599 BP3.

  8)   Remove (with backup) the JDeveloper system cache directory. (Windows - C:\Users\<user>\AppData\Roaming\JDeveloper\system.)

  9)   Start Domain servers.

B) Steps to follow if you already have Oracle Cloud Adapters installed with 12.1.3.0.1 BP1

1)Shutdown the Domain servers and JDeveloper.

2) Download and install SOA/OSB 12.1.3 BP3 Patch 20900599.

3) Download and install Patch 21473608 - Cloud Adapter Pack SOA/OSB for 12.1.3.0.0 SOA BP3

4) Remove the JDeveloper system cache directory. (Windows- C:\Users\<user>\AppData\Roaming\JDeveloper\system.)

5) Start Domain servers.

You will see the following sections when you are building SOA or OSB applications



NOTE : Always read the patch README files and follow the steps.




  

Wednesday, September 14, 2016

Oracle OSB 12C : Create OSB 12C domain using WLST

Please use the below steps to create an OSB 12c Domain using a WLST script.


1. OSB 12c uses the database as the OPSS store (Mandatory).  Please run RCU before creating an OSB domain. RCU is located under MW_HOME/oracle_common/bin folder.


2. Select the Schema(s) required for the OSB domain




 3.  Once the required schemas are created, use following script and make changes according to your environment and run it to create the OSB 12c Domain.

#=======================================================================================
# This script create OSB 12C domain 
#
# Usage: 
#      MW_HOME/oracle_common/common/bin/wlst.sh <WLST_script> 
#
# Where: 
#      MW_HOME is MW home location.
#      <WLST_script> specifies the full path to the WLST script.
#=======================================================================================

#Database Configuration Properties
OSB_REPOS_DBURL = 'jdbc:oracle:thin:@ragav-pc790:1521/ragav'
OSB_REPOS_DB_PASSWORD = 'weblogic123'
OSB_REPOS_DBUSER_PREFIX = 'SOAGT'

#Admin Server Configuration properties
ADMIN_SERVER_HOST = 'ragav-pc7010'
ADMIN_SERVER_PORT = 7001

#SOA Server Configuration properties
OSB_SERVER_HOST = 'ragav-pc7010'
OSB_SERVER_PORT = 8001


#Folder Locations 
MW_HOME = '/ragav/SOA/SOA12CF'
DOMAIN_HOME = '/ragav/SOA/SOA12CF/user_projects/domains/OSB_Domain_WLST'


def changeDatasourceToXA(datasource):
  print '>>>>>>> Change datasource '+datasource
  cd('/')
  cd('/JDBCSystemResource/'+datasource+'/JdbcResource/'+datasource+'/JDBCDriverParams/NO_NAME_0')
  set('DriverName','oracle.jdbc.xa.client.OracleXADataSource')
  set('UseXADataSourceInterface','True') 
  cd('/JDBCSystemResource/'+datasource+'/JdbcResource/'+datasource+'/JDBCDataSourceParams/NO_NAME_0')
  set('GlobalTransactionsProtocol','TwoPhaseCommit')
  cd('/')

#=======================================================================================
# Open a domain template.
#=======================================================================================

readTemplate(MW_HOME+'/wlserver/common/templates/wls/wls.jar')

#=======================================================================================
# Configure the Administration Server and SSL port.
#
#=======================================================================================

cd('Servers/AdminServer')
set('ListenAddress', ADMIN_SERVER_HOST)
set('ListenPort', ADMIN_SERVER_PORT)

#=======================================================================================
# Define the user password for weblogic.
#=======================================================================================

cd('/')
cd('Security/base_domain/User/weblogic')
cmo.setPassword('welcome1')

#=======================================================================================
# Write the domain and close the domain template.
#=======================================================================================

setOption('OverwriteDomain', 'true')

#Creating default coherence cluster
create('defaultCoherenceCluster', 'CoherenceClusterSystemResource')

cd('/')
create('osb_server1', 'Server')
cd('Server/osb_server1')
set('ListenPort', OSB_SERVER_PORT) 
set('ListenAddress', OSB_SERVER_HOST)
set('CoherenceClusterSystemResource', 'defaultCoherenceCluster')

#assigning target for default coherence cluster
cd('/')
assign('Server','osb_server1','CoherenceClusterSystemResource','defaultCoherenceCluster')

cd('/CoherenceClusterSystemResource/defaultCoherenceCluster')
set('Target', 'osb_server1')

print ">>>>>>> Creating WLS Domain"

writeDomain(DOMAIN_HOME)

closeTemplate()


#=======================================================================================
# Exit WLST.
#=======================================================================================

print ">>>>>>> Extending the domain for OSB"
readDomain(DOMAIN_HOME)

print ">>>>>>> Adding Webservice Template"
addTemplate(MW_HOME+'/oracle_common/common/templates/wls/oracle.wls-webservice-template_12.1.3.jar')

print ">>>>>>> Adding OSB Template"
addTemplate(MW_HOME+'/osb/common/templates/wls/oracle.osb_template_12.1.3.jar')

print '>>>>>>> Datasources Change Start'
print '>>>>>>> Change datasource LocalScvTblDataSource'

cd('/JDBCSystemResource/LocalSvcTblDataSource/JdbcResource/LocalSvcTblDataSource/JDBCDriverParams/NO_NAME_0')
set('URL',OSB_REPOS_DBURL)
cmo.setPasswordEncrypted(OSB_REPOS_DB_PASSWORD)
cd('Properties/NO_NAME_0/Property/user')
set('Value',OSB_REPOS_DBUSER_PREFIX+'_STB')

print '>>>>>>> Call getDatabaseDefaults to read details from service table'
getDatabaseDefaults()    


changeDatasourceToXA('OraSDPMDataSource')
changeDatasourceToXA('SOADataSource')

print '>>>>>>> Datasources Change End'

print '>>>>>>> Add server groups to AdminServer'
serverGroup = ["WSM-CACHE-SVR" , "WSMPM-MAN-SVR" , "JRF-MAN-SVR"]
setServerGroups('AdminServer', serverGroup)   

print '>>>>>>> Add server group(s) to osb_server1'
serverGroup = ["OSB-MGD-SVRS-COMBINED"]
setServerGroups('osb_server1', serverGroup)    

print '>>>>>>> Update Domain....... Please wait.. takes little time to populate OPSS Schema'
updateDomain()

print '>>>>>>> Update Domain Completed'

closeDomain()

print '>>>>>>> Domain Creation Completed'

exit()

====================================================================


Oracle recommends to create the domain using the Config Wizard. Above  sample script was provided only for reference purposes and for development environments.

Tuesday, September 13, 2016

BPM 12c Error: SQL Server Database Insert Issue

When I was trying to perform insert operation in BPM  (12C) process, i got following exception

Could not invoke operation 'insert' against the 'db' due to: [[
BINDING.JCA-11622
Could not create/access the TopLink Session.
This session is used to connect to the datastore.
Caused by Exception [EclipseLink-7042] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Database platform class [weblogic.jdbc.sqlserver.SQLServerDriver] not found.
Internal Exception: java.lang.ClassCastException: weblogic.jdbc.sqlserver.SQLServerDriver cannot be cast to org.eclipse.persistence.internal.databaseaccess.Platform.
You may need to configure the connection settings in the deployment descriptor (i.e. DbAdapter.rar#META-INF/weblogic-ra.xml) and restart the server. This exception is considered not retriable, likely due to a modelling mistake.
]]

The error is followed by an exception with the following stack trace:
java.lang.ClassCastException: weblogic.jdbc.sqlserver.SQLServerDriver cannot be cast to org.eclipse.persistence.internal.databaseaccess.Platform

It was very hard to find out the reason. Even google did not help much. With the help of oracle support we came with following reasons for the error.

1. The DB adapter configuration for the connection pool ( Weblogic console -> Deployments -> DbAdapter -> Configuration ->outbound connection pool has incorrect setting for the platformClassName property.
  Outbound Connection pool) 
for the given co
 Depending on the class set there you may see different  java.lang.ClassCastException source classes

2. There was some  incorrect configuration specified in the weblogic-ra.xml

3. The Plan.xml files were different on different servers.


Solution: 


1. Set the correct platformClassName value for the DB Adapter configuration pool within Weblogic console -> Deployments -> DbAdapter -> Configuration -> Outbound Connection pool -> <Your pool>

For Oracle DB connection the platformClassName should have the org.eclipse.persistence.platform.database.Oracle10Platform and for Microsoft SQL server it should have org.eclipse.persistence.platform.database.SQLServerPlatform

Notice that the class is always in the org.eclipse.persistence.platform.database package and extends the org.eclipse.persistence.platform.database.Platform class


2. Please refer to the documentation: https://docs.oracle.com/cd/E24329_01/web.1211/e24971/creating.htm#ADAPT129
 and confirm the weblogic-ra.xml file is correct

3. Please ensure the Plan.xml files are identical in all servers.