Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 3.1, 3.2
-
Fix Version/s: 3.2
-
Component/s: Sample Apps, Tool Integrations
-
Labels:None
-
Environment:any
Description
It was found that httpRequest.getLocalName() in the SourceCodeLoaderConnection.java was returning an 0:0.0:0.0:0.0:1 for the device's IP address in environment, which have 2 nic interfaces and one of them is not bound to any ip. so that the contructed URL is a malformated one.
Activity
Migration
created issue -
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #31980 | Mon Nov 05 10:03:20 MST 2012 | liming.wu | |
Files Changed | ||||
MODIFY
/icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/java/org/icefaces/samples/showcase/util/SourceCodeLoaderConnection.java
|
Migration
made changes -
Field | Original Value | New Value |
---|---|---|
Reporter | Migration [ remote ] | Liming Wu [ liming.wu ] |
Migration
made changes -
Assignee | Liming Wu [ liming.wu ] | |
Description |
It was found that httpRequest.getLocalName() in the SourceCodeLoaderConnection.java was returning an 0:0.0:0.0:0.0:1 for the device's IP address in environment, which have 2 nic interfaces and one of them is not bound to any ip. so that the contructed URL is a malformated one. By looking the source and noticed the url SOURCE_SERVLET_URL is constructed by httpRequest.getLocalName() as shown: SOURCE_SERVLET_URL = "http://" + httpRequest.getLocalName() + ":" + httpRequest.getLocalPort() + httpRequest.getContextPath() + "/"; This is not reliable as getLocalName() may not return something url friendly. due to various native layer variations. It should be replaced by String hostName = "localhost"; try { URL requestUrl = new URL(httpRequest.getRequestURL().toString()); hostName = requestUrl.getHost(); } catch (MalformedURLException mfException) {} SOURCE_SERVLET_URL = "http://" + hostName + ":" + httpRequest.getLocalPort() + httpRequest.getContextPath() + "/"; |
It was found that httpRequest.getLocalName() in the SourceCodeLoaderConnection.java was returning an 0:0.0:0.0:0.0:1 for the device's IP address in environment, which have 2 nic interfaces and one of them is not bound to any ip. so that the contructed URL is a malformated one. |
Migration
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Ken Fyten
made changes -
Fix Version/s | 3.2 [ 10338 ] |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
By looking the source and noticed the url SOURCE_SERVLET_URL is constructed by httpRequest.getLocalName() as shown:
SOURCE_SERVLET_URL = "http://" +
httpRequest.getLocalName() +
":" +
httpRequest.getLocalPort() +
httpRequest.getContextPath() +
"/";
This is not reliable as getLocalName() may not return something url friendly. due to various native layer variations. It should be replaced by
String hostName = "localhost";
{ URL requestUrl = new URL(httpRequest.getRequestURL().toString()); hostName = requestUrl.getHost(); } catch (MalformedURLException mfException) {}try
SOURCE_SERVLET_URL = "http://" +
hostName +
":" +
httpRequest.getLocalPort() +
httpRequest.getContextPath() +
"/";
ICE-8340is not related to this issue but the improvement forICE-8340happens in the same code block.was:
It was found that httpRequest.getLocalName() in the SourceCodeLoaderConnection.java was returning an 0:0.0:0.0:0.0:1 for the device's IP address in environment, which have 2 nic interfaces and one of them is not bound to any ip. so that the contructed URL is a malformated one.
By looking the source and noticed the url SOURCE_SERVLET_URL is constructed by httpRequest.getLocalName() as shown:
SOURCE_SERVLET_URL = "http://" +
httpRequest.getLocalName() +
":" +
httpRequest.getLocalPort() +
httpRequest.getContextPath() +
"/";
This is not reliable as getLocalName() may not return something url friendly. due to various native layer variations. It should be replaced by
String hostName = "localhost";
try { URL requestUrl = new URL(httpRequest.getRequestURL().toString()); hostName = requestUrl.getHost(); }
catch (MalformedURLException mfException) {}
SOURCE_SERVLET_URL = "http://" +
hostName +
":" +
httpRequest.getLocalPort() +
httpRequest.getContextPath() +
"/";