Friday 2 August 2019

Upgrade Jdeveloper to 64 Bit JDK / Upgarde Java Version for your Jdeveloper APP



Hi All

In the below article I would like to explain how you can increase your Jdeveloper performance using 64 Bit processor and 8GB RAM


  • Download 64bit JDK 
  • Install JDK (take note pf the path of JDK installed folder)open 


1)Now Open \Oracle\Middleware\jdeveloper\ide\bin\ide.conf

Change the below settings


AddVMOption  -Xmx4096M
AddVMOption  -Xms1024M

Here I'm using 8 GB RAM ( Considering all my other application of the system uses the remaining 4GB of RAM . If you are using less RAM or more apps that consuming more than 4GB then adjust settings saccordingly like for 2GB AddVMOption  -Xmx2048M)


2) Open C:\Oracle\Middleware\jdeveloper\jdev\bin\jdev.conf

Change the below settings

AddVMOption  -XX:MaxPermSize=1024M

SetJavaHome D:\Oracle\Middleware\jdk1.7.0_80 ( Path of your JDK of 64Bit)


3) Now Replace the existing JDK  with the JDK installed path in below files


  • C:\Users\YOURUSERNAME\AppData\Roaming\JDeveloper\system11.1.1.6.38.62.29\DefaultDomain\bin\setDomainEnv.cmd
  • C:\Users\ YOURUSERNAME \AppData\Roaming\JDeveloper\system11.1.1.6.38.62.29\DefaultDomain\init-info\domain-info.xml
  • C:\Users\ YOURUSERNAME \AppData\Roaming\JDeveloper\system11.1.1.6.38.62.29\DefaultDomain\init-info\startscript.xml
  • C:\Users\ YOURUSERNAME \AppData\Roaming\JDeveloper\system11.1.1.6.38.62.29\DefaultDomain\init-info\tokenValue.properties
  • D:\Oracle\Middleware\jdeveloper\jdev\bin\jdev.conf (we have already done this )


4) Restart Jdeveloper , see the difference in performance .

* For few other settings you can check this Link

Happy Coding !!
-Krishna Prathi

Thursday 25 July 2019

Blob Upload issue in Oracle ADF 

(Cannot create an object of type:oracle.jbo.domain.BlobDomain from type:weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB)


This error you ll face when you upload a file to Blob column

The actual error description is 

oracle.jbo.domain.DataCreationException: JBO-25009: Cannot create an object of type:oracle.jbo.domain.BlobDomain from type:weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB with value:weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB@c


You can  fix the issue by following the below steps:

  • Go to Data Sources -> Your Data Source -> Connection Pool -> Advanced in the below Then uncheck the Wrap Data Types
  • Save
  • Restart The server 



Cheers!!
Krishna Prathi 

Sunday 9 June 2019

Read Property files in jsff and java class in ADF project

Hi

We often have the requirement of reading properties from a file placed inside the ADF application itself . We use this mainly for easy access of properties that uses in many locations across the application.


Code to read property file  in java:

  InputStream st = null;
 Properties prop = new Properties();
 st =
    Thread.currentThread().getContextClassLoader().getResourceAsStream("/com/view/read.properties);

 try {
           prop.load(st);
          String personID=prop.getProperty("Employee") ;;

 
         }catch (Exception e) {
           logErrorStackTrace(e);
            }finally{
                try{
                    if (st !=null) {
                        st .close();
                    }
               
                }catch (Exception e) {
                    logErrorStackTrace(e);
                }
            }

*Must close the st  after usage

Code to read property file  in jsff:

Declaration / import :
 
 <c:set var="propfile"

           value="#{adfBundle['com.view.read']}"/> // read is the property file name

Usage:

            <af:outputText value="#{propfile.outputtext}"
                            id="ol1"/>


Thank You!!

Never stop learning ...

Read Property files in JAVA/ ADF from external location

Hi

We often have the requirement of reading properties from a file placed in external location of server . This always helps to make the changes in application with out down time.

Say , If you have configured a property named  "PROMOAVAILABLE" in property files and is set to ON if promotion is applicable and OFF if not applicable.
Based on this you can alter your logic in the code and there will be no re deployments necessary.


code to read property file :

 FileInputStream fileInputStream= null;

    try {

          File file=new  File("/opt/oracle/read.properties"); // Property file location
          fileInputStream= new FileInputStream(file);
          ResourceBundle resource = new PropertyResourceBundle(fileInputStream);
          String promo=resource.getString("PROMOAVAILABLE") ;

           if("ON".equalsIgnoreCase(promo)){
                         //write code
                }
        else{
                         //write code
              }

         }catch (Exception e) {
           logErrorStackTrace(e);
            }finally{
                try{
                    if (fileInputStream !=null) {
                        fileInputStream.close();
                    }
                 
                }catch (Exception e) {
                    logErrorStackTrace(e);
                }
            }

*Must close the FileInputStream after usage 

Hello World in Java and Go

Hello World: Java: public class HelloWorld { public static void main (String[] args) { System.out.println( "Hello, W...

Popular Posts