Using Log4j in Oracle ADF application

As i talked about more of ADF logger in my previous Adf logger post.Now what if you want log4j in ADF application.

1) Add the log4j JAR file to the project library JAR file .

2) Then you need to create log4j.properties file in your application src directory.

Content of properties file-

#####################################################

# Set root logger level to INFO and its only appender to ConsoleOut.
log4j.rootLogger=INFO,ConsoleOut,F

# ConsoleOut is set to be a ConsoleAppender.
log4j.appender.ConsoleOut=org.apache.log4j.ConsoleAppender

# ConsoleOut uses PatternLayout.
log4j.appender.ConsoleOut.layout=org.apache.log4j.PatternLayout
log4j.appender.ConsoleOut.layout.ConversionPattern=%-5p: [%d] %c{1} – %m%n

#####################################################

now you can use log4j as below –

package com.techartifact.log4jSample;

import org.apache.log4j.Logger;
import org.apache.log4j.Category;
import org.apache.log4j.PropertyConfigurator;
import javax.servlet.*;
import javax.servlet.http.*;



public class Log4JSample
extends HttpServlet
{
Logger log = Logger.getLogger(this.getClass().getSimpleName());
private static final String CONTENT_TYPE = "text/html; charset=windows-1252";

public void init(ServletConfig config)
 throws ServletException
{
 super.init(config);
 log.info("inside init() method of Log4JSample");
}

public void doGet(HttpServletRequest request,
                 HttpServletResponse response)
 throws ServletException, IOException
{
 log.info("inside doGet method of Log4JSample");
}
}

Happing logging in Techartifact with Vinay Kumar. 🙂

generate the secure files in weblogic in Webcenter Spaces Applicaton

For security purposes, administrator user name and password details are stored in secure files.Obtain the location of these secure files from your systems administrator or generate the secure files in weblogic.
How to do that. lets find it out.

I am working on portal and spaces application.For deploying spaces application in console ,i need a secure file.Following are the steps to generate.

1. Navigate to: ORACLE_HOME/common/bin in command prompt using CD command.

2. Enter the command:
wlst.sh – for unix.
wlst.cmd – for windows.

3. At the WLST command prompt, connect to the Administration Server for Oracle WebCenter:

connect(‘‘,’‘, ‘:‘) Where admin_user is the user name of the administrator, admin_pwd is the administrator’s password, host is the WebCenter instance, and port is the Administration Server port. This is used for connecting with weblogic using command prompt. i.e

connect(‘weblogic ‘,’welcome1’, ‘192.168.0.93:8888’)

4. Run the following command to create a user configuration file and key file in a specified location:

storeUserConfig(‘‘, ‘) Where userConfigFile is the name and location of the file storing user details and userKeyFile is the name and location of the file storing passwords.

For example: storeUserConfig(‘C:/myFiles/myuserconfigfile.secure’, ‘C:/myFiles/myuserkeyfile.secure’)

you can map the entry of these files in config.properties in spaces application to deploy shared library like below

wls.userkey=C:\\JDeveloper\\mywork\\ps1userkeyfile.secure
wls.userconfig=C:\\JDeveloper\\mywork\\ps1userconfigfile.secure

Thats it. You can find the secure files in specified path.

Happy coding with Vinay in Techartifact…..

WebCenter PS6 (11.1.1.7) Released

Version PS6 (11.1.1.7) of WebCenter has been released on 1st of April, 2013.Don’t know why they choose april fool day. PS6 includes many bug fixes in addition to enhancements to the WebCenter Content Application Extension Framework (AXF) supporting integrations with E-Business Suite and PeopleSoft.A rundown of the new Jdev 11.1.1.7.0 Enhancements can be seen here

http://www.oracle.com/technetwork/developer-tools/jdev/index-088099.html

There will be one major version 11.1.1.8.0 (PS7) of WebCenter by end of 2013. In this release, following are some highlights I learned from Oracle:-

1. there is no more two solutions (Spaces & Portal) for WebCenter. Spaces will be the part of WebCenter Framework. Only one concept that is PORTAL.

2. We can create multiple portal from Web Interface.

3. You can import/export portal archive (PAR exactly like JAR/WAR/MAR) from/to Web to/from JDeveloper for complex customization.

4. All types of popup windows will be eliminated from portal.

5. You can drag and drop Web 2.0 components and taskflows on to the page from resource catalogue.

6. Migration among different environments is easy due to PAR.