Open GoogleCodeExporter opened 9 years ago
Exception comming only when used with all dispatcher element like
<filter-mapping>
<filter-name>XForwardedFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
Changed filter-mapping element to
<filter-mapping>
<filter-name>XForwardedFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
will resolve it.
Original comment by ranjansu...@gmail.com
on 15 Feb 2011 at 6:10
[deleted comment]
The method "request.getRemoteAddr()" returned "null" instead of "a String
containing the IP address of the client that sent the request" (1).
Can you attach the full stacktrace to ease understanding this behavior. I see
two scenarios :
* a FORWARD or INCLUDE or ERROR dispatcher returns 'null',
* a custom filter returns null.
The normal usage should be to only associate the XForwardedFilter with the
REQUEST dispatcher.
(1)
http://download.oracle.com/javaee/5/api/javax/servlet/ServletRequest.html#getRem
oteAddr()
Original comment by cyrille....@gmail.com
on 21 Feb 2011 at 10:24
stacktrace attached.
Original comment by ranjansu...@gmail.com
on 23 Feb 2011 at 1:13
Attachments:
Can you enable "fr.xebia.servlet.filter.XForwardedFilter" logs to see what
remoteAddr is set by the last XForwardedForFilter execution that does not break
(1) ?
The important information is the "newRemoteAddr" of the debug line :
"Incoming request ... will be seen as newRemoteAddr='...' ..."
1 :
http://code.google.com/p/xebia-france/issues/attachmentText?id=7&aid=-7830560026
493920097&name=stacktrace.txt&token=6f8311008b3dcdc5124b209eb17d4563#29
Original comment by cyrille....@gmail.com
on 3 Mar 2011 at 12:31
we are fine with only Dispatcher type "Request" which is not throwing any
error.But the major isssue is that it still not providing the correct Remote
IP.Is it possible to get the correct remote IP within a company network.
We tried with RemoteIpValve,XForwardedFilter.
Debug Log:
16:44:45,390 DEBUG [XForwardedFilter:769] Incoming request /c/portal/layout
with originalRemoteAddr '127.0.0.1', originalRemoteHost='127.0.0.1',
originalSecure='false', originalScheme='http', original[X-Forwarded-For]='null,
original[null]='null'
will be seen as newRemoteAddr='127.0.0.1', newRemoteHost='127.0.0.1',
newScheme='http', newSecure='false', new[X-Forwarded-For]='null,
new[X-Forwarded-By]='null'
Original comment by ranjansu...@gmail.com
on 3 Mar 2011 at 11:38
Reason why you don't have the correct remote ip address : the header
X-Forwarded-For is missing in the request ("original[X-Forwarded-For]='null'").
What is the layer in front of your java servlet container ?
apache+mod_proxy_http ?
Original comment by cyrille....@gmail.com
on 3 Mar 2011 at 3:32
Thanks a lot. I will work on this hint.
In testing environment its Liferay 6 + tomcat-6.0.29 only.
Original comment by ranjansu...@gmail.com
on 7 Mar 2011 at 5:35
Original issue reported on code.google.com by
ranjansu...@gmail.com
on 14 Feb 2011 at 1:52