Showing posts with label logging. Show all posts
Showing posts with label logging. Show all posts

Friday, 13 April 2012

This project needs to migrate WTP metadata in eclipse

Sometime if you are importing the portal web project or java project , even after doing clean build it throws error.... 'This project needs to migrate WTP metadata'

There are possible solution to this issue :

1) Delete the .settings folder from the project , refresh the workspace and clean build.
2) Right click on the project and click 'validate'.
3) Delete the .metadata file and create the new workspace. This should be the last option as it may require a lot of rework to set up the workspace.

For me first two option worked , however we used the third option also in one of the case.

Friday, 10 February 2012

Configure log4j in Weblogic10.3

For Configuring log4j in Weblogic 10.3 follow below steps:

1) Place log4j-1.2.16.jar in your project build path.

2) put log4j.xml in your domain directory ( you can make any folder for ex. 'configuration')

3) There are many ways to initilize log4j, here I am including two ways

  a) Edit the server start up script
     Open $DOMAIN_HOME\bin\setDomainEnv.cmd and set LOG4J_CONFIG_FILE with complete path of log4j.xml. For example if you have placed log4j.xml under configuration folder.
set LOG4J_CONFIG_FILE=%DOMAIN_HOME%\configuration\log4j.xml

b) With Spring framework 
If you are using Spring framework in your application then add below entry in web.xml.
    <context-param>
   <param-name>log4jConfigLocation</param-name>
   <param-value>file:${DOMAIN_HOME}/configuration/log4j.xml</param-value>
 </context-param>
 <context-param>
   <param-name>log4jExposeWebAppRoot</param-name>
   <param-value>false</param-value>
 </context-param>
 <listener>
   <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
  </listener>

4) Restart the server.

You are done with log4j configuration !!