0

We are running a Java 5 EE web app on Weblogic 10.3.6 and are having issues with the dev environment that doesn't show up in our local, near-identical environment.

The issue is that we are trying to incorporate a 3rd party library called CSRFGuard, and it works fine locally but fails to deploy on the dev server. I put in some debugging code and the line where it fails is this:

String fileName = context.getRealPath(resourceName);

resourceName in this case is the string 'WEB-INF/Owasp.CsrfGuard.properties' which corresponds with a file named Owasp.CsrfGuard.properties located in the WEB-INF folder.

Locally, the call returns "C:\deployment\myapp.ear\mywebapp.war\WEB-INF\Owasp.CsrfGuard.properties" but on the dev server it returns null. I unpacked the EAR file on the dev server, and sure enough, the file is there. What am I doing wrong?

wlaem
  • 304
  • 1
  • 3
  • 13
  • Are you deploying an exploded WAR? – The Head Rush Jul 22 '16 at 18:38
  • 3
    have u checked this link , it looks similar to your problem [http://stackoverflow.com/questions/536228/why-does-getrealpath-return-null-when-deployed-with-a-war-file](http://stackoverflow.com/questions/536228/why-does-getrealpath-return-null-when-deployed-with-a-war-file) – Rishal Jul 22 '16 at 18:41
  • Yes, I actually found that right after I posted this. It did indeed fix the issue. I changed the weblogic config to check the "Archived Real Path Enabled" checkbox. – wlaem Jul 22 '16 at 20:12

0 Answers0