小编kgi*_*ibm的帖子

Spring Boot JAX-RS/CXF依赖注入在JAR中工作,但不在WAR中工作

我正在使用cxf.jaxrs.classes-scan和cxf.jaxrs.classes-scan-packages将现有的vanilla JAX-RS应用程序JAR与Spring Boot应用程序包装在一起.当我作为JAR或者运行时maven spring-boot:run,依赖注入工作正常.当我作为WAR运行时(在WebSphere Liberty 17.0.0.2上),- @Injectable字段null在REST请求期间.

这是SpringBootApplication:

@SpringBootApplication(scanBasePackages = { "com.test" })
public class CustomerServiceApplication extends SpringBootServletInitializer {
  public static void main(String[] args) {
    SpringApplication.run(CustomerServiceApplication.class, args);
  }

  @Override
  protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
    return application.sources(CustomerServiceApplication.class);
  }
}
Run Code Online (Sandbox Code Playgroud)

这是src/main/resources/application.properties:

cxf.path=/
cxf.jaxrs.classes-scan=true
cxf.jaxrs.classes-scan-packages=com.test,com.fasterxml.jackson.jaxrs.json
Run Code Online (Sandbox Code Playgroud)

这是Maven pom.xml(vanilla JAX-RS应用程序JAR是本地存储库中的customerservice-java):

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>customerservice-springboot</groupId>
    <artifactId>customerservice-springboot</artifactId>
    <packaging>war</packaging>
    <version>2.0.0-SNAPSHOT</version>
    <name>Customer Service :: Spring Boot</name>

    <!-- We need …
Run Code Online (Sandbox Code Playgroud)

spring dependency-injection cxf jax-rs spring-boot

7
推荐指数
1
解决办法
907
查看次数

如何在R中转换64位十六进制字符串?

如何在R中转换64位十六进制字符串?

> library(int64)
> as.int64("7f2d36a2a000")
[1] NA
Warning message:
In as.int64("7f2d36a2a000") : NAs introduced
> as.int64("0x7f2d36a2a000")
[1] NA
Warning message:
In as.int64("0x7f2d36a2a000") : NAs introduced
Run Code Online (Sandbox Code Playgroud)

r type-conversion int64

4
推荐指数
2
解决办法
3161
查看次数

dia2dump:CoCreateInstance 失败 - HRESULT = 80040154

我正在尝试使用 Visual Studio 2017 及其dia2dump在 Windows 7 x64 上转储 PDB 的签名。我加载了C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\DIA SDK\Samples\DIA2Dump\DIA2Dump.sln。它构建成功:

1>------ Rebuild All started: Project: Dia2Dump, Configuration: Debug x64 ------
1>stdafx.cpp
1>regs.cpp
1>PrintSymbol.cpp
1>dia2dump.cpp
1>Generating Code...
1>Dia2Dump.vcxproj -> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\DIA SDK\Samples\DIA2Dump\x64\Debug\Dia2Dump.exe
1>Dia2Dump.vcxproj -> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\DIA SDK\Samples\DIA2Dump\x64\Debug\Dia2Dump.pdb (Partial PDB)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
Run Code Online (Sandbox Code Playgroud)

当我在 PDB 上运行它时,出现以下错误:

C:\>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\DIA SDK\Samples\DIA2Dump\x64\Debug\Dia2Dump.exe" file.pdb
CoCreateInstance failed - HRESULT = 80040154 …
Run Code Online (Sandbox Code Playgroud)

windows visual-studio-2017

2
推荐指数
4
解决办法
3186
查看次数