Wednesday, October 21, 2015

How to improve Jdev performance and resolve running Local Jdev in debug mode

I have recently seen an issue while running complex ADF application locally in debug mode, and Jdev performs very very slow to edit single line of code in AMImpl or .jsff file which are having more than 4k Lines of code.


Fix :

- Download JDK 64 bit if your operating system is 64bit
1. Install the Jrockit using below link

        http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-jrockit-2192437.html

2. Modify theC:\Users\xxx\AppData\Roaming\JDeveloper\system11.1.1.7.40.64.93\DefaultDomain\bin\setDomainEnv.cmd file with below changes

set USER_MEM_ARGS=-Xms64m -Xmx2048m -XX:MaxPermSize=1024m
set JAVA_VENDOR=Oracle

set BEA_JAVA_HOME=C:\Program Files\Java\jrockit-jdk1.6.0_45


3. Add below in jdev.conf file

         AddVMOption  -XX:MaxPermSize=1024M


Below article clearly explains the difference b/w having standard JDK vs Jrockit JDK

http://blog.dbi-services.com/a-comparison-of-java-virtual-machines-hotspot-jvm-vs-jrockit-jvm/

Monday, September 28, 2015

How to see the DB Queries executed in Database

It is very common requirement to see what are all the queries are being executed in database,


Step 1 - Execute the below query, In below example, I want to see what are all the queries are being executed on EMPLOYEE table.

select to_char(LAST_ACTIVE_TIME,'dd-mon-yyyy hh24:mi:ss'),last_load_time,sql_id,sql_text
    from v$sql where upper(sql_text) like '%EMPLOYEE%' order by 1 desc;

Step 2 - Look for most recent 'Last_Load_Time' time in the search results

Step 3 - Get the corresponding result row associated 'sql_id' value from above step and supply to below query

                select sql_fulltext from v$sql where sql_id='&name';

Step4 - Supply the sql_id to below query to see the bind variables

                  select name, value_string from v$sql_bind_capture where sql_id = '&sql_id'

Wednesday, June 17, 2015

How to Improve JDeveloper Performance



Identify jdev.conf file in $JDEV_HOME/jdeveloper/jdev/bin ( Eg : C:\Oracle\Middleware\jdeveloper\jdev\bin)

Append below content to jdev.conf file, Save and restart the Jdeveloper

AddVMOption -XX:+AggressiveOpts
AddVMOption -XX:+UseStringCache
AddVMOption -XX:+OptimizeStringConcat

#
# only since Java 6 update 21 performance release
# reduces memory consumption
#
#AddVMOption -XX:+UseCompressedStrings
AddVMOption -XX:+ScavengeBeforeFullGC

#
# only for multi-core machines
#
AddVMOption -XX:+UseConcMarkSweepGC
AddVMOption -XX:+UseGCOverheadLimit

#
# works only on 64-bit JVM
# dramatically reduces memory consumption
# by reducing memory addressing length overhead
#
#AddVMOption -XX:+UseCompressedOops

Thursday, May 14, 2015

Weblogic Learning Notes



Path for 'setDomainEnv.sh'

/boxName/admin/wcp_domain/aserver/wcp_domain/bin

Thursday, March 5, 2015

Thursday, January 15, 2015

How to Manage Metadata Partitions using Fusion Middleware Controle

What is Metadata ?

A metadata repository contains metadata for Oracle Fusion Middleware components, such as Oracle BPEL Process Manager, Oracle B2B, and Oracle WebCenter Portal. It can also contain metadata about the configuration of Oracle Fusion Middleware and metadata for your applications.


How to see existing Metadata Repositories and delete them if needed?

- Login to Fusion Middleware Control ( EM Console)
- On Left hand side Menu, Expand 'Metadata Repositories'
- Select your metadata data source
-  Here you can see all the existing Metadata partitions, You can delete them if wanted, It is always best practice to have only one existing MDS Partition always, and remove all the unwanted one's to have more space available.
- You can also see Metadata labels as well.

Tuesday, January 6, 2015

Weblogic Server Workshop Assignments


This blog outlines some of the workshop assignments part of Webogic Server Administration


- Install Weblogic server on Windows Machine and Linux Machine.

- Create a domain name called 'fm_domain'

- Create a Managed Server called 'FMADFServer1'

- Create a Managed Server called 'FMADFServer2'

-  Write a WLST Script to create a Managed Server called 'FMADFServer3'

-  Upgrade the 'fm_domain' to have installed 'Oracle Enterprise Manager'

- Create a Cluster called 'FMADFCluster1'

- Create a Cluster called 'FMADFCluster2' using WLST Script

- Stop and Start 'FMADFServer1' using WLST Script

- Stop and Start 'FMADFServer2' using WLS Console

- Provide a WLST Script to have all the required AD libraries deployed to 'FMADFServer3'

- Create a JDBC Data Source called 'FMRecruitDS' pointing to Oracle Database and target to 'FMADFCluster1 and '2'

- Install Webcenter Portal 11.1.1.8 on Unix Machine

- Install Oracle SOA Suite 11g on Unix Machine

- Install Oracle OSB on Unix machine

- Install Webcenter Sites on Unix Machine

- Install Oracle Database 11g on Unix Machine

- Exercise on Managed Server Memory tuning

- Exercise on configuring Log files on a specific managed server

- Start / Stop Managed server using Node Manager

- Start / Stop Managed server in MSI(managed server independence)  Mode

- Create a domain 'fm_domain_prod' in Production Mode with one cluster , cluster contains two managed servers. Practice Start / Stop all managed servers using Node Manager as well as MSI mode.

- Create and extend a SOA Domain Template using Template Builder

- Use OPatch in Unix and experiment with applying patches to already installed SOA/Weblogic Server/ADF patches.

- Crate a JMS Server 'EmpJMSServer'

- Create  'JMS Module'

- Crate 'Queue' and add a message to the queue

- Create a 'Topic' , add a message to the queue.

- Copy the above created 'fm_domain' to TEST /  PROD environment, i.e try to practice how can you copy the existing domain to another machine without re doing the same again and again.

- Create a Data Source using Weblogic console , pointing to Oracle Database.





Wednesday, December 17, 2014

How to import and Export Webcenter Portal MDS Data using WLST Scripts


What is MDS Data ?

Oracle Metadata Services (MDS) Repository contains metadata for certain types of deployed applications. Those deployed applications can be custom Java EE applications developed by your organization and some Oracle Fusion Middleware component applications, such as Oracle B2B and Oracle Web Services Manager. A Metadata Archive (MAR), a compressed archive of selected metadata, is used to deploy metadata content to the MDS Repository, which contains the metadata for the application.

For More Info, Please Refer http://docs.oracle.com/cd/E29542_01/core.1111/e10105/repos.htm#ASADM494

What is WLST Script ?

The WebLogic Scripting Tool (WLST) is a command-line scripting interface that system administrators and operators use to monitor and manage WebLogic Server instances and domains. The WLST scripting environment is based on the Java scripting interpreter, Jython. In addition to WebLogic scripting functions, you can use common features of interpreted languages, including local variables, conditional variables, and flow control statements. WebLogic Server developers and administrators can extend the WebLogic scripting language to suit their environmental needs by following the Jython language syntax

For more Info , Refer http://docs.oracle.com/cd/E13222_01/wls/docs90/config_scripting/using_WLST.html

Follow below steps in order to execute WLST Script

Step 1 : Execute wlst.sh , Go to common/bin directory and execute as shown below

               /devbox/fmw/product/111/wcp_111/common/bin> ./wlst.sh

Step 2 : Connect to respective server as shown below
                  fmadmin - User ID
                  simple4u - Password
                  Admin Server IP Address
                  Admin Server Port

                     connect('fmadmin','simple4u','t3://129.155.137.216:44501')

Step 3: Execute below command to export the data. Make sure upon successful export, you should see a message " Successfully exported"

exportMetadata(application='FM_PortalApp1',server='WC_CustomPortal1',toLocation='/tmp/Oracle',docs='/**')

For More Info : http://docs.oracle.com/cd/E29542_01/webcenter.1111/e27738/wcadm_imp_exp_fw.htm#WCADM359

Step 4 : To Import, execute below command

importMetadata(application='FM_PortalApp1', server='WC_CustomPortal', fromLocation='/tmp/myrepos', docs='/**')




Tuesday, November 4, 2014

How to perform Redirect in ADF using Managed Bean ?

This blog explains various ways to perform redirect in ADF using Managed bean


Approach 1

FacesContext fcx =FacesContext.getCurrentInstance()
fcx.responseComplete();
fcx.getApplication().getNavigationHandler().handleNavigation(fcx, null, "gotoHomePage");  
fcx.renderResponse();

Approach 2

fcx.responseComplete();  
fcx.getExternalContext().redirect(getServletRequest().getContextPath() + "/pages/HomePage.jspx");

Approach 3

RequestDispatcher dispatcher = getServletRequest().getRequestDispatcher("HomePage.jspx");
dispatcher.forward(getServletRequest(), getServletResponse());

Approach 4
getServletResponse().sendRedirect("gotoHomePage.jspx")


Friday, October 31, 2014

How to import certificate to keystore



What is Keystore ?

A Java KeyStore (JKS) is a repository of security certificates – either authorization certificates or public key certificates – used for instance in SSL encryption. In Oracle WebLogic Server, a file with extension jks serves as keystore.

What is DemoTrust.jks ?

DemoTrust.jks Contains a list of certificate authorities trusted by WebLogic Server. This keystore establishes trust for WebLogic Server.

How to add import a certificate  to DemoTrust.jks Keystore ?

keytool -import -alias <certificate name> -file <certificate path> -keystore <DemoTrust.jks path>

Example : Execute below command in CMD in Windows


keytool -import -alias FM-CA -file C:\libs\FM\FM-CA.cer -keystore C:\Oracle\Middleware\wlserver_10.3\server\lib\DemoTrust.jks

How to see existing certificates in DemoTrust.jks ?

keytool -list -v -keystore C:\Oracle\Middleware\wlserver_10.3\server\lib\DemoTrust.jks

Here is the default password for DemoTrust.jks : DemoTrustKeyStorePassPhrase

For More Info : http://docs.oracle.com/cd/E19118-01/n1.sprovsys51/819-1655/fapsf/index.html

Sunday, October 12, 2014

How to implement Skins in ADF ?


This blog explains about how to apply skinning for any ADF application
- Create trinidad-skins.xml file 




-   Configure your .css file in above created trinidad-skin.xml as shown below

<?xml version="1.0" encoding="UTF-8" ?> 
<skins xmlns="http://myfaces.apache.org/trinidad/skin">
 <skin>
  <id>mySkin.desktop</id>
  <family>mySkin</family>
  <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
  <extends>fusion.desktop</extends>
  <style-sheet-name>/css/fmStyle.css</style-sheet-name>
 </skin>
</skins> 

- Below is sample .css file



-  Refer the  CSS file entries in your page or page fragment as shown below .



For More info, Please refer below links

https://blogs.oracle.com/jdevotnharvest/entry/how_to_learn_adf_skinning


Wednesday, October 1, 2014

How to dynamically replace Hard coded values Programatically

This blog explains about how to eliminate hard coded URL's in any web application. Especially hard coding the environment specific WSDL URL's or any other string values.

- Create a properties file and define all the values as  key value pair. Key must contains host name.

For eg : dev340 is the host name
              dev340_EMPWSDL =dev340:9080/emp/EmployeeManage?WSDL





- Wherever you want to retrieve the values from the properties file dynamically where the application is running
// Below code gives the host name where the application is running.
String hostName = java.net.InetAddress.getLocalHost().getHostName();

For eg : If the application is running in DEV environment, hostName value will be obtained as 'dev340' ,


- You need to retrieve property value from .properties file by passing hostname, Follow below blog to how to read properties file

http://fortunefusionminds.blogspot.com/2014/02/how-to-read-properties-file-in-java.html

Monday, September 29, 2014

How to add application specific context root entries in OHS


This blog explains about how and where to add the entries in OHS in order to configure any Custom application specific context root related entries in order to access the applications which are deployed in Weblogic console


Locate the mod_wl_ohs.conf file in your OHS directory

Example : /Box/admin/box_hostname/config/OHS/ohs1
                /dkxx40/admin/dkxx40_fmohskend0xx/config/OHS/ohs1

open mod_wl_ohs.conf file and add the below entry into it



#fmPortal domain
<Location /fmportal>
 SetHandler weblogic-handler
 WebLogicHost fmohskend031.oracleoutsourcing.com
 WeblogicPort 44716
</Location>

fmPortal - Context root of an application
WebLogicHost : host name
WeblogicPort : Port Name

Stop and Start OHS server in order to take effective these changes.

Tuesday, September 16, 2014

How to Add Roles/ Map App Roles to UCM/LDAP Roles, Add Member, Delete Member in Webcenter Portal Administrator


This blog explains about

 - Add Application Role
 - Edit Application Role
 - Map Application Role to LDAP/UCM Role
 - How to Add Users to App Role
  - How to add Members to App Role
  - How to Delete Members from App Role
  - Delete App Role

            Using Webcenter Portal Administrator Console

- Login to Webcenter Admin Portal console
- Click on 'Security' Tab
 - Follow below screenshot...

How to see logged in User Roles in UCM


This blog explains about viewing the logged in user UCM Roles,

Login to CS and click on 'Load' or 'Logged in User ID' link on the top right hand corner of the page as shown below.
You will see all the logged in user UCM roles.