Showing posts from March, 2013

Start Weblogic without user and password

When you want to launch your weblogic server at production, you need to use the in your bin folder.

But each time it's launched it's asking you to authenticate yourself by typing a user and password. It's a problem when you want to automate the execution of your server...

To avoid this problem all you need to do is creating a file named "" and insert into the two following lines :

password=<yourPassword> this file must be placed in each server security folder : $WLS_HOME/user_projects/domains/<domainName/servers/<serverName>/security
Then, start server, it shouldn't ask you for anythin, then reopen your file, password and username should be automatically encrypted ! Thanks

Avoid java out of memory with Weblogic

This is common exception always exists if you install weblogic and doesn't extend memory arguments in server.

The file "" in $WLS_HOME/user_projects/domains/<domainName>/bin/ has configuration of domain.

If you edit this file it will have the following default values.
MEM_ARGS="-Xms256m -Xmx512m" export MEM_ARGS MEM_PERM_SIZE="-XX:PermSize=48m" export MEM_PERM_SIZE MEM_MAX_PERM_SIZE="-XX:MaxPermSize=128m" export MEM_MAX_PERM_SIZE
you should modify the MEM_ARGS java memory value depending of your server, here is the suggested to increase. MEM_ARGS="-Xms2024m -Xmx3036m" export MEM_ARGS MEM_PERM_SIZE="-XX:PermSize=128m" export MEM_PERM_SIZE MEM_MAX_PERM_SIZE="-XX:MaxPermSize=512m" export MEM_MAX_PERM_SIZE

Note : choosing the values depend on you server hardware.


Oracle OAF Profile Option

Oracle OAF has some important profile options which is useful in extension or personalization.
I will list it below and write breif about every profile option.

1- FND_Diagnostics
Setting this profile option to YES, will add anew link "Diagnostics" at top right on page, that allow developer to trace logs.

To add log when coding use the following code in Controller or Application Module
In Controller write this code:-
pageContext.writeDiagnostics(this, "Phrase will be added to logs", 1);

In Application Module write this code
getOADBTransaction().writeDiagnostics(this, "Phrase will be added to logs", 1);

2- Personalize Self-Service Defn
 Set this profile to Yes to allow personalization. 

3- FND: Personalization Region Link Enabled :
Set this profile to  Yes  show "Personalize  Region" links above each  region in a page.

4- Disable Self-Service Personalization
Yes will disable all personalization at any level.

5- FND: Personalization Document Root Pa…

Redirect to ParentAction Programatically

In your task flow you can redirect parent action programatically using the following method.

public void redirectToParentAction(String parentAction) {         ControllerContext ctrlCtx = ControllerContext.getInstance();         ViewPortContextImpl portImpl = (ViewPortContextImpl)ctrlCtx.getCurrentViewPort();         ParentActionEvent parentEvent = new ParentActionEvent(parentAction, true);         portImpl.queueParentActionEvent(parentEvent);     }


Generate View URL in ADF

The following  getUrl method generates URL for you view in ADF application.
You pass servlet name and view id, I also overloaded getUrl method for making default servlet name as "faces".

public static FacesContext getFacesContext() { return FacesContext.getCurrentInstance(); } public static ExternalContext getExternalContext() { return getFacesContext().getExternalContext(); } public static String getURL(String servletName, String viewId) { HttpServletRequest request = (HttpServletRequest)getExternalContext().getRequest(); String requestUrl = request.getRequestURL().toString(); StringBuilder newUrl = new StringBuilder(); newUrl.append(requestUrl.substring(0, requestUrl.lastIndexOf(servletName))); newUrl.append(servletName); newUrl.append(viewId.startsWith("/") ? viewId : "/" + viewId); return newUrl.toString(); } public st…