Thursday, 31 August 2017

Oracle JDeveloper Parameters

AddVMOption -Xms2048M
AddVMOption -Xmx2048M
AddVMOption -XX:PermSize=768m
AddVMOption -XX:MaxPermSize=1024m
AddVMOption -DMainWindow.MemoryMonitorOn=true

This is another usual error encountered when deploying projects to embedded WebLogic Server in JDeveloper 11g. I have done my searching to google and lost myself on the many lengthy discussion. 
To make the life of others easy, here is the solution that I have got: 

Change the PermGen size for your internal WLS in 
\jdeveloper\system\system11.1.1.0.31.51.88\DefaultDomain\bin\setDomainEnv.cmd
Find the line with MEM_MAX_PERM_SIZE.
set MEM_MAX_PERM_SIZE=-XX:MaxPermSize=128m
Increase it to 256m or 512m. 


This post is based on JDev 11g R2 (but same applies for other JDev 11g versions).

Its fairly easy to enable JDeveloper 11g Heap Memory Monitor, add this property to jdev.conf file (located under JDEV_INSTALL/jdev/bin/ folder) and restart IDE:

AddVMOption -DMainWindow.MemoryMonitorOn=true


java parameters like
set JAVA_OPTS=%JAVA_OPTS% -Xms256m -Xmx512m -XX:+UseParallelGC
set JAVA_OPTS=%JAVA_OPTS% -XX:PermSize=256m -XX:MaxPermSize=512m

Project Properties

Here is another case which requires the change of project properties in JDeveloper: 
  • Scenario:
    • JDeveloper is used to deploy "server-setup-seed-deploy-test" target with "Run Ant Target" and it threw "java.lang.OutOfMemoryError: PermGen space" exception.[2]
  • Solution:
    • In Jdev window, right click the project file >  Project Properties > Ant > Process > Java Options:
      • -Xms512m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=1024m
    • Note that a new JVM is launched for the Ant process and it uses the above settings.
Files that control the amount of memory afforded to the JVM for JDeveloper upon startup, relative to the jdeveloper/ide/bin/ directory, include:
  • jdev.conf
  • ide.conf
Update these files as follows:
  1. Quit JDeveloper.
  2. Edit ide.conf.
  3. Append the following
    AddVMOption -Xms256M
    AddVMOption -Xmx1024M
    
  4. Edit jdev.conf.
  5. Find the AddVMOption for the "heap size."
  6. Change the values as follows:
    AddVMOption -Xmx1024M
    AddVMOption -XX:MaxPermSize=1024M
  7. Perm gen space error in jdev

    The Perm gen space often appears in jdeveloper when you re-run a UI application without stopping the server. This error can be avoided by adding the following to the project properties JAVA OPTIONS :- Project Properties -> Run/Debug/Profile -> Default -> Edit -> Java Options -> -Xms256m -Xmx1024m -XX:PermSize=96m -XX:MaxPermSize=512m -XX:CompileThreshold=8000

Tuesday, 29 August 2017

Oracle ADF page background

<af:panelstretchlayout id="pt_psl1"
inlinestyle="padding:10px;background-image:url('/oracle/ui/pattern/dynamicShell/images/back.jpg');">
</af:panelstretchlayout>
=========================================================================
<af:panelstretchlayout id="pt_psl1"
inlinestyle="padding:10px;background-image:url('#{facesContext.externalContext.requestContextPath}/oracle/ui/pattern/dynamicShell/images/back.jpg');">
</af:panelstretchlayout>
==============================================================================
and I added the image images/JDev.jpg in hte public_html folder!

Create a skin file and add bellow class

.loadBg {
    background-image: url("../images/bgimg.jpg");
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    max-width: 100%;
    height: auto;
    display: block;
    background-color: #ee3a23;
}
==============================================================================
and add that class reference to your page

<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
          xmlns:f="http://java.sun.com/jsf/core">
    <af:panelGroupLayout id="pgl13" layout="scroll" styleClass="loadBg">
        <ur conntent >
    </af:panelGroupLayout>
</jsp:root>

Thnaks
PraveenM90
=======================================================
inlineStyle='background-image:url("image.JPG");

<af:gridRow marginTop="5px" height="auto" id="gr1">
                            <af:gridCell marginStart="5px" width="90%" id="gc1"
                                         inlineStyle='background-image:url("image.JPG");width:200px'>
                                <af:outputText value="#{item.AssetId}" id="ot1"/>
                            </af:gridCell>
                            <af:gridCell marginStart="5px" width="50%" marginEnd="5px" id="gc2"
                                         inlineStyle='background-image:url("image.JPG");'>
                                <af:outputText value="#{item.AssetType}" id="ot2"/>
                            </af:gridCell>
                        </af:gridRow>
==========================================================================
<img src="<%=renderRequest.getContextPath()%>/images/loading.gif"

worked for me.
Image was inside the war in /images/loading.gif
==========================================================================
Hi,

I had the same problem. my fault was , that i didn't imported a taglib:
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
and then
<img src="<%=request.getContextPath()%>/img/image.jpg"/>
worked.

I hope this helps.
==========================================================================
Steps:
1.Add images folder to docroot (docroot\images).
2. Access the image in JSP using the following.
<img src="<%=request.getContextPath()%>/images/abc.png"/>

Done!. Good Luck!
==========================================================================