GIS View Error in NAT environment

Document ID : KB000005374
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

Launching  GIS view in NATted environment  you may get the following error:

“This page didn't load Google Maps correctly. See the JavaScript console for technical details” 

And in the console log you may see the following error:

 

Dec 21, 2016 12:50:19.113 - http://180.XXX.XXX.XXX:8080/spectrum/console/gisGC.config 
Dec 21, 2016 12:51:22.114 - class org.apache.jsp.console.gis_002dview_jspFile::gisGC.config is missing. 

Environment:
Any
Cause:

Customer is accessing to the OC Web page using an external IP address (eg. //http:180.xxx.xxx.xxx:8080/spectrum). In a NAT environment the ip address 180.xxx.xxx.xxx will be translated to the internal IP address eg. 21.xxx.xxx.xxx 

Now, when you click on GIS View the following piece of code of gis-view.jsp (from $SPECROOT\tomcat\webapps\spectrum\console) is executed:

String requestRestURL ; 
String requestURL = request.getRequestURL().toString(); 
String servletPath = request.getServletPath(); 
String appPath = requestURL.substring(0, requestURL.indexOf(servletPath)); 
InputStream inputStream = null; 
Properties prop = null; 
try{ 
String ipAdressesFile=appPath+"/console/gisGC.config"; 
URL url = new URL(ipAdressesFile);

 

In such environment the appPath will contain //http:180.xxx.xxx.xxx:8080/spectrum and this will cause the above mentioned error because the gisGC.config should be researched and opened on the local machine that has ip address 21.xxx.xxx.xxx and not 180.xxx.xxx.xxx

Resolution:

Modify the line 309 of $SPECROOT\tomcat\webapps\spectrum\console\gis-view.jsp

from

String appPath = requestURL.substring(0, requestURL.indexOf(servletPath)); 

to

String appPath = "http://localhost:8080/spectrum";

 

being sure to specify the correct OC Tomcat port. In the customer case it was 8080.