草庐IT

CONFIG_PROJECT_SW_DATE_VERSION

全部标签

java - Elasticsearch 插件 : "Failed to resolve config path" error

我在debianjessie上安装了elasticsearch1.7.3。它使用默认配置文件并正常工作。但是当我调用sudo/usr/share/elasticsearch/bin/plugin时,它返回一个错误:Exceptioninthread"main"org.elasticsearch.env.FailedToResolveConfigException:Failedtoresolveconfigpath["/usr/share/elasticsearch/config/elasticsearch.yml"],triedfilepath["/usr/share/elastics

Java Project 与 Maven Project (Eclipse),需要澄清目录结构

当我在Eclipse中创建一个新的Maven项目时,目录结构包含src/main/java和src/main(在下面)问题:我知道我的代码应该属于src/main/java,src/main的目的是什么?为什么Eclipse创建它? 最佳答案 src/main/java是Maven用于放置Java源代码的标准布局。检查http://java.sg/maven-standard-directory-layout/获取标准Maven目录的列表。src/main/javaApplication/Librarysourcessrc/main

java - 无法使用 @DateTimeFormat(模式 ="dd/MM/yyyy")转换 java.util.Date 中的字符串

我有一个带有日期字段的简单POJO。我想将对象与表单中的值绑定(bind)。在表单中,我使用的是日期格式为("dd/mm/yyyy")的jqueryuidatepicker我有console.log值,它是一个字符串:13-11-2014我正在使用spring4.0.7我依赖于joda-time2.5我得到这个异常:Failedtoconvertpropertyvalueoftype'java.lang.String'torequiredtype'java.util.Date'forproperty'endDate';nestedexceptionisorg.springframewo

java - 字符串 -> java.util.Date -> java.sql.Date(带时间戳)

这是我的问题:我有一个用户输入一个日期,如:2012-12-24(字符串)我将时间连接到该字符串,然后转换为java.util.Date我的代码如下所示:Stringtempstartdate=startdte;//startdteisthestringvaluefromatxtfieldtempstartdate+="00:01:00";Stringtempenddate=startdte;tempenddate+="23:59:59";SimpleDateFormatdf=newSimpleDateFormat("yyyy-MM-ddhh:mm:ss");java.util.Dat

java - 使用 hibernate-envers 时,AUD 表中的所有 @Version 字段均为 null,但在实体中 - 表已填充好吗?

有应用spring+jpa+envers(hibernate)envers需要将实体的历史保存在特殊的表中。在我保存了几次我的实体之后,我希望看到USER表中的填充版本字段和USER_AUT中的填充版本字段。但实际结果在USER表中是正确的值,但在版本列中添加了REV_TYPE、REV列(在字段中只是couter的所有行)和null。我用的是4.0.1.Finalhibernateorg.hibernatehibernate-envers4.0.1.Finalorg.hibernatehibernate-entitymanager4.0.1.Final但是,当我查看表时,Version

java - 我在 Maven 构建中得到 "The build could not read 1 project"因为未定义的版本

我有一个父pom和一个集成pom:集成pomorg.jsonjsoncommons-httpclientcommons-httpclientcom.exampleexample-modelcom.exampleexample-parent0.0.1-SNAPSHOT父pom../example-business../example-integration../example-modelorg.jsonjson20131018commons-httpclientcommons-httpclient3.1com.exampleexample-model${project.version}现

java - JPA 2.1 : Introducing Java 8 Date/Time API

我想在启用JPA的应用程序中添加对Java8日期/时间API(JSR-310)的支持。很明显JPA2.1doesnotsupporttheJava8Date/TimeAPI.作为解决方法,最常见的建议是使用AttributeConverter.在我现有的应用程序中,我将我的实体更改为对列映射字段使用LocalDate/LocalDateTime类型,并为java.util添加了旧版setter/getter.Date给他们。我创建了相应的AttributeConverter类。当使用Query.setParameter()和java.util.Date实例时,我的应用程序现在失败了(它

java - 随机 SSLException Unsupported record version Unknown-0.0

下面的代码有时会失败,有时会起作用。我正在使用Java8。是服务器端问题吗?线程“main”中的异常javax.net.ssl.SSLException:不支持的记录版本Unknown-0.0。编辑:我从JDK8降级到JDK7,它可以工作。我发现唯一可行的解​​决方案。publicstaticvoidmain(String[]args)throwsException{URLu=newURL("https://c********.web.cddbp.net/webapi/xml/1.0/");HttpURLConnectionconnection=(HttpURLConnection)u

java - 如何将 util.Date 转换为 time.LocalDate 以正确处理 1893 年之前的日期

我google了一下,最常用的方法好像是date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();但是,对于1893-04-01之前的日期,此方法似乎会失败以下测试在我的机器上失败,结果为1893-03-31而不是1893-04-01:@TestpublicvoidtestBeforeApril1893()throwsParseException{Datedate=newSimpleDateFormat("yyyy-MM-dd").parse("1893-04-01");System.out.println(date);

java.time : DateTimeParseException for date "20150901023302166"

这个问题在这里已经有了答案:Isjava.timefailingtoparsefraction-of-second?(3个答案)关闭7年前。LocalDateTime.parse("20150901023302166",DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS"))给出错误:java.time.format.DateTimeParseException:Text'20150901023302166'couldnotbeparsedatindex0