草庐IT

Application_name

全部标签

java - 在 Windows 上监听 "open file with my java application"事件

标题很乱,不知道怎么用几句话来解释:我有一个读取*.example文件的java应用程序。由于install4j,我还添加了一个文件关联,因此当用户双击任何扩展名为*.example的文件时,我的应用程序就会启动install4j似乎在args[]中发送文件路径,因此打开该文件并在我的应用程序中显示它应该很容易。但是如果应用已经在运行会怎样?我只能允许应用程序的一个实例,那么我怎么知道用户正在打开一个文件?我找到了这个:http://resources.ej-technologies.com/install4j/help/api/com/install4j/api/launcher/S

java - “Your security settings have blocked a local application from running” Java 8

我正尝试在我的Chrome窗口中运行一个小程序,但收到错误消息。我确实看到所有回复都告诉我将我的安全级别更改为中等,但版本8中不存在该选项。到目前为止,几个小时的谷歌搜索和向同学寻求帮助都没有取得任何进展。谁能给我点建议? 最佳答案 Medium在Java8u20中被移除:Medium(removedfromJava8Update20andlaterversions)Onlyunsignedapplicationsthatrequestallpermissionsareblocked.Allotherapplicationsarea

java - Spring 安全抛出 javax.servlet.ServletException : Could not resolve view with name 'j_spring_security_check'

我正在尝试将具有自定义登录页面和数据库访问的Springsecurity添加到我的SpringMVC应用程序中。似乎我的映射是错误的,因为它无法映射j_spring_security_check。为了解决这个问题,我查看了以下页面1、2、3但仍无法解决问题。如果您没有太多时间,请阅读下面的第2部分,这是问题的编辑部分开始的地方。否则,请阅读第1部分和第2部分。第1部分我还在我的web.xml文件中添加了以下行,但应用程序返回以下异常。springSecurityFilterChainorg.springframework.web.filter.DelegatingFilterProxy

java - 使用动态值覆盖 Junit 测试中的默认 Spring-Boot application.properties 设置

我想在测试中覆盖application.properties中定义的属性,但@TestPropertySource只允许提供预定义的值。我需要的是在随机端口N上启动服务器,然后将此端口传递给spring-boot应用程序。该端口必须是临时的,以允许同时在同一主机上运行多个测试。我不是指嵌入式http服务器(jetty),而是在测试开始时启动的一些不同的服务器(例如zookeeper)并且被测试的应用程序必须连接到它。实现此目标的最佳方法是什么?(这里有一个类似的问题,但答案没有提到临时端口的解决方案-OverridedefaultSpring-Bootapplication.prope

java - Interface Annotation 不接受 application.properties 值

我开发了一个简单的注释界面@Target(ElementType.TYPE)@Retention(RetentionPolicy.RUNTIME)public@interfaceCustomAnnotation{Stringfoo()default"foo";}然后我测试它并注释一个类@CustomAnnotationpublicclassAnnotatedClass{}并使用方法调用它publicvoidfoo(){CustomAnnotationcustomAnnotation=AnnotatedClass.class.getAnnotation(CustomAnnotation.

java - 是否有 Checkstyle/PMD 规则 "Non-abstract classes should not be named AbstractXXX"?

我正在处理的Java项目结合使用了代码分析工具:PMD、Checkstyle和FindBugs。这些发现了大量错误、样式问题等,但经常有一个漏网之鱼:publicclassAbstractBadlyNamedClass{//Notabstract!//...}注意相反的方式被检查,即publicabstractBadlyNamedClass给出PMD警告“抽象类应命名为AbstractXXX”。任何人都可以建议是否有一种方法可以检查这一点,可以使用上述工具之一(可能是某种自定义规则?)或其他可以完成这项工作的自动化工具? 最佳答案

java - Camel cxf :cxfEndpoint Producer error : Can't find the BindingOperationInfo with operation name

我正在使用camelcxf:cxfEndpoint调用soap服务,但收到此BindingOperationInfo错误。配置对我来说看起来是正确的,但不确定我哪里做错了。端点配置:我的JavaDSL路由器配置。from("direct:invokeMyUpdate").bean("myAcctSvcClient","buildSoapReq").setHeader(CxfConstants.OPERATION_NAME,constant("getAccountInfo")).to("cxf:bean:accountEndpoint")WSDL元素:错误如下:Stacktrace:ja

javax.net.ssl.SSLException : Certificate for <> doesn't match any of the subject alternative names: [] 异常

当我尝试使用Postman访问URL时,它工作正常,通过使用我的个人证书。但是当我使用RestAssured测试用例尝试相同时,它抛出上述异常。配置类publicclassConfiguration{protectedSSLConfigconfig=null;privatestaticfinalLoggerLOG=LoggerFactory.getLogger(Configuration.class);@SuppressWarnings("deprecation")@BeforeClasspublicvoidsetKeystore(){KeyStorekeyStore=null;Key

Mac 上的 Java : How do I detect when my application receives focus?

我浏览了ApplicationListener,他们那里没有。在Mac上,当该应用程序具有等效的焦点时;它的菜单在顶部菜单栏中。此外,如果您知道这一点,能否告诉我我的应用程序如何请求自行散焦? 最佳答案 windowActivated()和windowDeactivated()的实现WindowListener或WindowAdapter会告诉您窗口何时被激活或停用。你不需要ApplicationListener为此。附录:虽然在这种情况下不需要,但在ApplicationListener中指定的附加功能的透明实现可以在这个exam

Java "Jackson"JsonMappingException : Can not deserialize instance of float out of FIELD_NAME token

与这个类:publicclassProductsimplementsSerializable{privateBigDecimalproductId;privatefloatpriority;publicfloatgetPriority(){returnpriority;}publicvoidsetPriority(floatpriority){this.priority=priority;}}在对此类JSON数据进行反序列化时:{"productId":47552,"priority":78}出现这个错误:org.codehaus.jackson.map.JsonMappingExce