I've used JAXWS-RI 2.1 to create an interface for my web service, based on a WSDL. I can interact with the web service no problems, but haven't been able to specify a timeout for sending requests to the web service. If for some reason it does not respond the client just seems to spin it's wheels forever.

Hunting around has revealed that I should probably be trying to do something like this:

((BindingProvider)myInterface).getRequestContext().put("com.sun.xml.ws.request.timeout", 10000);
((BindingProvider)myInterface).getRequestContext().put("com.sun.xml.ws.connect.timeout", 10000);

I also discovered that, depending on which version of JAXWS-RI you have, you may need to set these properties instead:

((BindingProvider)myInterface).getRequestContext().put("com.sun.xml.internal.ws.request.timeout", 10000);
((BindingProvider)myInterface).getRequestContext().put("com.sun.xml.internal.ws.connect.timeout", 10000);

The problem I have is that, regardless of which of the above is correct, I don't know where I can do this. All I've got is a Service subclass that implements the auto-generated interface to the webservice and at the point that this is getting instanciated, if the WSDL is non-responsive then it's already too late to set the properties:

MyWebServiceSoap soap;
MyWebService service = new MyWebService("http://www.google.com");
soap = service.getMyWebServiceSoap();
soap.sendRequestToMyWebService();

Can anyone point me in the right direction?!

asked Jan 27 '10 at 17:21
ninesided

16.4k1265103
 
5  
I don't think I have an answer for you, but your question helped me solve my problem. I knew about the com.sun.xml.ws.request.timeout property but not about the com.sun.xml.internal.ws.request.timeout one. – Ron Tuffin Jun 10 '10 at 11:43

7 Answers

I know this is old and answered elsewhere but hopefully this closes this down. I'm not sure why you would want to download the WSDL dynamically but the system properties:

sun.net.client.defaultConnectTimeout (default: -1 (forever))
sun.net.client.defaultReadTimeout (default: -1 (forever))

should apply to all reads and connects using HttpURLConnection which JAX-WS uses. This should solve your problem if you are getting the WSDL from a remote location - but a file on your local disk is probably better!

Next, if you want to set timeouts for specific services, once you've created your proxy you need to cast it to a BindingProvider (which you know already), get the request context and set your properties. The online JAX-WS documentation is wrong, these are the correct property names (well, they work for me).

MyInterface myInterface = new MyInterfaceService().getMyInterfaceSOAP();
Map<String, Object> requestContext = ((BindingProvider)myInterface).getRequestContext();
requestContext.put(BindingProviderProperties.REQUEST_TIMEOUT, 3000); // Timeout in millis
requestContext.put(BindingProviderProperties.CONNECT_TIMEOUT, 1000); // Timeout in millis
myInterface.callMyRemoteMethodWith(myParameter);

Of course, this is a horrible way to do things, I would create a nice factory for producing these binding providers that can be injected with the timeouts you want.

answered Oct 3 '10 at 22:11
alpian

3,5981118
 
6  
Note that the REQUEST_TIMEOUT / CONNECT_TIMEOUT properties are actually inherited from the SUN-internal class com.sun.xml.internal.ws.developer.JAXWSProperties and (at least on 32-bit Linux) javac 1.6.0_27 and javac 1.7.0_03 fail to compile this code (similar to bugs.sun.com/view_bug.do?bug_id=6544224)... you need to pass -XDignore.symbol.file to javac to make it work. – JavaGuy Mar 9 '12 at 18:23 
2  
This doesn't seem work at all. – Arne Evertsson Nov 13 '12 at 15:28
    
What doesn't work? I just double checked this and it is working for me. – alpian Nov 13 '12 at 15:31 
    
Just confirming that I just used this with JAX-WS RI 2.2.8 and JDK 1.7 and it worked just fine. Thank You! – bconneen Jun 10 '14 at 18:20
1  
@Matt1776 yes of course it's missing: while JAX-WS is an API specification, you need a library implementation, in this case jaxws-ri.jar or jaxws-rt.jar, which is not part of the JDK. You just need to download and add it to your ptoject and you'll have those properties available. – polaretto Jan 19 at 11:53
 

The properties in the accepted answer did not work for me, possibly because I'm using the JBoss implementation of JAX-WS?

Using a different set of properties (found in the JBoss JAX-WS User Guide) made it work:

//Set timeout until a connection is established
((BindingProvider)port).getRequestContext().put("javax.xml.ws.client.connectionTimeout", "6000"); //Set timeout until the response is received
((BindingProvider) port).getRequestContext().put("javax.xml.ws.client.receiveTimeout", "1000");
answered Aug 6 '14 at 4:45
jwaddell

94111127
 
1  
I am not using JBoss, but only the properties in this comment worked for me, nothing else did. – PaulP Mar 25 '15 at 21:29
1  
The property names depend on the JAX-WS implementation. A list can be found here:java.net/jira/browse/JAX_WS-1166 – fabstab Jan 28 at 10:39 

Here is my working solution :

// --------------------------
// SOAP Message creation
// --------------------------
SOAPMessage sm = MessageFactory.newInstance().createMessage();
sm.setProperty(SOAPMessage.WRITE_XML_DECLARATION, "true");
sm.setProperty(SOAPMessage.CHARACTER_SET_ENCODING, "UTF-8"); SOAPPart sp = sm.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
se.setEncodingStyle("http://schemas.xmlsoap.org/soap/encoding/");
se.setAttribute("xmlns:SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/");
se.setAttribute("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
se.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); SOAPBody sb = sm.getSOAPBody();
//
// Add all input fields here ...
// SOAPConnection connection = SOAPConnectionFactory.newInstance().createConnection();
// -----------------------------------
// URL creation with TimeOut connexion
// -----------------------------------
URL endpoint = new URL(null,
"http://myDomain/myWebService.php",
new URLStreamHandler() { // Anonymous (inline) class
@Override
protected URLConnection openConnection(URL url) throws IOException {
URL clone_url = new URL(url.toString());
HttpURLConnection clone_urlconnection = (HttpURLConnection) clone_url.openConnection();
// TimeOut settings
clone_urlconnection.setConnectTimeout(10000);
clone_urlconnection.setReadTimeout(10000);
return(clone_urlconnection);
}
}); try {
// -----------------
// Send SOAP message
// -----------------
SOAPMessage retour = connection.call(sm, endpoint);
}
catch(Exception e) {
if ((e instanceof com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl) && (e.getCause()!=null) && (e.getCause().getCause()!=null) && (e.getCause().getCause().getCause()!=null)) {
System.err.println("[" + e + "] Error sending SOAP message. Initial error cause = " + e.getCause().getCause().getCause());
}
else {
System.err.println("[" + e + "] Error sending SOAP message."); }
}
answered Dec 1 '10 at 10:05
vnoel

6911
 
ProxyWs proxy = (ProxyWs) factory.create();
Client client = ClientProxy.getClient(proxy);
HTTPConduit http = (HTTPConduit) client.getConduit();
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setConnectionTimeout(0);
httpClientPolicy.setReceiveTimeout(0);
http.setClient(httpClientPolicy);

This worked for me.

answered Jul 14 '11 at 21:37
Daniel Kaplan

26.6k1094161
 
    
Thanks! For me too, it's a really easy way – kosm Apr 9 '14 at 10:18
2  
This uses Apache CXF classes though, it might be best to add this in the answer. A link to which CXF jars contain them would also help a lot. – JBert Dec 8 '14 at 17:05
    
@JBert I agree. I answered this years ago and can't remember. Feel free to edit the answer. – Daniel KaplanDec 9 '14 at 6:10

If you are using JAX-WS on JDK6, use the following properties:

com.sun.xml.internal.ws.connect.timeout
com.sun.xml.internal.ws.request.timeout
answered Nov 15 '10 at 17:35
dometec

33125
 

Not sure if this will help in your context...

Can the soap object be cast as a BindingProvider ?

MyWebServiceSoap soap;
MyWebService service = new MyWebService("http://www.google.com");
soap = service.getMyWebServiceSoap();
// set timeouts here
((BindingProvider)soap).getRequestContext().put("com.sun.xml.internal.ws.request.timeout", 10000);
soap.sendRequestToMyWebService();

On the other hand if you are wanting to set the timeout on the initialization of the MyWebService object then this will not help.

This worked for me when wanting to timeout the individual WebService calls.

answered Jun 10 '10 at 11:47
Ron Tuffin

15.7k165070
 
    
I am a complete noob at this webServices thing, so... – Ron Tuffin Jun 10 '10 at 11:48

the easiest way to avoid slow retrieval of the remote WSDL when you instantiate your SEI is to not retrieve the WSDL from the remote service endpoint at runtime.

this means that you have to update your local WSDL copy any time the service provider makes an impacting change, but it also means that you have to update your local copy any time the service provider makes an impacting change.

When I generate my client stubs, I tell the JAX-WS runtime to annotate the SEI in such a way that it will read the WSDL from a pre-determined location on the classpath. by default the location is relative to the package location of the Service SEI


<wsimport
sourcedestdir="${dao.helter.dir}/build/generated"
destdir="${dao.helter.dir}/build/bin/generated"
wsdl="${dao.helter.dir}/src/resources/schema/helter/helterHttpServices.wsdl"
wsdlLocation="./wsdl/helterHttpServices.wsdl"
package="com.helter.esp.dao.helter.jaxws"
>
<binding dir="${dao.helter.dir}/src/resources/schema/helter" includes="*.xsd"/>
</wsimport>
<copy todir="${dao.helter.dir}/build/bin/generated/com/helter/esp/dao/helter/jaxws/wsdl">
<fileset dir="${dao.helter.dir}/src/resources/schema/helter" includes="*" />
</copy>

the wsldLocation attribute tells the SEI where is can find the WSDL, and the copy makes sure that the wsdl (and supporting xsd.. etc..) is in the correct location.

since the location is relative to the SEI's package location, we create a new sub-package (directory) called wsdl, and copy all the wsdl artifacts there.

all you have to do at this point is make sure you include all *.wsdl, *.xsd in addition to all *.class when you create your client-stub artifact jar file.

(in case your curious, the @webserviceClient annotation is where this wsdl location is actually set in the java code

@WebServiceClient(name = "httpServices", targetNamespace = "http://www.helter.com/schema/helter/httpServices", wsdlLocation = "./wsdl/helterHttpServices.wsdl")
answered Jun 25 '10 at 20:33
 

protected by Community♦ Oct 3 '13 at 11:30

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged java web-services soap timeout jax-ws or ask your own question.

I've used JAXWS-RI 2.1 to create an interface for my web service, based on a WSDL. I can interact with the web service no problems, but haven't been able to specify a timeout for sending requests to the web service. If for some reason it does not respond the client just seems to spin it's wheels forever.

Hunting around has revealed that I should probably be trying to do something like this:

((BindingProvider)myInterface).getRequestContext().put("com.sun.xml.ws.request.timeout", 10000);
((BindingProvider)myInterface).getRequestContext().put("com.sun.xml.ws.connect.timeout", 10000);

I also discovered that, depending on which version of JAXWS-RI you have, you may need to set these properties instead:

((BindingProvider)myInterface).getRequestContext().put("com.sun.xml.internal.ws.request.timeout", 10000);
((BindingProvider)myInterface).getRequestContext().put("com.sun.xml.internal.ws.connect.timeout", 10000);

The problem I have is that, regardless of which of the above is correct, I don't know where I can do this. All I've got is a Service subclass that implements the auto-generated interface to the webservice and at the point that this is getting instanciated, if the WSDL is non-responsive then it's already too late to set the properties:

MyWebServiceSoap soap;
MyWebService service = new MyWebService("http://www.google.com");
soap = service.getMyWebServiceSoap();
soap.sendRequestToMyWebService();

Can anyone point me in the right direction?!

asked Jan 27 '10 at 17:21
ninesided

16.4k1265103
 
5  
I don't think I have an answer for you, but your question helped me solve my problem. I knew about the com.sun.xml.ws.request.timeout property but not about the com.sun.xml.internal.ws.request.timeout one. – Ron Tuffin Jun 10 '10 at 11:43

7 Answers

I know this is old and answered elsewhere but hopefully this closes this down. I'm not sure why you would want to download the WSDL dynamically but the system properties:

sun.net.client.defaultConnectTimeout (default: -1 (forever))
sun.net.client.defaultReadTimeout (default: -1 (forever))

should apply to all reads and connects using HttpURLConnection which JAX-WS uses. This should solve your problem if you are getting the WSDL from a remote location - but a file on your local disk is probably better!

Next, if you want to set timeouts for specific services, once you've created your proxy you need to cast it to a BindingProvider (which you know already), get the request context and set your properties. The online JAX-WS documentation is wrong, these are the correct property names (well, they work for me).

MyInterface myInterface = new MyInterfaceService().getMyInterfaceSOAP();
Map<String, Object> requestContext = ((BindingProvider)myInterface).getRequestContext();
requestContext.put(BindingProviderProperties.REQUEST_TIMEOUT, 3000); // Timeout in millis
requestContext.put(BindingProviderProperties.CONNECT_TIMEOUT, 1000); // Timeout in millis
myInterface.callMyRemoteMethodWith(myParameter);

Of course, this is a horrible way to do things, I would create a nice factory for producing these binding providers that can be injected with the timeouts you want.

answered Oct 3 '10 at 22:11
alpian

3,5981118
 
6  
Note that the REQUEST_TIMEOUT / CONNECT_TIMEOUT properties are actually inherited from the SUN-internal class com.sun.xml.internal.ws.developer.JAXWSProperties and (at least on 32-bit Linux) javac 1.6.0_27 and javac 1.7.0_03 fail to compile this code (similar to bugs.sun.com/view_bug.do?bug_id=6544224)... you need to pass -XDignore.symbol.file to javac to make it work. – JavaGuy Mar 9 '12 at 18:23 
2  
This doesn't seem work at all. – Arne Evertsson Nov 13 '12 at 15:28
    
What doesn't work? I just double checked this and it is working for me. – alpian Nov 13 '12 at 15:31 
    
Just confirming that I just used this with JAX-WS RI 2.2.8 and JDK 1.7 and it worked just fine. Thank You! – bconneen Jun 10 '14 at 18:20
1  
@Matt1776 yes of course it's missing: while JAX-WS is an API specification, you need a library implementation, in this case jaxws-ri.jar or jaxws-rt.jar, which is not part of the JDK. You just need to download and add it to your ptoject and you'll have those properties available. – polaretto Jan 19 at 11:53
 

The properties in the accepted answer did not work for me, possibly because I'm using the JBoss implementation of JAX-WS?

Using a different set of properties (found in the JBoss JAX-WS User Guide) made it work:

//Set timeout until a connection is established
((BindingProvider)port).getRequestContext().put("javax.xml.ws.client.connectionTimeout", "6000"); //Set timeout until the response is received
((BindingProvider) port).getRequestContext().put("javax.xml.ws.client.receiveTimeout", "1000");
answered Aug 6 '14 at 4:45
jwaddell

94111127
 
1  
I am not using JBoss, but only the properties in this comment worked for me, nothing else did. – PaulP Mar 25 '15 at 21:29
1  
The property names depend on the JAX-WS implementation. A list can be found here:java.net/jira/browse/JAX_WS-1166 – fabstab Jan 28 at 10:39 

Here is my working solution :

// --------------------------
// SOAP Message creation
// --------------------------
SOAPMessage sm = MessageFactory.newInstance().createMessage();
sm.setProperty(SOAPMessage.WRITE_XML_DECLARATION, "true");
sm.setProperty(SOAPMessage.CHARACTER_SET_ENCODING, "UTF-8"); SOAPPart sp = sm.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
se.setEncodingStyle("http://schemas.xmlsoap.org/soap/encoding/");
se.setAttribute("xmlns:SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/");
se.setAttribute("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
se.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); SOAPBody sb = sm.getSOAPBody();
//
// Add all input fields here ...
// SOAPConnection connection = SOAPConnectionFactory.newInstance().createConnection();
// -----------------------------------
// URL creation with TimeOut connexion
// -----------------------------------
URL endpoint = new URL(null,
"http://myDomain/myWebService.php",
new URLStreamHandler() { // Anonymous (inline) class
@Override
protected URLConnection openConnection(URL url) throws IOException {
URL clone_url = new URL(url.toString());
HttpURLConnection clone_urlconnection = (HttpURLConnection) clone_url.openConnection();
// TimeOut settings
clone_urlconnection.setConnectTimeout(10000);
clone_urlconnection.setReadTimeout(10000);
return(clone_urlconnection);
}
}); try {
// -----------------
// Send SOAP message
// -----------------
SOAPMessage retour = connection.call(sm, endpoint);
}
catch(Exception e) {
if ((e instanceof com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl) && (e.getCause()!=null) && (e.getCause().getCause()!=null) && (e.getCause().getCause().getCause()!=null)) {
System.err.println("[" + e + "] Error sending SOAP message. Initial error cause = " + e.getCause().getCause().getCause());
}
else {
System.err.println("[" + e + "] Error sending SOAP message."); }
}
answered Dec 1 '10 at 10:05
vnoel

6911
 
ProxyWs proxy = (ProxyWs) factory.create();
Client client = ClientProxy.getClient(proxy);
HTTPConduit http = (HTTPConduit) client.getConduit();
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setConnectionTimeout(0);
httpClientPolicy.setReceiveTimeout(0);
http.setClient(httpClientPolicy);

This worked for me.

answered Jul 14 '11 at 21:37
Daniel Kaplan

26.6k1094161
 
    
Thanks! For me too, it's a really easy way – kosm Apr 9 '14 at 10:18
2  
This uses Apache CXF classes though, it might be best to add this in the answer. A link to which CXF jars contain them would also help a lot. – JBert Dec 8 '14 at 17:05
    
@JBert I agree. I answered this years ago and can't remember. Feel free to edit the answer. – Daniel KaplanDec 9 '14 at 6:10

If you are using JAX-WS on JDK6, use the following properties:

com.sun.xml.internal.ws.connect.timeout
com.sun.xml.internal.ws.request.timeout
answered Nov 15 '10 at 17:35
dometec

33125
 

Not sure if this will help in your context...

Can the soap object be cast as a BindingProvider ?

MyWebServiceSoap soap;
MyWebService service = new MyWebService("http://www.google.com");
soap = service.getMyWebServiceSoap();
// set timeouts here
((BindingProvider)soap).getRequestContext().put("com.sun.xml.internal.ws.request.timeout", 10000);
soap.sendRequestToMyWebService();

On the other hand if you are wanting to set the timeout on the initialization of the MyWebService object then this will not help.

This worked for me when wanting to timeout the individual WebService calls.

answered Jun 10 '10 at 11:47
Ron Tuffin

15.7k165070
 
    
I am a complete noob at this webServices thing, so... – Ron Tuffin Jun 10 '10 at 11:48

the easiest way to avoid slow retrieval of the remote WSDL when you instantiate your SEI is to not retrieve the WSDL from the remote service endpoint at runtime.

this means that you have to update your local WSDL copy any time the service provider makes an impacting change, but it also means that you have to update your local copy any time the service provider makes an impacting change.

When I generate my client stubs, I tell the JAX-WS runtime to annotate the SEI in such a way that it will read the WSDL from a pre-determined location on the classpath. by default the location is relative to the package location of the Service SEI


<wsimport
sourcedestdir="${dao.helter.dir}/build/generated"
destdir="${dao.helter.dir}/build/bin/generated"
wsdl="${dao.helter.dir}/src/resources/schema/helter/helterHttpServices.wsdl"
wsdlLocation="./wsdl/helterHttpServices.wsdl"
package="com.helter.esp.dao.helter.jaxws"
>
<binding dir="${dao.helter.dir}/src/resources/schema/helter" includes="*.xsd"/>
</wsimport>
<copy todir="${dao.helter.dir}/build/bin/generated/com/helter/esp/dao/helter/jaxws/wsdl">
<fileset dir="${dao.helter.dir}/src/resources/schema/helter" includes="*" />
</copy>

the wsldLocation attribute tells the SEI where is can find the WSDL, and the copy makes sure that the wsdl (and supporting xsd.. etc..) is in the correct location.

since the location is relative to the SEI's package location, we create a new sub-package (directory) called wsdl, and copy all the wsdl artifacts there.

all you have to do at this point is make sure you include all *.wsdl, *.xsd in addition to all *.class when you create your client-stub artifact jar file.

(in case your curious, the @webserviceClient annotation is where this wsdl location is actually set in the java code

@WebServiceClient(name = "httpServices", targetNamespace = "http://www.helter.com/schema/helter/httpServices", wsdlLocation = "./wsdl/helterHttpServices.wsdl")
answered Jun 25 '10 at 20:33
 

protected by Community♦ Oct 3 '13 at 11:30

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged java web-services soap timeout jax-ws or ask your own question.

How do I set the timeout for a JAX-WS webservice client?的更多相关文章

  1. [转]Webservice client timeout

    本文转自:http://social.msdn.microsoft.com/Forums/vstudio/en-us/ed89ae3c-e5f8-401b-bcc7-333579a9f0fe/webs ...

  2. Zookeeper中Session Timeout的那些事

    前言: RDS系统致力于MySQL数据的高可用,高可靠,高性能以及在线扩展功能,实现这些特性的主要逻辑功能都运行在管理服务器上,一旦管理服务器宕机,数据库的在线扩展功能/备份功能/故障恢复功能等都无从 ...

  3. golang http Specifically check for timeout error

    Specifically check for timeout error 特异性识别 golang http client 的超时错误 package main import ( "fmt& ...

  4. 关于无线的Idle Timeout和Session Timeout

    1.Session Timeout Session Timer的默认值为1800s,也就是30min.Session Timeout:当该计时器超时时,使得客户端强制发生重认证,这个时间是从客户端认证 ...

  5. Nginx的超时timeout配置详解

    Nginx的超时timeout配置详解 本文介绍 Nginx 的 超时(timeout)配置. Nginx 处理的每个请求均有相应的超时设置.如果做好这些超时时间的限定,判定超时后资源被释放,用来处理 ...

  6. Atitit onvif协议获取rtsp地址播放java语言 attilx总结

    Atitit onvif协议获取rtsp地址播放java语言 attilx总结 1.1. 获取rtsp地址的算法与流程1 1.2. Onvif摄像头的发现,ws的发现机制,使用xcf类库1 2. 调用 ...

  7. python sokct 包详解

    1. getaddrinfo简介getaddrinfo可解析得到IPv6地址,而gethostbyname仅能得到IPv4地址.getaddrinfo在Python的socket包中,以下为pytho ...

  8. Mosquitto pub/sub服务实现代码浅析-主体框架

    Mosquitto 是一个IBM 开源pub/sub订阅发布协议 MQTT 的一个单机版实现(目前也只有单机版),MQTT主打轻便,比较适用于移动设备等上面,花费流量少,解析代价低.相对于XMPP等来 ...

  9. Atitit webservice的发现机制 discover机制

    Atitit webservice的发现机制 discover机制 1.1. Ws disconvert 的组播地址和端口就是37021 1.2. Ws disconvert的发现机制建立在udp组播 ...

随机推荐

  1. 【Luogu】P2258子矩阵(状态压缩,DP)

    233今天蒟蒻我连文化课都没听光想着这个了 然后我调了一下午终于过了!!! 一看数据范围似乎是状压,然而216等于65536.开一个65536*65536的二维数组似乎不太现实. 所以Rqy在四月还是 ...

  2. 【CCF】交通规划 Dijstra变形 优先级队列重载

    [题意] 给定一个无向图,求这个图满足所有点到顶点的最短路径不变的最小生成树 [AC] 注意双向边要开2*maxm 注意优先级队列 参考https://www.cnblogs.com/cielosun ...

  3. Java的反射机制和动态代理

    介绍Java注解的时候,多次提到了Java的反射API.与javax.lang.model不同的是,通过反射API可以获取程序在运行时刻的内部结构.反射API中提供的动态代理也是非常强大的功能,可以原 ...

  4. Nastya Studies Informatics

    Nastya Studies Informatics   time limit per test 1 second   memory limit per test 256 megabytes   in ...

  5. eclipse 搭建ruby环境

    第一步:获取RDT,http://sourceforge.net/projects/rubyeclipse/files/ 解压该文件,获得features和plugins两个文件夹,将这两个文件夹分别 ...

  6. P3102 [USACO14FEB]秘密代码Secret Code

    题目描述 Farmer John has secret message that he wants to hide from his cows; the message is a string of ...

  7. 转:关于bugfree的一些不得不说的事

    昨天公司说要做一个工作流程控制系统,经朋友建议,尝试使用禅道进行管理,自己试用了下,感觉非常不错.下午看朋友发的关于禅道和bugfree的恩恩怨怨,更加佩服禅道的项目主管. 原文链接:http://w ...

  8. 使用selenium抓取淘宝的商品信息

    淘宝的页面大量使用了js加载数据,所以采用selenium来进行爬取更为简单,selenum作为一个测试工具,主要配合无窗口浏览器phantomjs来使用. import re from seleni ...

  9. 关于RPi.GPIO、BCM2835 c library、WiringPi、Gertboard

    1.RPi.GPIO//RPi.GPIO-0.5.5.tar.gz 开发者:python官网:https://www.python.org/ 官网:https://pypi.python.org/py ...

  10. noip2013华容道

    题目描述 [问题描述] 小 B 最近迷上了华容道,可是他总是要花很长的时间才能完成一次.于是,他想到用编程来完成华容道:给定一种局面, 华容道是否根本就无法完成,如果能完成, 最少需要多少时间. 小 ...