我有一个 Spring Boot 应用程序,我想在其中将消息外部化。我将这些消息分类为错误、信息和成功。因此,我正在创建一个嵌套的文件夹结构,如下所示:
而且,我试图通过以下方式从服务访问它:
Locale locale = new Locale("en");
ResourceBundle errors = ResourceBundle.getBundle("errors", locale);
System.out.println(errors.getString("E000"));
Run Code Online (Sandbox Code Playgroud)
这给了我以下异常:
java.util.MissingResourceException:无法找到基本名称错误的包,语言环境
但是,如果我将属性文件保留在文件夹之外,如下所示,它可以正常工作:
所以,
我试图使用递归找出数字的阶乘,并将指针作为函数参数传递.但是这个错误一直出现.经销商和编码员!我需要你的帮助.
The code
#include<stdio.h>
int *factorial(int *);
int value, p=0, q=1, x, tmp;
void main() {
int *result;
puts("Enter the value::");
scanf("%d",&value);
result = factorial(&value);
printf("\nThe Result is::%d\n", *result);
}
int *factorial(int *n) {
if(*n == p || *n == q) {
return(&q);
}
else {
tmp = *n -1;
*n *= (factorial(&tmp));
return(n);
}
}
The error:
error: invalid operands to binary * (have ‘int’ and ‘int *’)
*n *= (factorial(&tmp));
Run Code Online (Sandbox Code Playgroud) 我有一个带有一个Fabric CA的单组织设置。CA Server与MySQL一起运行。我正在使用NodeSDK来连接事务并将其发布到Chaincode。
我能够为同行和订购者设置国家,州,地区,组织和组织单位属性。但是,当我在Fabric中注册并注册“用户”时,并不是所有属性都已设置。从证书文件中可以看到,仅设置了“公用名”和“组织单位”属性。
以下是我用于注册和注册用户的代码段:
await gateway.connect(connectionProfile, { wallet, identity: 'admin', discovery: { enabled: false } });
ca = await gateway.getClient().getCertificateAuthority();
adminIdentity = gateway.getCurrentIdentity();
const secret = await ca.register({
affiliation: user.$affiliation,
enrollmentID: user.$name,
role: user.$role,
}, adminIdentity);
const enrollment = await ca.enroll({
enrollmentID: user.$name,
enrollmentSecret: secret,
});
const userIdentity = await X509WalletMixin.createIdentity(process.env.ACTIVE_MSP, enrollment.certificate, enrollment.key.toBytes());
Run Code Online (Sandbox Code Playgroud)
在这里,“用户”是我在应用程序中使用的参与者的模型。公用名(CN)设置为“ enrollmentID”,组织单位设置为“ role” +“ affiliation”,并且为用户生成的证书具有以下信息:
Owner: CN=jondoe, OU=client + OU=admin.forwarder.com
Issuer: CN=ca.allparticipants.logistics.com,
O=allparticipants.logistics.com, L=Bengaluru, ST=Karnataka, C=IN
Serial number: ea385863390c07c320fd6717de7878fd9f81dc3e
Valid from: Mon Apr 15 14:11:00 IST …Run Code Online (Sandbox Code Playgroud) hyperledger-fabric hyperledger-fabric-ca hyperledger-fabric-sdk-js