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

Thursday, February 14, 2013

Setting context-root of a web application in JBOSS

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


<jboss-web>
<context-root>/</context-root>
</jboss-web>


Remove or rename ROOT.war application from
server/default/deploy/jboss-web.deployer directory

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 server.xml under server\default\deploy\jboss-web.deployer

<Connector port="80" address="${jboss.bind.address}"
maxThreads="250" maxHttpHeaderSize="8192"
emptySessionPath="true" protocol="HTTP/1.1"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />
To enable STDOUT messages in console log

Change in jboss-service.xml under server\default\conf


<mbean code="org.jboss.logging.Log4jService"
name="jboss.system:type=Log4jService,service=Logging"
xmbean-dd="resource:xmdesc/Log4jService-xmbean.xml">
<attribute name="ConfigurationURL">resource:jboss-log4j.xml</attribute>
<!-- Set the org.apache.log4j.helpers.LogLog.setQuiteMode. As of log4j1.2.8
this needs to be set to avoid a possible deadlock on exception at the
appender level. See bug#696819.
-->
<attribute name="Log4jQuietMode">true</attribute>
<!-- How frequently in seconds the ConfigurationURL is checked for changes -->
<attribute name="RefreshPeriod">60</attribute>
<attribute name="CatchSystemOut">true</attribute>
</mbean>
Now all your System.out.println messages will be written in server.log file that is in

server\default\log



This is in the reference of JBOSS version 4.2.3 GA