我的构建中收到了大量的这些错误消息.但是它似乎对传递或失败构建没有影响.有谁知道它来自哪里?
编辑 - >它似乎与报告插件有关.这就是报告部分的全部内容
<reporting>
<plugins>
<plugin>
<!-- use mvn cobertura:cobertura to generate cobertura reports -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5.2</version>
<configuration>
<formats>
<format>html</format>
<format>xml</format>
</formats>
<check/>
</configuration>
</plugin>
</plugins>
</reporting>
Run Code Online (Sandbox Code Playgroud)
这是我的插件
<plugins>
<!-- fixes bug running coverage for jdk 1.7 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<argLine>-XX:-UseSplitVerifier</argLine>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.4</version>
<configuration>
<check>
<branchRate>100</branchRate>
<lineRate>100</lineRate>
<haltOnFailure>true</haltOnFailure>
<totalBranchRate>100</totalBranchRate>
<totalLineRate>100</totalLineRate>
<packageLineRate>100</packageLineRate>
<packageBranchRate>100</packageBranchRate>
<!--<regexes>-->
<!--<regex>-->
<!--<pattern>com.example.reallyimportant.*</pattern>-->
<!--<branchRate>90</branchRate>-->
<!--<lineRate>80</lineRate>-->
<!--</regex>-->
<!--<regex>-->
<!--<pattern>com.example.boringcode.*</pattern>-->
<!--<branchRate>40</branchRate>-->
<!--<lineRate>30</lineRate>--> …
Run Code Online (Sandbox Code Playgroud) 我注意到这个问题被问到了,但是没有正确回答.
我有一个数据表,有两列开始日期和结束日期.两者都包含primefaces p:日历控件.我需要确保对于每一行,column1中的日期不在column2中的日期之后.我想把它绑定到JSF验证框架,但我遇到了麻烦.
我已经尝试将数据表标记为rowStatePreserved ="true",这允许我获取值,但是仍然存在错误,因为当它失败时,第一行中的所有值都会覆盖所有其他值.我做错了什么,或者我应该采用完全不同的策略?
xhtml代码
<h:form>
<f:event type="postValidate" listener="#{bean.doCrossFieldValidation}"/>
<p:dataTable id="eventDaysTable" value="#{course.courseSchedules}" var="_eventDay" styleClass="compactDataTable"
>
<p:column id="eventDayStartColumn">
<f:facet name="header">
Start
</f:facet>
<p:calendar id="startDate" required="true" value="#{_eventDay.startTime}" pattern="MM/dd/yyyy hh:mm a"/>
</p:column>
<p:column id="eventDayEndColumn">
<f:facet name="header">
End
</f:facet>
<p:calendar id="endDate" required="true" value="#{_eventDay.endTime}" pattern="MM/dd/yyyy hh:mm a"/>
</p:column>
</p:dataTable>
</h:form>
Run Code Online (Sandbox Code Playgroud)
验证码
public void doCrossFieldValidation(ComponentSystemEvent cse) {
UIData eventsDaysStable = (UIData) cse.getComponent().findComponent("eventDaysTable");
if (null != eventsDaysStable && eventsDaysStable.isRendered()) {
Iterator<UIComponent> startDateCalendarIterator = eventsDaysStable.findComponent("eventDayStartColumn").getChildren().iterator();
Iterator<UIComponent> endDateCalendarIterator = eventsDaysStable.findComponent("eventDayEndColumn").getChildren().iterator();
while (startDateCalendarIterator.hasNext() && endDateCalendarIterator.hasNext()) …
Run Code Online (Sandbox Code Playgroud) 每天,数据通过Web服务导入.
我知道我可以浏览pojos上的所有字段,并检查空值,并在适当的地方更新,但我更愿意让hibernate执行此操作,如果它能够,因为它会减少我添加字段和忘记将其添加到此手动合并过程中.
休眠可以执行上面的第4步吗?
我想在休息服务中使用路径参数作为完整的 ISO 时间戳。
http://domain:8080/ctx/someObj/2000-10-31 01:30:00.000-05:00
Run Code Online (Sandbox Code Playgroud)
我以前打开了 mvc:annotation 驱动,但将其关闭,以便我可以在 DefaultAnnotationHandlerMapping 上将“useDefaultSuffixPattern”设置为 false。
控制器代码
@RequestMapping(value = "/lwc/{userMidnightTime}", method = RequestMethod.GET)
@ResponseBody
public List<ProgramSnippetView> getLiveWebcastsWithin24HoursOfTime(@PathVariable(value = "userMidnightTime") @DateTimeFormat(iso= DATE_TIME) Date userMidnightTime) {
Calendar cal = new GregorianCalendar();
cal.setTime(userMidnightTime);
cal.add(Calendar.HOUR, 24);
Date endTime = cal.getTime();
return programService.getLiveWebcastSnippetsWithProductionDateInRange(userMidnightTime, endTime);
}
Run Code Online (Sandbox Code Playgroud)
我收到以下错误。我可以看到框架最终使用正确的字符串调用了已弃用的 Date.parse() 方法,而不是使用 joda 时间来完成这项工作。
112977 [http-apr-8080-exec-7] DEBUG org.springframework.beans.BeanUtils - No property editor [java.util.DateEditor] found for type java.util.Date according to 'Editor' suffix convention
117225 [http-apr-8080-exec-7] DEBUG org.springframework.beans.TypeConverterDelegate - Construction via String failed for type [java.util.Date] …
Run Code Online (Sandbox Code Playgroud) 我正在尝试调试一个页面问题,其中IE 9将首次在我的requirejs/backbone应用程序上运行,但会在页面重新加载时失败.但是,当我尝试使用f12 IE开发人员工具调试此问题时,我无法导航到源设置断点,因为IE不会加载RequireJS包含的任何文件.我如何解决这个问题来解决我的IE问题?
我有兴趣向我的OAuth2授权服务器添加自定义的休息端点。
我想添加一个注册终结点,我的UI资源服务器可以调用该注册终结点,注册用户,并一次性收回所有令牌(注册时自动登录)。
我可以在两个请求中进行此操作,因为UI资源服务器具有用户的密码,但是我更愿意在一个请求中进行操作,因为我正在重新使用授权服务器来存储我的所有用户凭据。
我创建了一个端点
@FrameworkEndpoint
class RegistrationController {
@Autowired
LocalUserAuthenticationService userDetailsService
@Autowired
TokenEndpoint tokenEndpoint
@RequestMapping(value = "/registration", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.CREATED)
public ResponseEntity<OAuth2AccessToken> registerUser(Principal principal,
@RequestBody @Valid RegistrationRequest registrationRequest) {
userDetailsService.register(registrationRequest.email, registrationRequest.password)
return tokenEndpoint.getAccessToken(principal, [grant_type: 'password', username: registrationRequest.email, password: registrationRequest.password])
}
}
Run Code Online (Sandbox Code Playgroud)
我在我的上下文中注册
@EnableAuthorizationServer
public class AuthServerConfig {
@Bean
public RegistrationController(){
return new RegistrationController()
} ... more
}
Run Code Online (Sandbox Code Playgroud)
但是,以这种方式使用请求时,始终是未经授权的。它说找不到用户。它可以解析基本的身份验证凭据,但是尽管在此上下文中注册了该bean,但无论在哪里寻找它们都找不到它们。
@FrameworkEndpoint的文档说
Use with @RequestMapping and all the other @Controller features (and match with a FrameworkEndpointHandlerMapping in the servlet context)
Run Code Online (Sandbox Code Playgroud)
但我似乎无法破解如何真正做到这一点。或者如果我误会了。
我怎样才能正确地注册它,使其像其他框架bean一样工作?
spring spring-security spring-boot spring-security-oauth2 spring-oauth2
我试图使用Apache Httpclient将一些JSON发布到休息服务.但是,我收到此错误:
Exception in thread "main" org.apache.http.ProtocolException: Content-Length header already present
Run Code Online (Sandbox Code Playgroud)
UsernamePasswordCredentials defaultcreds = new UsernamePasswordCredentials(USER,
PASS);
HttpHost targetHost = new HttpHost("localhost", 8080, "http");
DefaultHttpClient httpclient = new DefaultHttpClient();
httpclient.getCredentialsProvider().setCredentials(
new AuthScope(targetHost.getHostName(), targetHost.getPort()),
new UsernamePasswordCredentials(USER, PASS));
HttpPost httpPost = new HttpPost(urlSuffix) {};
JSONObject holder = new JSONObject();
holder.put("name", "this is a folder");
StringEntity se = new StringEntity(holder.toString());
httpPost.setHeader("Accept", "application/json");
httpPost.setHeader("Content-type", "application/json");
httpPost.setEntity(se);
HttpResponse resp = httpclient.execute(targetHost,httpPost);
System.out.println("Resp->" + resp.getStatusLine().getStatusCode());
Run Code Online (Sandbox Code Playgroud)
我读过它因为我已经设置了两次内容长度,但我不确定如何解决它.
我有一个简单的MVC控制器,它接收一个电子邮件列表,然后会向这些电子邮件发送一条消息.
{"emailAddresses" : []}
Run Code Online (Sandbox Code Playgroud)
@RequestMapping(value = "/{id}/share", method = RequestMethod.POST)
@ResponseBody
public void shareThing(@PathVariable(value = "id") final String id, @Valid @NotEmpty @RequestBody final List<String> emailAddresses)
Run Code Online (Sandbox Code Playgroud)
基本上,我想使用jsr-303,这样如果客户端发布没有电子邮件的请求,它就会失败.最好是401.
上述代码应该有效吗?或者我需要做什么?这是设置.Hibernate验证器在类路径上,因此它应该正常运行.但是,如果我发布一个空的json数组,它会直接进入方法,并将一个空数组列表作为绑定参数.
@Configuration
@EnableWebMvc
@ComponentScan(basePackages = {"com.package.thing"})
public class WeConfiguration extends WebMvcConfigurerAdapter
Run Code Online (Sandbox Code Playgroud)
{"emailAddresses" : []}
Run Code Online (Sandbox Code Playgroud)
@RequestMapping(value = "/{id}/share", method = RequestMethod.POST)
@ResponseBody
public void shareThing(@PathVariable(value = "id") final String id, @Valid @NotEmpty @RequestBody final List<String> emailAddresses, BindingResult bindingResult)
{
System.out.println("Has Errors? " + bindingResult.hasErrors();
}
Run Code Online (Sandbox Code Playgroud)
有错误吗?假
public …
Run Code Online (Sandbox Code Playgroud) java ×6
spring ×3
rest ×2
spring-mvc ×2
amd ×1
hibernate ×1
javascript ×1
jodatime ×1
jpa ×1
jsf ×1
jsf-2 ×1
maven ×1
maven-3 ×1
primefaces ×1
requirejs ×1
spring-boot ×1