最近在用Mac Pro做开发,一直好好地,直到有一天,项目上用了axis2来做Webservice的客户端,结果一运行,就出现了以下的异常:
java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0
*.local
^tokenid:null
at java.util.regex.Pattern.error(Pattern.java:1955)
at java.util.regex.Pattern.sequence(Pattern.java:2123)
at java.util.regex.Pattern.expr(Pattern.java:1996)
at java.util.regex.Pattern.compile(Pattern.java:1696)
at java.util.regex.Pattern.<init>(Pattern.java:1351)
at java.util.regex.Pattern.compile(Pattern.java:1028)
at java.util.regex.Pattern.matches(Pattern.java:1133)
at java.lang.String.matches(String.java:2109)
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)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:374)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at com.wondersgroup.cuteinfo.client.auth.IAuthenServiceServiceStub.authenticate(IAuthenServiceServiceStub.java:436)
at com.wondersgroup.cuteinfo.client.util.UserTokenUtils.getTicket(UserTokenUtils.java:32)
at cuteinfo.demo.NStest.main(NStest.java:52)
com.wondersgroup.cuteinfo.client.exchangeserver.exchangetransport.exception.UMessageTransportException: User info is invalid.
at com.wondersgroup.cuteinfo.client.exchangeserver.exchangetransport.impl.UMessageTransporterDAOImpl.send(UMessageTransporterDAOImpl.java:197)
at cuteinfo.demo.NStest.main(NStest.java:78)
是在没办法,只好拿来源码,跟踪一下,看看到底什么缘故。
结果,发现是出错在,apache读取mac 本机的网络代理信息的时候。于是,灵光一闪,打开了MAC的网络代理设置,发现,居然是这样滴:
看来问题的源头就是在这里了。试着把里面的配置清空,保存。
在运行程序,一切正常,问题解决了。