Hi All,
I have create my own DataModel through IDL struct definition:
--->FooCustomData.idl:
struct FooCustomData{
string<128> aStringVar;
long aLongVar;
float aFloatVar;
boolean aBooleanVar;
};
So i have launch the command "rtiddsgen -language Java -package myexample.customfoo FooCustomData.idl -ppDisable" for code Java generation, and the generator create files:
FooCustomData, FooCustomDataTypeSupport, FooCustomDataTypeCode, FooCustomDataSeq, FooCustomDataDataWriter and FooCustomDataDataReader.
So in my subscriver java class i have add the following code:
DomainParticipant participant = DomainParticipantFactory.get_instance().create_participant(
0,
DomainParticipantFactory.PARTICIPANT_QOS_DEFAULT,
null, // listener
StatusKind.STATUS_MASK_NONE);
if (participant == null) {
System.err.println("Unable to create domain participant");
return;
}
Topic topic = participant.create_topic(
"Test Data",
FooCustomDataTypeSupport.get_type_name(),
DomainParticipant.TOPIC_QOS_DEFAULT,
null, // listener
StatusKind.STATUS_MASK_NONE);
WHen I launch the java application I obtaion the following error:
DDS_Topic_createI:!type registered
Exception in thread "main" com.rti.dds.infrastructure.RETCODE_ERROR: error creating entity
at com.rti.dds.util.Utilities.rethrow(Utilities.java:92)
at com.rti.dds.infrastructure.NativeFactoryMixin.create_entityI(NativeFactoryMixin.java:188)
at com.rti.dds.domain.DomainParticipantImpl.create_topic(DomainParticipantImpl.java:1099)
at com.ndds.testsubscriver.utility.TestMySubscriver.main(TestMySubscriver.java:41)
I think that the problem is probably the definition of FooCustomDataTypeSupport, cause when i have try to substitute it with StringTypeSupport.get_type_name() i have no problem, and the content is DDS:String.
How i can resolve my problem? How i can Debug rti connext the code to understand if my tipe generate is done ok from rtiddsgen ?
Thank you, in advance.
Manuel
Sorry i have forget to register my custom data with the following snippet:
String typeName = FooCustomDataTypeSupport.get_type_name();
FooCustomDataTypeSupport.register_type(participant, typeName);
Topic topic = participant.create_topic(
"Test Data",
typeName,
DomainParticipant.TOPIC_QOS_DEFAULT,
null, // listener
StatusKind.STATUS_MASK_NONE);
bye