java 开发的webservice 接口,程序启动时抛出如下异常:
WARN [apache.cxf.ws.discovery.WSDiscoveryService] - Could not start WS-Discovery Service.
javax.xml.ws.WebServiceException: java.lang.RuntimeException: java.net.SocketException: bad argument for IP_MULTICAST_IF2
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:371)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:251)
at org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl.startup(WSDiscoveryServiceImpl.java:248)
at org.apache.cxf.ws.discovery.internal.WSDiscoveryServiceImpl.serverStarted(WSDiscoveryServiceImpl.java:154)
at org.apache.cxf.ws.discovery.listeners.WSDiscoveryServerListener.startServer(WSDiscoveryServerListener.java:73)
at org.apache.cxf.bus.managers.ServerLifeCycleManagerImpl.startServer(ServerLifeCycleManagerImpl.java:61)
at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:136)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:215)
at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod
虽然不影响程序的运行,但是看着别扭。查了半天解决方案都不好使。
失败方案一:修改eclipse配置: Windows - preferences - java - installed jres - 编辑 Default VM arguments 的值为 -Djava.net.preferIPv4Stack=true
失败方案二:编辑Tomcat catalina.bat 文件
设置 set CATALINA_OPTS=-Djava.net.preferIPv4Stack = true
正确的方案还在寻觅中。。。