Monday, July 20, 2009

getRealPath returns Null on WebLogic Server

Applications that were running ok on Tomcat/Jetty would return a Null for ServletContext.getRealPath() when deployed on weblogic server.

The reason is, Tomcat implementation would explode the WAR upon deployment, where as weblogic doesn't.

To get things working irrespective of archive/explode, we are better off using ServletContext.getResourceAsStream()