草庐IT

IdTCPServer1Execute

全部标签

java - HttpResponse 使用 android 问题 : execute always causes exception?

我一直在从事一个Android项目,现在我想向一些API询问信息。看起来这应该是非常基础的!这是我的代码的一般要点:privateInputStreamretrieveStream2(Stringurl){DefaultHttpClientclient=newDefaultHttpClient();HttpGetgetRequest=newHttpGet(url);System.out.println("getRequest=="+getRequest);try{HttpResponsegetResponse=client.execute(getRequest);//hereisteh

java - Elasticsearch 失败,错误为 "Failed to execute phase [query_fetch], all shards failed"

当我尝试索引数据然后进行查询时,一切都很好,但是如果我启动我的应用程序并在它之前进行不索引的查询,我会收到该错误Exceptioninthread"main"org.elasticsearch.action.search.SearchPhaseExecutionException:Failedtoexecutephase[query_fetch],allshardsfailedatorg.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(Transp

java - .execute 无法解析为类型 - AsyncTask (Android)

我正在编写一个需要从我的数据库中获取一些json的应用程序,我收到了数据,但现在我还试图在ListView中显示的信息旁边查看一个图标。麻烦的线路是:mChart.setTag(URL);newDownloadImagesTask.execute(mChart);主要Activity:publicclassMainActivityextendsActivity{ListViewlist;TextViewicon;TextViewname;TextViewdeveloper;TextViewsize;ButtonBtngetdata;ArrayList>mList=newArrayLis

java - Maven 不会运行我的项目 : Failed to execute goal org. codehaus.mojo :exec-maven-plugin:1. 2.1:exec

我无法运行MavenNetbeansJavaFX示例:Failedtoexecutegoalorg.codehaus.mojo:exec-maven-plugin:1.2.1:exec(default-cli)onprojectmavenproject3:Commandexecutionfailed.Processexitedwithanerror:1(Exitvalue:1)->[Help1]Toseethefullstacktraceoftheerrors,re-runMavenwiththe-eswitch.Re-runMavenusingthe-Xswitchtoenablef

java - com.netflix.discovery.shared.transport.TransportException : Cannot execute request on any known server

我是微服务的新手,正在尝试从链接运行代码:https://dzone.com/articles/advanced-microservices-security-with-spring-and-oa.当我简单地运行代码时,我看到出现以下错误。问题是什么?com.netflix.discovery.shared.transport.TransportException:Cannotexecuterequestonanyknownserveratcom.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient

Python 错误 : execute cannot be used while an asynchronous query is underway

如何防止错误“ProgrammingError:executecannotbeusedwhileanasynchronousqueryisunderly”?从文档中可以看出,如果我使用像gevent这样的协程支持,我应该使用psycopg2.extras.wait_select,但我在使用它时仍然遇到该错误。我已经隔离了我在下面的代码片段中遇到的错误。con=psycopg2.connect(database=DATABASE_NAME,user=DATABASE_USERNAME)defexecute_query(cur,query,params):psycopg2.extras.w

python - Scrapy:将参数传递给 cmdline.execute()

我知道从命令行运行scrapy蜘蛛时如何传递参数。但是,当我尝试使用scrapy的cmdline.execute()从脚本以编程方式运行它时遇到问题。我需要传递的参数是我之前格式化为字符串的列表,就像这样:numbers="one,two,three,four,five"colors="red,blue,black,yellow,pink"cmdline.execute('scrapycrawlmyspider-aarg1='+numbers+'-aarg2='+colors)蜘蛛是...classMySpider(Spider):name="myS"def__init__(self,

python - 为什么带有 SQL 查询参数的 psycopg2 cursor.execute() 会导致语法错误?

在Python中为psycopg2中的execute()指定参数时,像这样:cursor.execute('SELECT*FROM%s',("my_table",))我收到这个错误:psycopg2.ProgrammingError:syntaxerroratornear"'my_table'"LINE1:SELECT*FROM'my_table'我做错了什么?看起来psycopg2正在向查询添加单引号,而这些单引号导致了语法错误。如果我不使用参数,它会正常工作:cursor.execute('SELECT*FROMmy_table') 最佳答案

python - gdb.execute 阻塞 python 脚本中的所有线程

我正在使用Python2.7编写GDB脚本。我只是使用gdb.execute("stepi")执行单步执行指令。如果被调试程序处于空闲状态并等待用户交互,gdb.execute("stepi")不会返回。如果有这种情况,我想在不终止gdb的情况下停止调试session。为此,我创建了一个线程,如果当前指令运行超过x秒,该线程将终止调试进程:fromctypesimportc_ulonglong,c_boolfromosimportkillfromthreadingimportThreadfromtimeimportsleepimportsignal#Weneedmutableprimi

python - `driver.execute_script(".. .")` 和 `driver.get("javascript : . 之间有什么区别。 ."` 与 geckodriver/Firefox?

我认为,这个问题涉及Selenium的内部工作原理。在另一篇文章中ReferermissinginHTTPheaderofSeleniumrequest很明显,运行之间存在差异driver.execute_script("window.location.href='{}';".format(url))和driver.get("javascript:window.location.href='{}'".format(url))后一个命令会在请求中发送Refererheader,前者不会。在这一点上,这是期望的行为还是错误并不重要,Referer应该由两个命令发送。此外,window.lo