小编coo*_*ego的帖子

Qt 4是一种编程语言吗?

Qt 4是一种编程语言吗?它可以被视为Java和Python的替代品吗?它可以用于在Linux中开发用户交互软件吗?

qt4

13
推荐指数
1
解决办法
1万
查看次数

无法打开输出文件a.out:权限被拒绝,简单编译

我在vim中编写了一些代码,每当我尝试运行代码时它会显示:

coolmego@coolmego-PC:~/coolmego/cprograms$ gcc dfs8puzz.c 
/usr/bin/ld: cannot open output file a.out: Permission denied
collect2: ld returned 1 exit status
coolmego@coolmego-PC:~/coolmego/cprograms$ ./a.out
bash: ./a.out: No such file or directory
Run Code Online (Sandbox Code Playgroud)

我该怎么办?

permissions gcc

3
推荐指数
1
解决办法
2万
查看次数

在jdeveloper中配置和运行集成的weblogic服务器

我知道这可以很简单,但我无法做到这一点.我试图在jdeveloper(v11.1.1.7.0)中启动集成的weblogic服务器.但它总是说以下错误:

*** Using port 7101 ***
C:\Users\595452\AppData\Roaming\JDeveloper\system11.1.1.7.40.64.93\DefaultDomain\bin\startWebLogic.cmd
[waiting for the server to complete its initialization...]
The system cannot find the path specified.
The JRE was not found in directory C:\Oracle\MIDDLE~1\jdk160_29. (JAVA_HOME)
Please edit your environment and set the JAVA_HOME
variable to point to the root directory of your Java installation.
Press any key to continue . . . [Server Instance IntegratedWebLogicServer is shutting down.  All applications currently running will be terminated and undeployed.]
Run Code Online (Sandbox Code Playgroud)

我的Java_home设置为我已经安装的jdk,并且在系统变量的PATH中也有一个条目.

**User variable:**

C:\Program Files\Java\jdk1.7.0_45;C:\Program Files\Java\jre7

**System …
Run Code Online (Sandbox Code Playgroud)

weblogic jdeveloper

2
推荐指数
2
解决办法
3万
查看次数

JUNIT5 @InjectMocks 抛出 NullPointerException

这是我使用 TDD 和 JUNIT 5 的第一个项目。我正在为我的项目使用最新的 Springboot。

我注意到,当我有来自 springboot 的依赖项时,当使用 @InjectMocks 注释时,它们不会在测试阶段被注入。我收到了 authenticationManager 依赖项的 NullPointerException。但是,当 service 方法仅使用使用 springboot JPA 为实体类创建的存储库依赖项时,测试通过。

下面是服务类和对应的测试类。 UserServiceImpl.java

@Service
public class UserServiceImpl implements UserService {

@Autowired
AuthenticationManager authenticationManager;

@Autowired
UserRepository userRepository;

@Autowired
PasswordEncoder passwordEncoder;

@Autowired
UserDetailsService userDetailsService;

@Autowired
JWTUtil jwtUtil;

@Override
@Transactional
public AuthenticationResponseDTO login(AuthenticationRequestDTO authenticationRequestDTO) {
    try {
        authenticationManager.authenticate(
                new UsernamePasswordAuthenticationToken(authenticationRequestDTO.getUserName(), authenticationRequestDTO.getPassword()));

        UserDetails userDetails = userDetailsService.loadUserByUsername(authenticationRequestDTO.getUserName());

        return new AuthenticationResponseDTO(userDetails.getUsername(), jwtUtil.generateToken(userDetails));
    }
    catch (BadCredentialsException e) {
        throw e;
    }
}
Run Code Online (Sandbox Code Playgroud)

UserServiceImplTest.java

@InjectMocks
private UserServiceImpl userServiceImpl;

@Mock …
Run Code Online (Sandbox Code Playgroud)

tdd spring-security spring-boot junit5

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