Python: Failed to create Connector

5 posts / 0 new
Last post
Offline
Last seen: 1 week 5 days ago
Joined: 03/30/2019
Posts: 4
Python: Failed to create Connector

Got below error when I try to create participant from XML via 

rti.open_connector()

rticonnextdds_connector.rticonnextdds_connector.Error: Failed to create Connector:
DDS_XMLHelper_lookupXmlTypeCode:!get XMLTypeCode
DDS_XMLRegisterType_get_type_code:!get XML TypeCode not found
DDS_FactoryXmlPlugin_assertTopic:!Assert registered type
DDS_DomainParticipantFactory_create_participant_from_config:!create participant with default parameters
RTIDDSConnector_newI:!new participant
RTIDDSConnector_EntitiesLookupList_delete:RTIDDSConnector

 

Any idea to fix it? Do I need to call alternative api like  rti::domain::register_type in c++?

Offline
Last seen: 1 week 4 days ago
Joined: 04/02/2013
Posts: 140

It looks like your xml configuration doesn't properly define the data type or it is not properly registered. Can you share your xml configuration?

Compare your file with this one: https://github.com/rticommunity/rticonnextdds-connector-py/blob/master/examples/python/ShapeExample.xml

 

Make sure the type is registered and properly assigned to a topic:

<domain_library name="MyDomainLibrary">
<domain name="MyDomain" domain_id="0">
<register_type name="ShapeType" type_ref="ShapeType" />
<topic name="Square" register_type_ref="ShapeType"/>
<topic name="Circle" register_type_ref="ShapeType"/>
</domain>
</domain_library> 

 "type_ref" is the name of the type within the <types> tag, while "name" is the name to register it with. In most cases you can use the same name. Then you have to use the "name" in "register_type_ref".

 

Offline
Last seen: 1 week 5 days ago
Joined: 03/30/2019
Posts: 4

Thanks for pointing the direction. Actually I plan to use the XML file generared from idl file. It seems above shape example isn't the case which define the data directly inside xml rather than IDL. Do you know how to handl this situation?

Offline
Last seen: 1 week 4 days ago
Joined: 04/02/2013
Posts: 140

You can include additional XML files with types:

 

rtiddsgen -convertToXml myTypes.idl

Connector XML:

<dds>
 <types>
   <include file="myTypes.xml"/>
 </types>
 <domain_library name="MyDomainLib">
 ...
</dds>  
Offline
Last seen: 1 week 5 days ago
Joined: 03/30/2019
Posts: 4

Make my day.Thanks