openlvc / portico

Portico is an open source, cross-platform, fully supported HLA RTI implementation. Designed with modularity and flexibility in mind, Portico is a production-grade RTI for the Simulation and Training Community, so come say hi!
http://www.porticoproject.org
151 stars 81 forks source link

Testing not working #298

Open icemagno opened 4 years ago

icemagno commented 4 years ago

After create the sandbox ( ./ant sandbox ) I try to run a test but receive the follow error:

/home/portico/dist/portico-2.2.0/examples/java/ieee1516e # ./linux.sh execute
ExampleFederate   : Creating RTIambassador
ExampleFederate   : Connecting...
21:09:01,966 INFO  portico.lrc: Creating new LRC
21:09:01,968 INFO  portico.lrc: Portico version: 2.2.0 (build 0)
21:09:01,968 INFO  portico.lrc: Interface: IEEE1516e
21:09:03,230 INFO  portico.lrc: LRC initialized (HLA version: IEEE1516e)
hla.rti1516e.exceptions.ConnectionFailed: Could not find RTI running anywhere
        at org.portico.impl.hla1516e.Impl1516eHelper.connect(Impl1516eHelper.java:166)
        at org.portico.impl.hla1516e.Impl1516eHelper.connect(Impl1516eHelper.java:115)
        at org.portico.impl.hla1516e.Rti1516eAmbassador.connect(Rti1516eAmbassador.java:207)
        at ieee1516e.ExampleFederate.runFederate(ExampleFederate.java:190)
        at ieee1516e.ExampleFederate.main(ExampleFederate.java:574)
Caused by: org.portico.lrc.compat.JConnectionFailed: Could not find RTI running anywhere
        at org.portico2.lrc.LRCConnection.connect(LRCConnection.java:71)
        at org.portico2.lrc.LRC.connect(LRC.java:185)
        at org.portico.impl.hla1516e.Impl1516eHelper.connect(Impl1516eHelper.java:162)
        ... 4 more
/home/portico/dist/portico-2.2.0/examples/java/ieee1516e #

What may be wrong?

icemagno commented 4 years ago

@michaelrfraser please help me

michaelrfraser commented 4 years ago

@icemagno just checking this out now...

michaelrfraser commented 4 years ago

Ok, so firstly my apologies. I haven't been in the portico codebase for at least a year now and I couldn't quite remember what was currently in the master branch.

Previously portico used to run in a purely decentralised fashion, meaning that there was no central rtiexec process required. However about half way through 2018 we moved back to having a central RTI process to implement some advanced features (such as encryption etc).

This means that rtiexec needs to be running on the network first before any federates start up. To start rtiexec:

  1. Open a new terminal and navigate to /home/portico/dist/portico-2.2.0
  2. Start rtiexec by running bin/rtiexec.sh

Once started you should be able to switch back to your original termal and run the federate example.

Best Regards,

Michael

icemagno commented 4 years ago

It is a great News! So close to my intent to crate a Docker image running a central RTI.

So..... can I just run the rtiexec ANYWHERE in my network and run any federates in another machines? Are they using broadcasting to find each other?

icemagno commented 4 years ago

@timpokorny @michaelrfraser Good! the rtiexec.sh solved the problem. But....

Now, after trying again to run the example (in another machine) I have this error in the CRTI machine:

00:58:27,175 INFO  portico.rti: Starting the RTI
00:58:27,176 INFO  portico.rti: Starting connection tcp
00:58:29,198 INFO  portico.rti: Starting connection jvm
00:58:29,301 INFO  portico.rti: Starting connection multicast
00:58:33,593 INFO  portico.rti: RTI is up. Connections active and ready for bizness!

rti /> 01:01:32,060 INFO  portico.rti: ATTEMPT Creating federation name=ExampleFederation
01:01:32,115 INFO  portico.rti: SUCCESS Created federation name=ExampleFederation
01:01:32,178 INFO  portico.rti.{ExampleFederation}: SUCCESS Federate [exampleFederate] joined federation [Ex                                    ampleFederation] with handle [1]
01:01:32,194 INFO  portico.rti: Federate [exampleFederate] joined federation via connection multicast (type:                                    Multicast)
01:01:32,225 INFO  portico.rti.{ExampleFederation}: SUCCESS Registered sync point [ReadyToRun] by [exampleFe                                    derate]
01:01:32,225 WARN  portico.rti.{ExampleFederation}: Error sending message [AnnounceSyncPoint] via connection                                     [multicast]
org.portico.lrc.compat.JRTIinternalError: Async Messages no longer supported - move to Notificatins
        at org.portico2.common.network.Connection.sendControlRequest(Connection.java:257) ~[portico.jar:?]
        at org.portico2.rti.RtiConnection.sendControlRequest(RtiConnection.java:99) ~[portico.jar:?]
        at org.portico2.rti.federation.Federation$OutgoingMessageProcessor.sendMessage(Federation.java:521)                                     [portico.jar:?]
        at org.portico2.rti.federation.Federation$OutgoingMessageProcessor.run(Federation.java:502) [portico                                    .jar:?]

... and in the Example Federate:

root@portico:/opt/portico-2.2.0/examples/java/ieee1516e# ./linux.sh execute
ExampleFederate   : Creating RTIambassador
ExampleFederate   : Connecting...
02:03:56,148 INFO  portico.lrc: Creating new LRC
02:03:56,151 INFO  portico.lrc: Portico version: 2.2.0 (build 0)
02:03:56,152 INFO  portico.lrc: Interface: IEEE1516e
02:04:00,701 INFO  portico.lrc: LRC initialized (HLA version: IEEE1516e)
ExampleFederate   : Creating Federation...
02:04:03,520 INFO  portico.lrc: SUCCESS Created federation execution [ExampleFederation] with handle 1
ExampleFederate   : Created Federation
02:04:03,661 INFO  portico.lrc: SUCCESS Federate [exampleFederate] joined to federation [ExampleFederation] with handle [1]
ExampleFederate   : Joined Federation as exampleFederate
FederateAmbassador: Successfully registered sync point: ReadyToRun
Still waiting for announce
Still waiting for announce
Still waiting for announce
Still waiting for announce
Still waiting for announce
Still waiting for announce
Still waiting for announce
Still waiting for announce
Still waiting for announce
Still waiting for announce
Still waiting for announce
Still waiting for announce
Still waiting for announce

... forever.

How to change to TCP connection instead MULTICAST ?

PS: Attention to the typo in Async Messages no longer supported - move to Notificatins

icemagno commented 4 years ago

A similar error:


19:01:13,669 WARN  portico.rti.{BasicFederation}: Error sending message [DiscoverObject] via connection [multicast]
org.portico.lrc.compat.JRTIinternalError: Async Messages no longer supported - move to Notificatins
        at org.portico2.common.network.Connection.sendControlRequest(Connection.java:257) ~[portico.jar:?]
        at org.portico2.rti.RtiConnection.sendControlRequest(RtiConnection.java:99) ~[portico.jar:?]
        at org.portico2.rti.federation.Federation$OutgoingMessageProcessor.sendMessage(Federation.java:521) [portico.jar:?]
        at org.portico2.rti.federation.Federation$OutgoingMessageProcessor.run(Federation.java:502) [portico.jar:?]

... and a eternal loop in federete execution screen: 19:01:13,749 INFO portico.lrc: SUCCESS Updated object [3] with attributes [739] (RO)

icemagno commented 4 years ago

Well.... I've decided to rollback to the v2.1.0 and have no centralized RTI to run.

BUT...

the tests still having error. Now it seems related to the SOM or FOM. This is a local one instance run:

root@portico:/opt/portico-2.1.0/examples/java/ieee1516e# ./linux.sh execute
ExampleFederate   : Creating RTIambassador
ExampleFederate   : Connecting...
ExampleFederate   : Creating Federation...

-------------------------------------------------------------------
GMS: address=portico-9905, cluster=ExampleFederation, physical address=172.17.0.3:46641
-------------------------------------------------------------------
ExampleFederate   : Created Federation
ExampleFederate   : Joined Federation as exampleFederate

FederateAmbassador: Successfully registered sync point: ReadyToRun
FederateAmbassador: Synchronization point announced: ReadyToRun
ExampleFederate   :  >>>>>>>>>> Press Enter to Continue <<<<<<<<<<
ExampleFederate   : Achieved sync point: ReadyToRun, waiting for federation...
FederateAmbassador: Federation Synchronized: ReadyToRun
ExampleFederate   : Time Policy Enabled
hla.rti1516e.exceptions.AttributeNotDefined: org.portico.lrc.compat.JAttributeNotDefined: PUBLISH-OBJECT: attribute [-1] not defined in object class [HLAobjectRoot.Food.Drink.Soda]
        at org.portico.impl.hla1516e.Rti1516eAmbassador.publishObjectClassAttributes(Rti1516eAmbassador.java:1161)
        at ieee1516e.ExampleFederate.publishAndSubscribe(ExampleFederate.java:403)
        at ieee1516e.ExampleFederate.runFederate(ExampleFederate.java:281)
        at ieee1516e.ExampleFederate.main(ExampleFederate.java:560)
Caused by: org.portico.lrc.compat.JAttributeNotDefined: PUBLISH-OBJECT: attribute [-1] not defined in object class [HLAobjectRoot.Food.Drink.Soda]
        at org.portico.lrc.services.object.data.InterestManager.register(InterestManager.java:160)
        at org.portico.lrc.services.object.data.InterestManager.register(InterestManager.java:108)
        at org.portico.lrc.services.object.data.InterestManager.publishObjectClass(InterestManager.java:619)
        at org.portico.lrc.services.pubsub.handlers.outgoing.PublishObjectClassHandler.process(PublishObjectClassHandler.java:110)
        at org.portico.utils.messaging.MessageSink.process(MessageSink.java:187)
        at org.portico.impl.hla1516e.Impl1516eHelper.processMessage(Impl1516eHelper.java:130)
        at org.portico.impl.hla1516e.Rti1516eAmbassador.processMessage(Rti1516eAmbassador.java:5559)
        at org.portico.impl.hla1516e.Rti1516eAmbassador.publishObjectClassAttributes(Rti1516eAmbassador.java:1135)
        ... 3 more
root@portico:/opt/portico-2.1.0/examples/java/ieee1516e#

Tried my own Federate and it worked. I think this problem is only in ExampleFederate.

farhan-mirzaaa commented 1 year ago

Well.... I've decided to rollback to the v2.1.0 and have no centralized RTI to run.

BUT...

the tests still having error. Now it seems related to the SOM or FOM. This is a local one instance run:

root@portico:/opt/portico-2.1.0/examples/java/ieee1516e# ./linux.sh execute
ExampleFederate   : Creating RTIambassador
ExampleFederate   : Connecting...
ExampleFederate   : Creating Federation...

-------------------------------------------------------------------
GMS: address=portico-9905, cluster=ExampleFederation, physical address=172.17.0.3:46641
-------------------------------------------------------------------
ExampleFederate   : Created Federation
ExampleFederate   : Joined Federation as exampleFederate

FederateAmbassador: Successfully registered sync point: ReadyToRun
FederateAmbassador: Synchronization point announced: ReadyToRun
ExampleFederate   :  >>>>>>>>>> Press Enter to Continue <<<<<<<<<<
ExampleFederate   : Achieved sync point: ReadyToRun, waiting for federation...
FederateAmbassador: Federation Synchronized: ReadyToRun
ExampleFederate   : Time Policy Enabled
hla.rti1516e.exceptions.AttributeNotDefined: org.portico.lrc.compat.JAttributeNotDefined: PUBLISH-OBJECT: attribute [-1] not defined in object class [HLAobjectRoot.Food.Drink.Soda]
        at org.portico.impl.hla1516e.Rti1516eAmbassador.publishObjectClassAttributes(Rti1516eAmbassador.java:1161)
        at ieee1516e.ExampleFederate.publishAndSubscribe(ExampleFederate.java:403)
        at ieee1516e.ExampleFederate.runFederate(ExampleFederate.java:281)
        at ieee1516e.ExampleFederate.main(ExampleFederate.java:560)
Caused by: org.portico.lrc.compat.JAttributeNotDefined: PUBLISH-OBJECT: attribute [-1] not defined in object class [HLAobjectRoot.Food.Drink.Soda]
        at org.portico.lrc.services.object.data.InterestManager.register(InterestManager.java:160)
        at org.portico.lrc.services.object.data.InterestManager.register(InterestManager.java:108)
        at org.portico.lrc.services.object.data.InterestManager.publishObjectClass(InterestManager.java:619)
        at org.portico.lrc.services.pubsub.handlers.outgoing.PublishObjectClassHandler.process(PublishObjectClassHandler.java:110)
        at org.portico.utils.messaging.MessageSink.process(MessageSink.java:187)
        at org.portico.impl.hla1516e.Impl1516eHelper.processMessage(Impl1516eHelper.java:130)
        at org.portico.impl.hla1516e.Rti1516eAmbassador.processMessage(Rti1516eAmbassador.java:5559)
        at org.portico.impl.hla1516e.Rti1516eAmbassador.publishObjectClassAttributes(Rti1516eAmbassador.java:1135)
        ... 3 more
root@portico:/opt/portico-2.1.0/examples/java/ieee1516e#

Tried my own Federate and it worked. I think this problem is only in ExampleFederate.

I am new to this RTI and I have to run this RTI with a third party application. I am facing same issue while running the java\ieee1516e example in portico project. Could you please tell me how you solved this issue. Waiting for your reply. Regards