从IntelliJ-Idea启动spring-boot应用程序时遇到问题.通过终端运行应用程序时没有这个问题.
:: Spring Boot :: (v1.2.1.RELEASE)
2015-09-24 12:22:44.274 WARN 22380 --- [ main] n.sf.ehcache.config.CacheConfiguration : Cache 'publicationsCount' is set to eternal but also has TTI/TTL set. To avoid this warning, clean up the config removing conflicting values of eternal, TTI and TTL. Effective configuration for Cache 'publicationsCount' will be eternal='true', timeToIdleSeconds='0', timeToLiveSeconds='0'.
Process finished with exit code 0
Run Code Online (Sandbox Code Playgroud)
我认为这种警告并不会导致它.可能是什么原因?
我的模型如下:
@Entity(name = "request")
public class VisitRequest {
@Id
@GeneratedValue
private Long id;
@OneToMany(mappedBy = "visitRequest", cascade = CascadeType.ALL, orphanRemoval = true)
@JsonManagedReference
private List<Visitor> visitors;
//default constructor, getters and setters
}
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "class")
public class Visitor {
@Id
@GeneratedValue
private Long id;
@ManyToOne
@JsonBackReference
private VisitRequest visitRequest;
//default constructor, getters and setters
}
@Entity
public class ContactPerson extends Visitor {
private PhoneNumber phoneNumber;
//default constructor, getters and setters …Run Code Online (Sandbox Code Playgroud) 我正在使用这个配置类来初始化 RestTemplate:
@Configuration
public class RestTemplateConfig {
@Value("${endpoint-url}")
private String endpointUrl;
@Bean
public RestTemplate restTemplate(RestTemplateBuilder builder) {
return builder
.rootUri(endpointUrl)
.messageConverters(new MappingJackson2HttpMessageConverter())
.build();
}
}
Run Code Online (Sandbox Code Playgroud)
在我的服务方法之一中,我使用了代码:
RootUriTemplateHandler handler = (RootUriTemplateHandler) restTemplate.getUriTemplateHandler();
String uri = handler.getRootUri();
restTemplate.postForLocation(uri, request);
Run Code Online (Sandbox Code Playgroud)
获取这个URI。有没有更简单的方法来获得这个 rootUri(没有强制转换)?还是直接向rootUri执行post请求?
我有一个课程请求:
@Entity
public class Request {
@CreationTimestamp
private Date createdDate;
}
Run Code Online (Sandbox Code Playgroud)
当我使用以下方法测试它时:
Request request = requestRepository.save(new Request());
request.getCreatedDate();
Run Code Online (Sandbox Code Playgroud)
由于某种原因 getCreatedDate 仍然为空。
我使用 H2 和 Oracle10gDialect 进行测试(当我使用 H2 的默认方言时它可以工作)。
你知道我该如何修复它吗?
使用tomcat时加载字体时出现此类错误:
1无法解码下载的字体:https://my-address.com/css/fonts/robotocondensed-bold-webfont.woff2
1 OTS解析错误:无法将WOFF 2.0字体转换为SFNT
1无法解码下载的字体:https://my-address.com/css/fonts/robotocondensed-regular-webfont.woff2
1 OTS解析错误:无法将WOFF 2.0字体转换为SFNT
1无法解码下载的字体:https://my-address.com/css/fonts/fontawesome-webfont.woff2?v = 4.3.0
1 OTS解析错误:无法将WOFF 2.0字体转换为SFNT
1无法解码下载的字体:https://my-address.com/css/fonts/robotocondensed-regular-webfont.woff
1 OTS解析错误:WOFF标头中的文件大小不正确
1无法解码下载的字体:https://my-address.com/css/fonts/robotocondensed-bold-webfont.woff
1 OTS解析错误:WOFF标头中的文件大小不正确
https:// fake .com /无法加载资源:net :: ERR_BLOCKED_BY_CLIENT
1无法解码下载的字体:https://my-address.com/css/fonts/robotocondensed-regular-webfont.ttf
1 OTS解析错误:FFTM:未对齐的表
1无法解码下载的字体:https://my-address.com/css/fonts/fontawesome-webfont.woff?v = 4.3.0
1 OTS解析错误:WOFF标头中的文件大小不正确
1无法解码下载的字体:https://my-address.com/css/fonts/robotocondensed-bold-webfont.ttf
1 OTS解析错误:GDEF:未对齐的表
1无法解码下载的字体:https://my-address.com/css/fonts/fontawesome-webfont.ttf?v = 4.3.0
1 OTS解析错误:表目录的entrySelector不正确
1无法解码下载的字体:https://my-address.com/css/fonts/robotocondensed-light_0-webfont.woff2
1 OTS解析错误:无法将WOFF 2.0字体转换为SFNT
1无法解码下载的字体:https …
java ×4
hibernate ×2
spring ×2
font-awesome ×1
fonts ×1
h2 ×1
jpa ×1
resttemplate ×1
spring-boot ×1
tomcat ×1