Flash Forward: 3 days already trying to troubleshooting the java code for “PrivilegedActionException” Exception , it turns out it is one parameter in Glassfish that needs to be properly adjusted.
Lets go back from the beginning: 3 days ago I was writing a JEE enterprise applciation , simply a webpage that retrieves data from a DB2 database and then based on a user’s choice it call a webservice for some of the records in the result-set.
I followed GlassFish-Developer’s-guide to call an WS-RPC webservice. the server providing this WS-RPC is somewhere located inside our enterprise network.
Now one thing you need to consider: WS-RPC is outdated, but still some old applications use it, even on the internet!
Now back to our story: after developing the code to call an WS-RPC using the above guide, I get this strange behaviour:
1) When calling the WS through TCPMON – located in the localhost- which then re-routes the data to the ws-server inside our organization network, everything goes fine, and the expected result is retrieved.
2) When attempting to call the ws-server directly, I get this error message:
com.sun.xml.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Bad response: (503Service Unavailable ....
3) troubleshooting this further, showed that if I insert the wrong server-name, I get the same error. (hmmm. somehow the server is unreachable).
4) When building a parallel test application on the same server that calls the Internet-NOAA-RPC-Service , everything works fine.
from 1,2,3 : I thought thet maybe Glassfish needs some-kind of security settings to allow Glassfish to call the outside world.
But on the 3rd day of troubleshooting, I tried number 4, which proved that the problem is not about calling the outside world of Glassfish.
I googled “Glassfish proxy” and found I could change the settings by manipulating domain1.xml with the following lines:
If you misconfigure that list of servers/domains, the application (GlassFish) will reach proxy server to locate myEnterpriseServer.com (which is not the server you actually want- and does not exist on the internet).
Please comment, if you find this information useful .