每当我使用SonarQube项目属性创建一个新项目时,我都会收到此错误:
04:13:57.939 DEBUG: Upload report
04:14:11.533 DEBUG: POST 500 sonarserverurl/api/ce/submit?projectKey=Somename&projectName=Somename | time=13580ms
04:14:11.540 INFO: ------------------------------------------------------------------------
04:14:11.540 INFO: EXECUTION FAILURE
04:14:11.540 INFO: ------------------------------------------------------------------------
04:14:11.540 INFO: Total time: 2:25.443s
04:14:11.639 INFO: Final Memory: 56M/647M
04:14:11.639 INFO: ------------------------------------------------------------------------
04:14:11.639 ERROR: Error during SonarQube Scanner execution
org.sonarqube.ws.client.HttpException: Error 500 on sonarserver:9000/api/ce/submit?projectKey=Some name&projectName=Some name* : {"errors":[{"msg":"An error has occurred. Please contact your administrator"}]}
at org.sonarqube.ws.client.BaseResponse.failIfNotSuccessful(BaseResponse.java:36)
at org.sonar.scanner.bootstrap.ScannerWsClient.failIfUnauthorized(ScannerWsClient.java:106)
at org.sonar.scanner.bootstrap.ScannerWsClient.call(ScannerWsClient.java:75)
at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:177)
at org.sonar.scanner.report.ReportPublisher.execute(ReportPublisher.java:131)
at org.sonar.scanner.phases.PublishPhaseExecutor.publishReportJob(PublishPhaseExecutor.java:71)
at org.sonar.scanner.phases.PublishPhaseExecutor.executeOnRoot(PublishPhaseExecutor.java:53)
at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:79)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:175)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:143)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:128) …Run Code Online (Sandbox Code Playgroud) 在我的GWT应用程序中,我经常多次引用相同的服务器结果.我也不知道先执行哪个代码.因此,我想使用我的异步(客户端)结果的缓存.
我想使用现有的缓存库; 我正在考虑guava-gwt.
我发现了一个Guava 同步缓存的例子(在guava的文档中):
LoadingCache<Key, Graph> graphs = CacheBuilder.newBuilder()
.build(
new CacheLoader<Key, Graph>() {
public Graph load(Key key) throws AnyException {
return createExpensiveGraph(key);
}
});
Run Code Online (Sandbox Code Playgroud)
这就是我试图异步使用Guava缓存的方式(我不知道如何使这个工作):
LoadingCache<Key, Graph> graphs = CacheBuilder.newBuilder()
.build(
new CacheLoader<Key, Graph>() {
public Graph load(Key key) throws AnyException {
// I want to do something asynchronous here, I cannot use Thread.sleep in the browser/JavaScript environment.
service.createExpensiveGraph(key, new AsyncCallback<Graph>() {
public void onFailure(Throwable caught) {
// how to tell …Run Code Online (Sandbox Code Playgroud) 在Java 8中,我有一个变量,持有一个可选的布尔值.
如果可选项不为空,并且包含的布尔值为true,我想要执行一个操作.
我在做一些类似的事情ifPresentAndTrue,这里有一个完整的例子:
import java.util.Optional;
public class X {
public static void main(String[] args) {
Optional<Boolean> spouseIsMale = Optional.of(true);
spouseIsMale.ifPresentAndTrue(b -> System.out.println("There is a male spouse."));
}
}
Run Code Online (Sandbox Code Playgroud) 我想制作一个cppcheck在Sensor类中运行工具的插件.为了重用现有的和支持的插件,我想使用sonar-cxx插件来导入我的插件的结果.
如何在声纳扫描仪中订购插件?我想确保在声纳扫描程序调用cxx-plugin之前创建了cppcheck报告.
我正在使用类型化响应进行2次API请求调用,将它们组合成一个Observable.forkJoin,我希望将两个结果都放在不同的类型变量中.
var observableOrganization: Observable<Organization> = this.getOrganizationDetails();
var observablePromotion: Observable<Promotion[]> = this.getPromotions();
Observable.forkJoin([ observableOrganization, observablePromotion])
.subscribe(
response => {
organization: Organization = response[0];
promotions: Promotion[] = response[1];
},
error => {
// ...
}
);
Run Code Online (Sandbox Code Playgroud)
如何在单个订阅响应中获得键入的结果?我希望它有所帮助,谢谢你!
我有一个实例 OptionalLong.但我的一个库需要Optional<Long>一个参数.
我怎样才能将我OptionalLong变成一个Optional<Long>?
我梦想着这样的事情:
OptionalLong secondScreenHeight = OptionalLong.of(32l); // or: OptionalLong.empty()
api.setHeight(secondScreenHeight.maptoRegularOptional()); // .maptoUsualOptional does not exist
Run Code Online (Sandbox Code Playgroud) 如何获取PHP数组的最后5个元素?
我的数组是由MySQL查询结果动态生成的.长度不固定.如果长度小于或等于5,则获取全部,否则为最后5.
我尝试了PHP函数last(),array_pop()但它们只返回最后一个元素.
我正在使用 spring boot 创建一个安静的后端应用程序,前端使用 vue。当有人通过我的前端网页向我的后端应用程序发送休息请求时,是否可以在网页或网络浏览器关闭后停止后端处理线程?
我编写了这个java方法但有时颜色String只有5个字符长.有谁知道为什么?
@Test
public void getRandomColorTest() {
for (int i = 0; i < 20; i++) {
final String s = getRandomColor();
System.out.println("-> " + s);
}
}
public String getRandomColor() {
final Random random = new Random();
final String[] letters = "0123456789ABCDEF".split("");
String color = "#";
for (int i = 0; i < 6; i++) {
color += letters[Math.round(random.nextFloat() * 15)];
}
return color;
}
Run Code Online (Sandbox Code Playgroud) 在我的小型独立Java应用程序中,我想存储信息.
我的要求:
因此,我想使用jaxb将所有信息存储在文件系统中的简单XML文件中.我的示例应用程序看起来像这样(将所有代码复制到一个名为Application.java和编译的文件中,没有其他要求!):
@XmlRootElement
class DataStorage {
String emailAddress;
List<String> familyMembers;
// List<Address> addresses;
}
public class Application {
private static JAXBContext jc;
private static File storageLocation = new File("data.xml");
public static void main(String[] args) throws Exception {
jc = JAXBContext.newInstance(DataStorage.class);
DataStorage dataStorage = load();
// the main application will be executed here
// data manipulation like this:
dataStorage.emailAddress = "me@example.com";
dataStorage.familyMembers.add("Mike");
save(dataStorage);
}
protected static DataStorage load() …Run Code Online (Sandbox Code Playgroud)