Hello,
I am new with DDS. I am trying to to create a participant in java, I called this API create_participant_with_profile. I got error for unknow source of library_name and profile_name that I passed in create_participant_with_profile function . FYI, it works fine in CPP when I used CPP API create_participant_with_profile(...). Thanks very much for your help!
I defined a 2nd qos_profile in User_QOS_PROFILES.xml
<qos_library name="HelloWorld_Library">
<qos_profile name="HelloWorld_Profile2" base_name="BuiltinQosLibExp::Generic.StrictReliable" is_default_qos="true">
In java code:
String profile_name = "HelloWorld_Profile2";
String library_name = "HelloWorld_Library";
participant = DomainParticipantFactory.TheParticipantFactory.create_participant_with_profile(domainId,library_name, profile_name,
null, StatusKind.STATUS_MASK_NONE);
Error at run time:
run:
Exception in thread "main" com.rti.dds.infrastructure.RETCODE_ERROR:
DDS_QosProvider_get_profile_xml_objectI:ERROR: Profile 'HelloWorld_Library::HelloWorld_Profile2' not found
DDS_QosProvider_get_participant_qos_from_profile:ERROR: Profile 'HelloWorld_Library::HelloWorld_Profile2' not found
at com.rti.dds.infrastructure.RETCODE_ERROR.check_return_codeI(Unknown Source)
at com.rti.dds.domain.DomainParticipantFactoryImpl.get_participant_qos_from_profile(Unknown Source)
at com.rti.dds.domain.DomainParticipantFactoryImpl.create_participant_with_profile(Unknown Source)
at HelloWorldPublisher.publisherMain(HelloWorldPublisher.java:131)
at HelloWorldPublisher.main(HelloWorldPublisher.java:90)
DDS_QosProvider_get_profile_xml_objectI:ERROR: Profile 'HelloWorld_Library::HelloWorld_Profile2' not found
DDS_QosProvider_get_participant_qos_from_profile:ERROR: Profile 'HelloWorld_Library::HelloWorld_Profile2' not found
C:\Users\e351426\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1
Hi,
Are you running your Java application where the USER_QOS_PROFILE.xml file is? That could explain why it is not finding. You could also configure where your application is looking for the XML file (see how here).
Thanks,
Sara
It is exactly like you said. I got it working. Thank you very much Sara!