[
https://issues.apache.org/jira/browse/AXIS2-3146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12559848#action_12559848
]
David Poon commented on AXIS2-3146:
-----------------------------------
We have the same issue. Axis2 1.3, Solaris 8, IBM WebSphere Application Server
v6.0.x.
We use Commons HttpClient for other things that require http.nonProxyHosts to
be defined where the asterisk ("*") is used in host names as a wildcard
character as permitted by Commons HttpClient.
However, axis2's ProxyConfiguration.validateNonProxyHosts() method chose to use
java.util.regex to validate the hostnames; but under java.util.regex, "*" alone
is not a valid regular expression. So Axis2's use of java.util.regex is
fundamentally incompatible with the format used by Commons HttpClient.
The suggested fix of appending "\\w" above does not cater for all types of
domain/hostnames. Eg, we have domain names with the hypen character ("-"). So
using dot "." would be better.
This bug is a blocker for us. we cannot use axis2 in production.
> Axis client fails if http.nonProxyHosts contains * as wildcard
> --------------------------------------------------------------
>
> Key: AXIS2-3146
> URL: https://issues.apache.org/jira/browse/AXIS2-3146
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: transports
> Affects Versions: 1.3
> Environment: Websphere with jdk 1.4.2 / local XP machine with java5
> Reporter: Bernd Frey
> Assignee: Saminda Wishwajith Abeyruwan
> Priority: Critical
>
> I get the following error if I have defined
> -Dhttp.nonProxyHosts=yyy|mbfq0202|*.epu.mycorp.com:
> java.util.regex.PatternSyntaxException: Dangling meta character '*' near
> index 0
> *.epu.mycorp.com
> ^
> at java.util.regex.Pattern.error(Pattern.java:1650)
> at java.util.regex.Pattern.sequence(Pattern.java:1787)
> at java.util.regex.Pattern.expr(Pattern.java:1687)
> at java.util.regex.Pattern.compile(Pattern.java:1397)
> at java.util.regex.Pattern.<init>(Pattern.java:1124)
> at java.util.regex.Pattern.compile(Pattern.java:817)
> at java.util.regex.Pattern.matches(Pattern.java:919)
> at java.lang.String.matches(String.java:1921)
> at
> org.apache.axis2.transport.http.ProxyConfiguration.validateNonProxyHosts(ProxyConfiguration.java:261)
> at
> org.apache.axis2.transport.http.ProxyConfiguration.isProxyEnabled(ProxyConfiguration.java:223)
> at
> org.apache.axis2.transport.http.AbstractHTTPSender.getHostConfiguration(AbstractHTTPSender.java:271)
> at
> org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:502)
> at
> org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:191)
> at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
> at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:327)
> at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:206)
> at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:396)
> ...
> the problem is Axis2 does a String.match on "*.epu.mycorp.com" in
> ProxyConfiguration.validateNonProxyHosts. This must fail because
> "*.epu.mycorp.com" is a valid entry for http.nonProxyHosts, but it is not a
> valid regexp.
> I suggest to add
> for (int i=0; i<nonProxyHostsArray.length; i++) {
> if (nonProxyHostsArray[i].startsWith("*")) {
> nonProxyHostsArray[i] = "\\w" + nonProxyHostsArray[i];
> }
> }
> after
> String[] nonProxyHostsArray = nonProxyHosts.split("\\|");
>
> Bernd
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]