Are you running JBoss AS as a service or from a command line? If as a service, what account are you using (system?)
On taligentportal, in the Local Security Policy, turn on "Audit account logon events". Then run the code and look at what events show up in the Security log. The events should tell you which user is attempting to access the file. Especially note any differences between when you can successfully access the file from a standalone app and cannot access from within jboss. (You might have to restart the machines to flush out any existing connections between the machines.)
And no, there is nothing in JBoss that is preventing this, this is all OS-related (could be firewall, login account, or any other of a multitude of things).
I will look and let you know.
I have checked sharing and security properties of DMDOCSERVER folder on TALIGENTPORTAL machine.
Under Security tab, I have ticked the check box "Allow inheritable permissions form parent to propagate to this object", which was not ticked previously.
After applying the changes when I started my application, my code works fine.
Thanks for your suggestion. It cleared my doubts.