Tuesday, June 17, 2014

Fixing "This desktop does not support the requested display protocol." error in VMWare View Client in OSX Mavericks

Earlier I couldn't connect to a Microsoft XP remote desktop via VMware View Client in OSX Mavericks even though I could connect fine from a Windows 7 machine (using VMware View Client).

I managed to fix it by installing "Microsoft Remote Desktop Connection for Mac" from here:
http://www.microsoft.com/en-au/download/details.aspx?id=18140

Note: If you google the error, you will get a wide variety of causes/triggers for the error. In my case not having this MS remote connector was the cause.


Friday, April 11, 2014

Oracle APEX, set value of shuttle via javascript


In Oracle APEX Javascript API, you would typically set the value of page item by 

$x('P1_ITEM').value = 5;

This would work with textfields, select list. But for more complex input items like shuttle, it would not work.

If one examines an APEX shuttle item with Firebug or Chrome Dev tools, one can see its composed of 2 items fields, suffixed with "_LEFT" and "RIGHT".


Solution is to use apex.item("<<name of item>>")>setValue(<<value>>); which takes into consideration the item type.

apex.item( "P1_ITEM" ).setValue( "10" );

You can read more about apex.item in the Oracle documentation for APEX's JavaScript API:
http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/javascript_api.htm#AEAPI29494

Saturday, April 5, 2014

Upgrade Java to 1.7 in OEL

1) Look-up up packages 

yum search java | grep 'java-'
This system is not registered with ULN.
You can use up2date --register to register.
ULN support will be disabled.
java-1.6.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.6.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.6.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.6.0-openjdk-javadoc.x86_64 : OpenJDK API Documentation
java-1.6.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.7.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.7.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.7.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.7.0-openjdk-javadoc.x86_64 : OpenJDK API Documentation
java-1.7.0-openjdk-src.x86_64 : OpenJDK Source Bundle
cairo-java-devel.i386 : Compressed Java source files for cairo-java.
cairo-java-devel.x86_64 : Compressed Java source files for cairo-java.
glib-java-devel.i386 : Compressed Java source files for glib-java.
glib-java-devel.x86_64 : Compressed Java source files for glib-java.
java-1.4.2-gcj-compat.x86_64 : JPackage runtime scripts for GCJ
java-1.4.2-gcj-compat-devel.i386 : JPackage development scripts for GCJ
java-1.4.2-gcj-compat-devel.x86_64 : JPackage development scripts for GCJ
java-1.4.2-gcj-compat-javadoc.x86_64 : API documentation for libgcj
java-1.4.2-gcj-compat-src.x86_64 : Source files for libgcj
libgconf-java-devel.i386 : Compressed Java source files for libgconf-java.
libgconf-java-devel.x86_64 : Compressed Java source files for libgconf-java.
libglade-java-devel.i386 : Compressed Java source files for libglade-java.
libglade-java-devel.x86_64 : Compressed Java source files for libglade-java.
libgnome-java-devel.i386 : Compressed Java source files for libgnome-java.
libgnome-java-devel.x86_64 : Compressed Java source files for libgnome-java.
libgtk-java-devel.i386 : Compressed Java source files for libgtk-java.
libgtk-java-devel.x86_64 : Compressed Java source files for libgtk-java.
libvte-java-devel.i386 : Compressed Java source files for libvte-java.
libvte-java-devel.x86_64 : Compressed Java source files for libvte-java.

2) Install the package:
yum install java-1.7.0-openjdk.x86_64

Monday, March 24, 2014

Install Oracle REST Data Services for Oracle Apex in Apache Tomcat 7

1) Download Oracle REST data services from http://www.oracle.com/technetwork/developer-tools/rest-data-services/downloads/index.html

2) Unzip the content of the ZIP directory
3) Rename the ords.war to apex.war if you want the URL in the format of http://hostname/apex
mv ords.war apex.war

4) Before you configure the WAR file you will need to specify where the config files should be kept. Create a directory where you want the config files to be kept. Suppose its in /home/oracle/apex_config

5) Run the following:
java -jar apex.war configdir "/home/oracle/apex_config"

6) Next run the setup, it will write the config files to directory specified in parameter in step 5 above:
java -jar apex.war setup

7) Copy this apex.war file to <<tomcat home>> /webapps directory

8) Copy the Apex Images to <<tomcat home>>/webapps/images directory and rename this directory to i so the path to images directory is 
<<tomcat home>>/webapps/i

9) Startup Tomcat

Wednesday, December 4, 2013

Resolving weblogic.store.PersistentStoreException:...."_WLS_AdminServer" cannot open file _WLS_ADMINSERVER000000.DAT. error


In Weblogic 10.3.5, if you get the following error during startup:



> <Store> 045> <The persistent store "_WLS_AdminServer" could not be deployed: weblogic.store.PersistentStoreException: [Store:280105]The persistent file store "_WLS_AdminServer" cannot open file _WLS_ADMINSERVER000000.DAT.

You can try fix it by navigating to:
 
/u01/weblogic/Oracle/Middleware/user_projects/domains/<<Domain_name>>/servers/AdminServer/data/store/default/

directory and delete the _WLS_ADMINSERVER000000.DAT fIle.

This action is detailed out in Oracle Support doc ID:  957377.1

 After deleting the file, try restart the server again. 


 

Wednesday, November 20, 2013

Oracle Database: unexpire schema or fix ORA-28001 without changing the password

In Oracle Database, to unexpire schemas, you will need to issue the command as SYS/SYSTEM:

ALTER USER <USERNAME> IDENTIFIED BY <PASSWORD>

For this to happen you will need to know the password of the user you are trying to "unexpire". There are situations however where we do not know the password of the schema we are trying to unexpire.


A work around is retrieving the hashed password of the schema and issue the ALTER USER statement in slightly different manner:

Using the SCOTT/tiger example below: 

STEP 1: Retrieve the hashed password of the expired schema

Connect as SYSDBA and run the query: 

SQL> select password from sys.user$ where name = 'SCOTT';

PASSWORD
------------------------------
F894844C34402B67


STEP 2: Run the ALTER USER command as below:

SQL> ALTER USER SCOTT IDENTIFIED BY VALUES 'F894844C34402B67';

If account is locked you may need to run the following as well:

ALTER USER SCOTT ACCOUNT UNLOCK;

Saturday, August 10, 2013

Oracle Apex Tabular Form: Delete unsaved rows without submitting

A common shortfall in Tabular Form functionality in APEX (amongst many) is that when you add a couple of rows and you wish to delete one without saving the form, you will end up losing the whole lot of rows entered.

This piece of code will help you avoid the problem. Put this in page header and in the DELETE button's attribute, set type as URL and javascript:delete_rows(); as target.

The way it works, if the checked row wasn't saved and it will be removed without page submission, otherwise the page will be submitted to remove it via normal mechanism.

<script language="JavaScript" type="text/javascript">
    function delete_rows()
    {
        var need_submit = 0;
        $("[name='f01']").each(function(){

        if($(this).attr("checked"))
        {
            if(this.value == 0) // new row, not saved. Checkbox value is 0
            {
                $(this).closest("tr").remove();
            }
            else    // row was saved before, need to be removed via page submission.
                need_submit = need_submit + 1;
           
        }

        });
       
        if(need_submit > 0)    // require submission?
            apex.submit('MULTI_ROW_DELETE');
           
        addTotal();   

    }

</script>