草庐IT

the_executable

全部标签

java - Weblogic BEA-000449 : Closing socket as no data read from it during the configured idle timeout of 5 secs

我已经开始在我的weblogic10日志文件中看到这条消息。我正在运行一个大约有40-350个并发用户的应用程序。我的问题是这个错误的真正含义是什么它将如何影响用户(如果有的话)可能是什么原因造成的谢谢 最佳答案 WhatdoesthiserrorreallymeanWeblogic正在关闭用于与其中一个服务器客户端通信的套接字,因为超过五秒没有发送数据,这是您为Weblogic的空闲超时配置的值。Whatcouldbecausingthis客户端程序连接到您的服务器,发送一些数据,然后1)不关闭连接或2)消失。

java : execute a method over a maximum period of time

我正在使用JavaMailAPI,Folder类中有一个名为“搜索”的方法,有时执行时间过长。我想要的是在最长的时间段内执行此方法(例如最多15秒),这样我可以确定此方法不会运行超过15秒。伪代码messages=maximumMethod(Folder.search(),15);是否必须创建一个线程来执行此方法并在主线程中使用wait方法? 最佳答案 最好的方法是创建一个单线程的executor你可以用它提交可调用文件。返回值为Future你可以从中得到结果。你也可以说等待这么久才能得到结果。这是示例代码:ExecutorServ

Java 泛型 : Method X is not applicable for the arguments

EventHandler.java:publicabstractclassEventHandler{publicabstractvoidHandleEvent(Objectsender,Ee);}观察者.java:publicclassObservers{privateCopyOnWriteArrayList>mListeners=newCopyOnWriteArrayList>();publicvoiddispatchEvent(Objectsender,Eargs){if(mListeners!=null){for(EventHandlerlistener:mListeners){

java - 是否有保证 execute(T t) 方法的内置 Java 类型?

似乎对像下面这样的类型的需求如此普遍,以至于应该已经将类似的东西内置到Java中:publicinterfaceExecuter{voidexecute(Tobject);}然后它可以在其他类中使用,例如这个在一个对象上调用一堆执行器的简单示例。classHandlerimplementsExecuter{List>executerList;Handler(List>executer){this.executerList=executer;}voidexecute(Tt){for(Executerexecuter:this.executerList){executer.execute(

java - Eclipse 格式化程序 : how do I align the code in my method

ctrl+shift+F可以很好地处理公共(public)类中的内容。但格式在方法内部不起作用,请参阅=符号未对齐。为什么?以及如何让它发挥作用?publicclassmyClassextendsActivityInstrumentationTestCase2{publicstaticbooleanmyVar=true;privatestaticfinalStringTARGET_PACKAGE_ID="com.xxxx.test";privatestaticfinalStringLAUNCHER_ACTIVITY_FULL_CLASSNAME="com.xxxx.test";priv

java - 将 BrowserMob 代理传递给 Sauce Labs - "The proxy server is refusing connections"错误

我一直在尝试将BrowserMob代理传递给SauceLabs,但没有成功。这是我尝试过的:启动代理服务器shbrowsermob-proxy-port9090启动代理curl-XPOSThttp://localhost:9090/proxy{"port":9091}启动sauceconnect,并传递代理服务器信息java-jarSauce-Connect.jarmynamexxxxxx-plocalhost:9091运行Java客户端ProxyServerproxyServer=newProxyServer(9091);proxyServer.start();Proxyproxy=

Java (JSP) : repeating the contentType header in a "sub-jsp"

如果在一个.jsp中重复header并包含在另一个.jsp中,会发生什么情况?例如,如果example.jsp以此开头:...(它包括support.jsp)然后support.jsp开始也这样:...这是个问题吗?这是不好的做法吗?当您多次重复一个仅对应于生成的.html页面中的一个标题的标题时,具体会发生什么? 最佳答案 来自JSPSpecification:JSP.5.4...Anincludedpagecannotchangetheresponsestatuscodeorsetheaders.Thisprecludesinv

java - 碧 Jade 报告 : How to add font not in the application classpath

我正在尝试使用一种字体,它没有安装在我的本地操作系统上,带有JasperReports。jasper报表是这样使用的:名为Corbel的字体被导出为字体扩展(使用iReport),并包含在我系统的文件夹中的文件(Corbel.jar)中。我使用如下代码将此扩展添加到应用程序的类路径中:ClassLoadercl=newURLClassLoader(newURL[]{newURL("file:///D:/path/to/Corbel_jar_folder/")});param=newHashMap();param.put(JRParameter.REPORT_CLASS_LOADER,c

java - Maven 3 : Failed to execute goal org. apache.maven.plugins :maven-archetype-plugin:2. 2:生成

我正在尝试使用测试ma​​venmvnarchetype:generate-DgroupId=org.sonatype.mavenbook-DartifactId=quickstart-Dversion=1.0-SNAPSHOT-DpackageName=org.sonatype.mavenbook-DarchetypeGroupId=org.apache.maven.archetypes-DarchetypeArtifactId=maven-archetype-quickstart-DarchetypeVersion=1.0-DinteractiveMode=false几分钟后,系统

java - "error_description": "AADSTS70002: The request body must contain the following parameter: ' client_secret or client_assertion'

我使用了https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/master/src/samples/public-client-app-sample/src/main/java/PublicClient.java中的代码.唯一的区别是CLIENT_ID已更新。我一直收到错误消息"error_description":"AADSTS70002:Therequestbodymustcontainthefollowingparameter:'client_secretorclient_assertion'