How to use OpenDDS 3.13 Security - c++

Recently I try to use OpenDDS 3.13 Security.
I also followed the OpenDDS security manual and make and build project.
Configure command like this:
$./configure --security --xerces --openssl && make
Bulid and make project successful but when I run the example which located in DDS_ROOT/tests/DCPS/Messenger have trouble.
I get the following output:
$./publisher -DCPSConfigFile rtps_uni.ini
Starting publisher
Starting publisher with 1 args
(26771|139728132269888) ERROR: DomainParticipantImpl::enable, Unable to validate local identity. SecurityException[-1.0]: GUID_UNKNOWN passed in for candidate_participant_guid
(26771|139728132269888) ERROR: DomainParticipantFactoryImpl::create_participant, unable to enable DomainParticipant.
publisher.cpp:103: main() ERROR: create_participant failed!
Can I please get some directions on how to solve this issue?

Mr.Simpson reply my question, he said that use
rtps_disc_sec.ini instead of rtps_uni.ini
source is here:
https://github.com/objectcomputing/OpenDDS/issues/934

Related

Lineageos bacon build failed

I am trying to build LineageOS 17.1 bacon based on the steps here: https://wiki.lineageos.org/devices/bacon/build
All steps until the below failure have been successful. Everything is the latest leading to LINEAGE_VERSION=17.1-20210324-UNOFFICIAL-bacon
brunch bacon returns the following failure. This is my first android build, web search did not yield anything useful on how to fix this. Currently, I am clueless, any help/suggestions on how to fix this are very welcome.
[ 75% 372/496] including system/sepolicy/Android.mk ...
system/sepolicy/Android.mk:89: warning: Be careful when using the SELINUX_IGNORE_NEVERALLOWS flag. It does not work in user builds and using it will not stop you from failing CTS.
[100% 496/496] writing build rules ...
build/make/core/Makefile:28: warning: overriding commands for target `out/target/product/bacon/system/vendor/lib/hw/android.hardware.nfc#1.0-impl.so'
build/make/core/base_rules.mk:510: warning: ignoring old commands for target `out/target/product/bacon/system/vendor/lib/hw/android.hardware.nfc#1.0-impl.so'
FAILED: ninja: 'vendor/oppo/msm8974-common/proprietary/vendor/bin/hci_qcomm_init', needed by 'out/target/product/bacon/system/vendor/bin/hci_qcomm_init', missing and no known rule to make it
18:51:33 ninja failed with: exit status 1
Could the above error be due to the missing source?:
$ ./extract-files.sh
Cleaning output directory (./../../oppo/msm8974-common/../../../vendor/oppo/msm8974-common/proprietary)..
Extracting 115 files in ./../../oppo/msm8974-common/proprietary-files.txt from adb:
- vendor/bin/adsprpcd
- vendor/bin/hci_qcomm_init
!! vendor/bin/hci_qcomm_init: file not found in source
Edit: Answering my own question, one has to run adb root on the terminal that guides you want needs to be done on the phone. This can be closed. #lineageos-dev is the place to ask such a question.
Answering my own question, one has to run adb root on the terminal that guides you to do what needs to be done on the phone. This can be closed. #lineageos-dev is the place to ask such a question.

Having issues with Command CodeSign failed with a nonzero exit code giving me also Signing Identity: "-"

I'm learning how to code and I'm at a lesson where I'm building a "messaging app" called FlashChat, I've done everything according to my class but a couple of days ago I pressed Command B after I ran the app on simulator, and the following issue kept showing up and I haven't been able to fix it:
CodeSign /Users/XXXXXXXXXXXXX/Library/Developer/Xcode/DerivedData/Flash_Chat_iOS13-bccxjpmgzvggxgetotmpidocaviy/Build/Products/Debug-iphonesimulator/gRPC-C++/grpcpp.framework (in target 'gRPC-C++' from project 'Pods')
cd /Users/XXXXXXXXXXXXX/Desktop/Development/Flash-Chat-iOS13/Pods
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
Signing Identity: "-"
/usr/bin/codesign --force --sign - --timestamp=none /Users/XXXXXXXXXXXXX/Library/Developer/Xcode/DerivedData/Flash_Chat_iOS13-bccxjpmgzvggxgetotmpidocaviy/Build/Products/Debug-iphonesimulator/gRPC-C++/grpcpp.framework
/Users/XXXXXXXXXXXXX/Library/Developer/Xcode/DerivedData/Flash_Chat_iOS13-bccxjpmgzvggxgetotmpidocaviy/Build/Products/Debug-iphonesimulator/gRPC-C++/grpcpp.framework: resource fork, Finder information, or similar detritus not allowed
Command CodeSign failed with a nonzero exit code
I have tried everything from previous threads from checking KeyChain to verifying files, check bundle identifiers, signing licenses and all other suggestions related to anything written on my issue, any other ideas?
Thanks!!!
Follow these steps:
Update all the pods.
Run this command from the terminal.
$ xattr -cr /Users/user_name/Desktop/Lab/Flash-Chat-iOS13/Pods/gRPC-C++
Go to ~Library/Developer/Xcode/DerivedData. Delete all the folders present in that. The issue might be because Xcode is trying to run a older version of the code.
I am also running the same Flash Chat app from Udemy class. The above steps fixed the issue for me.
Start by trying with step 3 directly. If that doesn't work try all the 3 steps in the sequence.

API build fails in WSO2 API Microgateway 3.1.0

I am new to WSO2 microgateway and was following the steps given in the documentation : "https://docs.wso2.com/display/MG310/Quick+Start+Guide+-+Binary" for exposing the Petstore service via microgateway.
I was able to initialize the API using the swagger file as given in the steps. The Petstore project is also created under the project directory. But when i try to build the project as given in Step 1.2, it fails with an error as shown below. Need suggestions to resolve this issue.
In the ballerina-internal.log file, i get the below error.
[2020-07-16 21:13:19,009] SEVERE {b7a.log.crash} - Array index out of range: 0
java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
at org.ballerinalang.nativeimpl.jvm.interop.JMethodResolver.validateArgumentTypes(JMethodResolver.java:194)
at org.ballerinalang.nativeimpl.jvm.interop.JMethodResolver.validateMethodSignature(JMethodResolver.java:148)
at org.ballerinalang.nativeimpl.jvm.interop.JMethodResolver.resolve(JMethodResolver.java:107)
at org.ballerinalang.nativeimpl.jvm.interop.JInteropMethodValidator.resolveJMethod(JInteropMethodValidator.java:74)
at org.ballerinalang.nativeimpl.jvm.interop.JInteropMethodValidator.validateAndGetJMethod(JInteropMethodValidator.java:61)
at ballerina.jvm.$value$InteropValidator.validateAndGetJMethod(interop.bal:90)
at ballerina.jvm.$value$InteropValidator.call(interop.bal)
at ballerina.compiler_backend_jvm.interop.interop_method_gen.createJMethodWrapper(interop/interop_method_gen.bal:136)
at ballerina.compiler_backend_jvm.interop.interop_method_gen.createJInteropFunctionWrapper(interop/interop_method_gen.bal:128)
at ballerina.compiler_backend_jvm.interop.external_method_gen.createExternalFunctionWrapper(interop/external_method_gen.bal:180)
at ballerina.compiler_backend_jvm.jvm_package_gen.generateClassNameMappings(jvm_package_gen.bal:477)
at ballerina.compiler_backend_jvm.jvm_package_gen.generatePackage(jvm_package_gen.bal:149)
at ballerina.compiler_backend_jvm.jvm_package_gen.generateDependencyList(jvm_package_gen.bal:120)
at ballerina.compiler_backend_jvm.jvm_package_gen.generatePackage(jvm_package_gen.bal:142)
at ballerina.compiler_backend_jvm.jvm_package_gen.generateDependencyList(jvm_package_gen.bal:120)
at ballerina.compiler_backend_jvm.jvm_package_gen.generatePackage(jvm_package_gen.bal:142)
at ballerina.compiler_backend_jvm.jvm_package_gen.generateDependencyList(jvm_package_gen.bal:120)
at ballerina.compiler_backend_jvm.jvm_package_gen.generatePackage(jvm_package_gen.bal:142)
at ballerina.compiler_backend_jvm.jvm_package_gen.generateDependencyList(jvm_package_gen.bal:120)
at ballerina.compiler_backend_jvm.jvm_package_gen.generatePackage(jvm_package_gen.bal:142)
at ballerina.compiler_backend_jvm.main.generateJarBinary(main.bal:86)
at ballerina.compiler_backend_jvm.main.main(main.bal:60)
at ballerina.compiler_backend_jvm.___init.$lambda$main$(compiler_backend_jvm)
at ballerina.compiler_backend_jvm.___init$$Lambda$11.000000001107AEE0.apply(Unknown Source)
at org.ballerinalang.jvm.scheduling.SchedulerItem.execute(Scheduler.java:426)
at org.ballerinalang.jvm.scheduling.Scheduler.run(Scheduler.java:218)
at org.ballerinalang.jvm.scheduling.Scheduler.runSafely(Scheduler.java:191)
at org.ballerinalang.jvm.scheduling.Scheduler$$Lambda$6.0000000010F6DAF0.run(Unknown Source)
at java.lang.Thread.run(Thread.java:813)
Looking at the responses in the comments it looks like the external jdk is not fully compatible with mgw. Not sure on the exact reason though. Here is a bit more background on what going on during the build command and a possible workaround to force mgw use internal jdk.
All mgw distributions (toolkit/runtime) including the binary distribution, contains a jdk internally which is fully compatible with the ballerina version used in the mgw. However during the execution of mgw toolkit command it checks for externally installed jdks (by looking at JAVA_HOME variable) and pick it as the jdk if a compatible version is found in the system. Otherwise it will use the internal jdk.
So to avoid mgw from picking up external jdk, we should set JAVA_HOME variable to "" or invalid location. To do that open micro-gw.bat (assume you are on windows) file in the <TOOLKIT_HOME>/bin directory and around line 55 after SET HOME_CACHE=%MICROGW_HOME%\lib\gateway-balo add SET JAVA_HOME= as command. After the change code block around above line will look like below.
.
.
.
SET PATH=%BALLERINA_HOME%\bin\;%PATH%
SET JAVA_PATH=%MICROGW_HOME%\lib\jdk8u202-b08-jre
SET HOME_CACHE=%MICROGW_HOME%\lib\gateway-balo
REM ******* Below is the line we added to reset the JAVA_HOME *******
SET JAVA_HOME=
REM Check JAVA availability
if EXIST "%JAVA_HOME%" (
ECHO JAVA_HOME: %JAVA_HOME%
.
.
.
Save the file and try the build command again. It should work.

Running SonarQube analysis scan - SonarSource build-wrapper

I'm new to running SonarQube scans and I get this error message in the log in Jenkins:
16:17:39 16:17:36.926 ERROR - The only way to get an accurate analysis of your C/C++/Objective-C project is by using the SonarSource build-wrapper. If for any reason, the use of the build-wrapper is not possible on your project, you can bypass it with the help of the "sonar.cfamily.build-wrapper-output.bypass=true" property. By using that property, you'll switch to an "at best" mode that could result in false-positives and false-negatives.
Can someone please advise where I can find and run this SonarSource build-wrapper?
Thanks a lot for your help!
To solve this issue, download the Build Wrapper directly from your SonarQube Server, so that its version perfectly matches your version of the plugin:
Build Wrapper for Linux can be downloaded from URL
http://localhost:9000/static/cpp/build-wrapper-linux-x86.zip
Unzip the downloaded Build Wrapper,
Configure it in your PATH because it's just more convenient
export PATH=$PATH:/path/where/you/unzip
Once done, Run below commands.
build-wrapper-linux-x86-64 --out-dir <dir-name> <build-command>
build-wrapper-linux-x86-64 --out-dir build_output make clean all
Once all this done, you have to modify your sonar-project.properties file with following line. Note the dir-name is same directory which we defined in previous command.
sonar.cfamily.build-wrapper-output=<dir-name>
and then you can run the sonar scanner command.
sonar-scanner
this will do the analysis against your code. For more details, you can check this link.
Contacted support, turns out this was caused by missing the argument sonar.cfamily.build-wrapper-output in the scanner begin command.
Build wrapper downloads:
Linux: https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
macOS: https://sonarcloud.io/static/cpp/build-wrapper-macosx-x86.zip
Windows: https://sonarcloud.io/static/cpp/build-wrapper-win-x86.zip
Some links covering how to run the build wrapper:
https://docs.sonarqube.org/latest/analysis/languages/cfamily/
https://blog.sonarsource.com/with-great-power-comes-great-configuration/

Error while compiling workspace-d

I tried to install workspace-d on Windows 10 using Administrator privilege but failed.
Here is the error message.I haved installed dmd, dub and git.
PS C:\Users\U\Desktop\workspace-d-installer> .\workspace-d-installer.exe
Welcome to the workspace-d installation guide.
Make sure, you have dmd, dub and git installed.
Which external components do you want to install?
[1] DCD - auto completion
[2] DScanner - code linting
[3] dfmt - code formatting
Enter a comma separated list of numbers
Selected [all]:
Cloning workspace-d into C:\Users\U\AppData\Local\Temp\workspaced-install-635958600835730563
Checking out v2.6.0
Compiling...
Error: Error writing file '..\..\..\..\..\..\U\AppData\Roaming\dub\packages\painlesstraits-0.1.0\.dub\build\library-release-windows-x86-dmd_2071-92537C3AEFB87AC450BFCCEE2ECBED44\painlesstraits.lib'
dmd failed with exit code 1.
Error while compiling workspace-d.
This is a bug with workspace-d-installer. Even though it just runs the shell commands, it has some permission problems on windows. I have opened an issue on the project page if you want to do anything on it: https://github.com/Pure-D/workspace-d-installer/issues/2
The only solution right now is to manually clone each repository (workspace-d, dfmt, dscanner, dcd) and follow their build instructions. I'm trying to fix that issue so you can use workspace-d-installer.