Wednesday, February 20, 2013

Setting context-root of a web application in WebLogic

Modify weblogic.xml file under WEB-INF directory of your application.

<weblogic-web-app>
<context-root>/</context-root>
</weblogic-web-app>


Now run application by giving http://<IP>:<port>
no need to give application name.

You can also change the port of your application to run it on default port i.e. 80
by changing in config.xml under user_projects\domains\<Your-Domain>

<Server JDBCLogFileName="\jdbc.log"
JDBCLoggingEnabled="true" ListenAddress="" ListenPort="80"
Name="myserver" NativeIOEnabled="true"
ReliableDeliveryPolicy="RMDefaultPolicy" ServerVersion="8.1.5.0">

To enable STDOUT messages in logs
Make entry in startWebLogic.cmd file under user_projects\domains\<Your-Domain>
set JAVA_OPTIONS=Path\fileName.log
Put JAVA_OPTIONS like below in startWebLogic.cmd file:

%JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% -Dweblogic.Stdout=%JAVA_OPTIONS% -Dweblogic.Name=%SERVER_NAME%

To resolve timezone issue we can add our time zone in startWebLogic.cmd file like below:
%JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% -Dweblogic.Stdout=%JAVA_OPTIONS% -Duser.timezone=IST -Dweblogic.Name=%SERVER_NAME%


This is in the refernce of WebLogic8.1

No comments: