Thursday, February 12, 2015

Generating your WLS-domain to a WLST-script through configToScript

If you want to generate a WLST-script from your domain, you can use the configToScript WLST-command.
This command has 4 optional parameters:
  • configPath : your domain directory; if null, your current directory will be taken
  • pyPath : the directory where the script files will be generated
  • overwrite : if the script already exists, it will be overwritten
  • propertiesFile : path to the properties file of the script
  • createDeploymentScript : boolean that indicates if a script will be generated to redeploy the applications in the domain (default value = false)
Start WLST through the wlst.sh script.

wls:/offline> configToScript('/opt/oracle/Oracle/Middleware/user_projects/domains/base_domain/','/home/oracle/wlst_scripts','true','/home/oracle/wlst_scripts/base_domain.properties','true')
configToScript is loading configuration from /opt/oracle/Oracle/Middleware/user_projects/domains/base_domain/config/config.xml ...
Completed configuration load, now converting resources to wlst script...
Creating the key file can reduce the security of your system if it is not kept in a secured location after it is created. Creating new key...
Using existing user key file...
Using existing user key file...
Using existing user key file...
Using existing user key file...
Using existing user key file...
Using existing user key file...
Using existing user key file...
Using existing user key file...
configToScript completed successfully The WLST script is written to /home/oracle/wlst_scripts/config.py and the properties file associated with this script is written to /home/oracle/wlst_scripts/base_domain.properties
WLST found encrypted passwords in the domain configuration. 
These passwords are stored encrypted in /home/oracle/wlst_scripts/c2sConfigbase_domain 
and /home/oracle/wlst_scripts/c2sSecretbase_domain. WLST will use these password values 
while the script is run.
wls:/offline> exit()


Exiting WebLogic Scripting Tool.


After this, you can verify the created files:

[oracle@wls12c wlst_scripts]$ pwd
/home/oracle/wlst_scripts
[oracle@wls12c wlst_scripts]$ ls
base_domain.properties  c2sSecretbase_domain  deploy.py
c2sConfigbase_domain    config.py

Optionally, open the base_domain.properties file and modify the value of the domainDir parameter.

Now, we will recreate the domain with the scripts.
Therefore, we first backup and then delete the WLS-domain directory.  Also, it is a good advice to backup your application sources.
Then, we can execute the config.py script through WLST.

Normally, during the first run, you will encounter this error:
Exception in thread "Main Thread" java.lang.AssertionError: JAX-WS 2.2 API is required, but an older version was found in the JDK.

To solve this, go to the $JAVA_HOME/jre/lib directory and create the "endorsed" directory, if not exists.
Copy the jars in the $WL_HOME/endorsed directory to this new directory.

Now try again to run the Jython script in WLST.  If successful, you can start up your environment.

I noticed afterwards that my application was not deployed, so I redeployed it with WLST.

Deassociating OID from Reports 11g

At a customer site, I faced this problem when trying to activate the showjobs-url of the reports server.
The installation was done by someone else. On the server machine (OS: Windows Server 2008 SP2), the IDM 11g Suite was first installed and then the Fusion Middleware 11g Suite. During the configuration, they associated the OID to the Reports components.
When I arrived a few months later to do some other configuration changes, the customer wanted to deassociate the link between OID and Reports. When we did the deassociation, we received this error in the showjobs-url:
REP-52266: The in-process Reports Server rep_wls_name failed to start.oracle.reports.RWException: IDL:oracle/reports/RWException:1.0

In the rwserver_diagnostics.log file, we found these 2 errors:
* REP-50125 : An internal exception occurred: oracle.security.jps.service.credstore.CredStoreException: Could not find the key specified.
* REP-50125 : An internal exception occurred: oracle.security.jps.service.credstore.CredStoreException: JPS-01050: Opening of wallet based credential store failed. Reason java.io.IOException: PKI-02002: Unable to open the wallet. Check password.

We could solve this issue by commenting some tags:
(1) rwservlet.properties -> we commented the oidconnection-tag
(2) rwserver.conf -> we commented the security-tag

After that, we stopped our environment and restarted all the processes. Result: everything worked fine!

Forms 11g - Windows Java client hangs with message "The application's digital signature cannot be verified."

After modifying the webconfiguration values for the paremeters "webutilArchive" and "archive", I had a very annoying problem.
When I activated the application url, I got the following popup message and I couldn't accept/deny this message.

Warning - Security
The application's digital signature cannot be verified.
Do you want to run the application?

Name:      ... 
Publisher: ... 
From:      ... 
[ ] Always trust content from this publisher. 

[Run] [Cancel]

Although, there is a checkbox in the message and 2 buttons, I couldn't do anything else than shutting down my browser through the Windows Task Manager.

There are 2 solutions for this problem:

(1) Using this sequence of jar-files for webutilArchive
webutilArchive=jacob.jar, frmwebutil.jar
More info on Oracle Support:
WebUtil Form HangsWhen Acknowledging Security Warning - The application's digital signature cannot be verified [ID 1328039.1]

(2) Applying patch 9463433 if the archive parameter is the cause of the problem
More info on Oracle Support:
Windows Java Client Hangs On Accepting Not Verified Signature Of jar Files [ID 1173365.1]

Oracle Forms Builder 11g R2 on Oracle Linux 6


If you want to run the Forms Builder utility (by executing the $INSTANCE_HOME/bin/frmbld.sh script) on your Oracle Linux 6 system, it is possible that you receive this error:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fb7d0b1c2c3, pid=11590, tid=140427416176448
#
# JRE version: 6.0_35-b10
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.10-b01 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libclntsh.so.11.1+0xee72c3]  __intel_new_memcpy+0x14e3
#
# An error report file with more information is saved as:
# /opt/oracle/Oracle/Middleware/asinst_1/bin/hs_err_pid11590.log
#
# If you would like to submit a bug report, please visit:
#   
http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

That's because you forgot something during your OS preparation.
In fact, you have to set the NLS_LANG environment variable for your user, e.g. in the .bash_profile file:
export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P15

When you have this variable, you can run Forms Builder without any problem!

Wednesday, February 4, 2015

Oracle FMW 11g R2 and JDK 7 : solving OHS error in EM

Installing the OHS-component as part of Forms and/or Reports 11g R2, based on JDK 7, gives the following error in the EM, when you try to navigate to it:

Failed to invoke operation load on MBean ...



The error itself seems to be very terrible, but don't worry, you can easily solve it.
You just have to doe the following:
(1) Shutdown your OHS-component.
(2) Go to the admin.conf file located in the <<INSTANCE_HOME>>/config/OHS/<<ohs_component>> and just change this line:
SSLProtocol nzos_Version_3_0
to
SSLProtocol nzos_Version_1_0 nzos_Version_3_0
(3) Start again your OHS-component.

This error occurs both on Linux and Windows Operating Systems, the cause of the error is JDK 7, because it does not occur with earlier versions of Java.

Generated LOV-buttons in Forms

When using LOV's in your form, you would like to indicate the end users which text fields are linked with an LOV.
When you are positioned into such a text field, you can see at the status bar of the applet that the field is linked with an LOV:

To make your form more user friendly, you can add a push button with a nice icon, but you can also use automatically generated LOV-buttons.  When you point the cursor in such a text field, you will see a small button with 3 dots:

It is very easy to implement this feature without doing changes in the source code of your form.
In the EM, you navigate to the Forms screen.
Next, in the "Forms" menu, you choose "Font and Icon Mapping" and you set the value for "app.ui.lovButtons" to "yes" (default = "no").

P.S.: this change will be recorded in the "registry.dat" file.

Restart your Forms server process and test the feature in your application!

Automatic startup of WLS servers when booting Linux

On the My Oracle Support website you can find the article "RC Initialization Scripts for Starting and Stopping WebLogic Server as a UNIX Daemon [ID 877902.1]".
Here in this post, I will describe an alternative method.
I tested out on a Oracle Linux 6 host machine.
These are the steps that must/can be performed:

(1)
Create for each server within your domain a boot.properties file (My Oracle Support: "How to Start a WebLogic 10.3.x Domain AdminServer Without Interactively Supplying the Username / Password? [ID 980292.1]").


(2)
Login as root


(3)
Navigate to /etc/init.d and create a file wls with this content:
#!/bin/bash
#
# oracle Init file for starting and stopping WLS
#
# chkconfig: 35 80 30
# description: Oracle WLS startup script
# Source function library

. /etc/rc.d/init.d/functions

ORACLE_OWNER="oracle"
DOMAIN_HOME="/opt/oracle/Oracle/Middleware/user_projects/domains/dev_domain"

case "$1" in
start)
echo -n $"Starting WLS:"
su - $ORACLE_OWNER -c "$DOMAIN_HOME/bin/startWebLogic.sh > /dev/null 2>&1 &"
su - $ORACLE_OWNER -c "$DOMAIN_HOME/bin/startManagedWebLogic.sh ManagedServer1 > /dev/null 2>&1 &"
su - $ORACLE_OWNER -c "$DOMAIN_HOME/bin/startManagedWebLogic.sh ManagedServer2 > /dev/null 2>&1 &"
echo "OK"
;;
stop)
echo -n $"Stopping WLS:"
su - $ORACLE_OWNER -c "$DOMAIN_HOME/bin/stopManagedWebLogic.sh ManagedServer1"
su - $ORACLE_OWNER -c "$DOMAIN_HOME/bin/stopManagedWebLogic.sh ManagedServer2"
su - $ORACLE_OWNER -c "$DOMAIN_HOME/bin/stopWebLogic.sh"
echo "OK"
;;
*)
echo $"Usage: $0 {start|stop}"
esac


(4)
In a terminal window, execute these commands:
chmod 750 /etc/init.d/wls
chkconfig --add wls --level 0356