What’s the bug? Was it using classes you did or didn’t import?

> On Apr 6, 2021, at 12:03 PM, David Slotemaker de Bruine 
> <dslotema...@vicensvives.com> wrote:
> 
> Hi All,
> 
> I have found the culprit. It has nothing to do with Moonshine, but seems to 
> be a "Feature" of the Compiler. I am not sure where I should file this 
> problem.
> 
> The problem stemmed from one of my ItemRenderers buried deep in the 
> application that I modified recently that somehow had the following line.
> 
> import org.apache.royale.net.remoting.messages.ErrorMessage;
> 
> I was trying to import "Error" and at some point I imported "ErrorMessage" by 
> mistake. Everything compiles fine. BUT I think that because the import  
> includes: "org.apache.royale.net.remoting"
> 
> this causes the compiler to use this set of classes INSTEAD of the MX 
> classes. Causing the error I was receiving at run time! 
> 
> Where should I send this information?
> 
> David
> 
> 
> 
> On Thu, 1 Apr 2021 at 13:15, David Slotemaker de Bruine 
> <dslotema...@vicensvives.com <mailto:dslotema...@vicensvives.com>> wrote:
> Hi all again, I have been trying to solve this error and I am getting closer.
> 
> Making the same call using the same backend with a different (non CRUX) 
> project works fine.
> 
> The server returns the correct object in both cases (checked via charles 
> proxy).
> 
> I also eliminated the use of "serviceHelper.executeServiceCall" by injecting 
> the remote object directly into the Controller ad add event listeners there. 
> This also causes the same 
> "Was expecting mx.messaging.messages.AcknowledgeMessage" error.
> 
> Stepping through the executing stack I have found the error here within the 
> "NetConnectionChannel.js" file line 434.
> 
>  if (org.apache.royale.utils.Language.is 
> <http://org.apache.royale.utils.language.is/>(msg, 
> mx.messaging.messages.AsyncMessage)) {
> 
> For some reason the format of msg at this point is:
> 
> org.apache.royale.net.remoting.messages.AcknowledgeMessage
> 
>   this  causes the else condition (line 446) to trigger and return a 
> mx.FaultEvent.
> 
> My question is what could be causing ApacheRoyal to convert 
> 
> flex.messaging.messages.AcknowledgeMessage
>  to 
> org.apache.royale.net.remoting.messages.AcknowledgeMessage 
> 
> instead of  mx.messaging.messages.AsyncMessage
> 
> Do I have an import in some file that is causing this?
> 
> Any help would be great!
> 
> 
> 
> 
> On Thu, 25 Mar 2021 at 18:08, Piotr Zarzycki <piotrzarzyck...@gmail.com 
> <mailto:piotrzarzyck...@gmail.com>> wrote:
> Could it be that Moonshine has download a new version of the SDK 
> automatically? 
> 
> No it's not possible.  
> 
> czw., 25 mar 2021 o 18:02 David Slotemaker de Bruine 
> <dslotema...@vicensvives.com <mailto:dslotema...@vicensvives.com>> napisał(a):
> I have been busy coding away today and everything has run great.
> 
> All of a sudden the server call response for logging in returns correctly 
> (visible in Charles) But the the fault event is execute in Royal, the Fault 
> message is shown below.
> 
> I have restarted both Moonshine and the webserver. Could it be that Moonshine 
> has download a new version of the SDK automatically? I was also getting 
> strange import warning message (Like it couldn't find custom MXML tags) in 
> Moonshine that appeared at random and dissapeared just as easily.
> 
> The error message is:
> 
> Was expecting mx.messaging.messages.AcknowledgeMessage, but received 
> org_apache_royale_net_remoting_messages_AbstractMessage__body: [object Object]
> org_apache_royale_net_remoting_messages_AsyncMessage__correlationId: 
> A851B89E-E780-FA11-83B4-605CBF96A156
> org_apache_royale_net_remoting_messages_AsyncMessage_correlationIdBytes: null
> org_apache_royale_net_remoting_messages_AbstractMessage__timestamp: 
> 1616691094852
> org_apache_royale_net_remoting_messages_AbstractMessage__headers: [object 
> Object]
> org_apache_royale_net_remoting_messages_AbstractMessage__messageId: 
> FB84833B-040E-C228-2D21-FD2BBA079250
> org_apache_royale_net_remoting_messages_AbstractMessage_messageIdBytes: null
> org_apache_royale_net_remoting_messages_AbstractMessage__timeToLive: 0
> org_apache_royale_net_remoting_messages_AbstractMessage__clientId: 
> FB848211-2A0D-71E2-3F9D-EB16532C14A5
> org_apache_royale_net_remoting_messages_AbstractMessage_clientIdBytes: null
> org_apache_royale_net_remoting_messages_AbstractMessage__destination: null
> constructor: function() {
>   org.apache.royale.net 
> <http://org.apache.royale.net/>.remoting.messages.AcknowledgeMessage.base(this,
>  'constructor');
> }
> getSmallMessage: function() {
>   
> org.apache.royale.utils.Language.trace("AcknowledgeMessage.getSmallMessage");
>   var /** @type {Object} */ o = this;
>   if (o.constructor == org.apache.royale.net 
> <http://org.apache.royale.net/>.remoting.messages.AcknowledgeMessage)
>     return new org.apache.royale.net 
> <http://org.apache.royale.net/>.remoting.messages.AcknowledgeMessageExt(this);
>   return null;
> }
> readExternal: function(input) {
>   org.apache.royale.net 
> <http://org.apache.royale.net/>.remoting.messages.AcknowledgeMessage.superClass_.readExternal.apply(this,
>  [ input] );
>   var /** @type {Array} */ flagsArray = this.readFlags(input);
>   for (var /** @type {number} */ i = 0; i < flagsArray.length; i++) {
>     var /** @type {number} */ flags = (org.apache.royale.utils.Language.as 
> <http://org.apache.royale.utils.language.as/>(flagsArray[i], 
> org.apache.royale.utils.Language.synthType('uint'))) >>> 0;
>     var /** @type {number} */ reservedPosition = 0;
>     if ((flags >> reservedPosition) != 0) {
>       for (var /** @type {number} */ j = reservedPosition; j < 6; j++) {
>         if (((flags >> j) & 1) != 0) {
>           input.readObject();
>         }
>       }
>     }
>   }
> }
> writeExternal: function(output) {
>   org.apache.royale.net 
> <http://org.apache.royale.net/>.remoting.messages.AcknowledgeMessage.superClass_.writeExternal.apply(this,
>  [ output] );
>   org.apache.royale.utils.Language.trace("AcknowledgeMessage.writeExternal");
>   var /** @type {number} */ flags = 0;
>   output.writeByte((flags) >> 0);
> }
> ROYALE_CLASS_INFO: [object Object]
> ROYALE_REFLECTION_INFO: function () {
>   return {
>     methods: function () {
>       return {
>         'AcknowledgeMessage': { type: '', declaredBy: 'org.apache.royale.net 
> <http://org.apache.royale.net/>.remoting.messages.AcknowledgeMessage'},
>         'getSmallMessage': { type: 'org.apache.royale.net 
> <http://org.apache.royale.net/>.remoting.messages.IMessage', declaredBy: 
> 'org.apache.royale.net 
> <http://org.apache.royale.net/>.remoting.messages.AcknowledgeMessage'},
>         'readExternal': { type: 'void', declaredBy: 'org.apache.royale.net 
> <http://org.apache.royale.net/>.remoting.messages.AcknowledgeMessage', 
> parameters: function () { return [ 'org.apache.royale.utils.net 
> <http://org.apache.royale.utils.net/>.IDataInput', false ]; }},
>         'writeExternal': { type: 'void', declaredBy: 'org.apache.royale.net 
> <http://org.apache.royale.net/>.remoting.messages.AcknowledgeMessage', 
> parameters: function () { return [ 'org.apache.royale.utils.net 
> <http://org.apache.royale.utils.net/>.IDataOutput', false ]; }}
>       };
>     }
>   };
> }
> ROYALE_COMPILE_FLAGS: 10
> get__correlationId: function() {
>   return 
> this.org_apache_royale_net_remoting_messages_AsyncMessage__correlationId;
> }
> set__correlationId: function(value) {
>   this.org_apache_royale_net_remoting_messages_AsyncMessage__correlationId = 
> value;
>   
> this.org_apache_royale_net_remoting_messages_AsyncMessage_correlationIdBytes 
> = null;
> }
> toString: function() {
>   return org.apache.royale.utils.ObjectUtil._toString(this);
> }
> readExternalBody: function(input) {
>   this.body = input.readObject();
> }
> readFlags: function(input) {
>   var /** @type {boolean} */ hasNextFlag = true;
>   var /** @type {Array} */ flagsArray = [];
>   while (hasNextFlag && input.bytesAvailable > 0) {
>     var /** @type {number} */ flags = input.readUnsignedByte();
>     flagsArray.push(flags);
>     if ((flags & org.apache.royale.net 
> <http://org.apache.royale.net/>.remoting.messages.AbstractMessage.HAS_NEXT_FLAG)
>  != 0)
>       hasNextFlag = true;
>     else
>       hasNextFlag = false;
>   }
>   return flagsArray;
> }
> writeExternalBody: function(output) {
>   output.writeObject(this.body);
> }
> get__body: function() {
>   return this.org_apache_royale_net_remoting_messages_AbstractMessage__body;
> }
> set__body: function(value) {
>   this.org_apache_royale_net_remoting_messages_AbstractMessage__body = value;
> }
> get__clientId: function() {
>   return 
> this.org_apache_royale_net_remoting_messages_AbstractMessage__clientId;
> }
> set__clientId: function(value) {
>   this.org_apache_royale_net_remoting_messages_AbstractMessage__clientId = 
> value;
>   this.org_apache_royale_net_remoting_messages_AbstractMessage_clientIdBytes 
> = null;
> }
> get__destination: function() {
>   return 
> this.org_apache_royale_net_remoting_messages_AbstractMessage__destination;
> }
> set__destination: function(value) {
>   this.org_apache_royale_net_remoting_messages_AbstractMessage__destination = 
> value;
> }
> get__headers: function() {
>   if (this.org_apache_royale_net_remoting_messages_AbstractMessage__headers 
> == null)
>     this.org_apache_royale_net_remoting_messages_AbstractMessage__headers = 
> {};
>   return 
> this.org_apache_royale_net_remoting_messages_AbstractMessage__headers;
> }
> set__headers: function(value) {
>   this.org_apache_royale_net_remoting_messages_AbstractMessage__headers = 
> value;
> }
> get__messageId: function() {
>   if (this.org_apache_royale_net_remoting_messages_AbstractMessage__messageId 
> == null)
>     this.org_apache_royale_net_remoting_messages_AbstractMessage__messageId = 
> org.apache.royale.utils.UIDUtil.createUID();
>   return 
> this.org_apache_royale_net_remoting_messages_AbstractMessage__messageId;
> }
> set__messageId: function(value) {
>   this.org_apache_royale_net_remoting_messages_AbstractMessage__messageId = 
> value;
>   this.org_apache_royale_net_remoting_messages_AbstractMessage_messageIdBytes 
> = null;
> }
> get__timestamp: function() {
>   return 
> this.org_apache_royale_net_remoting_messages_AbstractMessage__timestamp;
> }
> set__timestamp: function(value) {
>   this.org_apache_royale_net_remoting_messages_AbstractMessage__timestamp = 
> value;
> }
> get__timeToLive: function() {
>   return 
> this.org_apache_royale_net_remoting_messages_AbstractMessage__timeToLive;
> }
> set__timeToLive: function(value) {
>   this.org_apache_royale_net_remoting_messages_AbstractMessage__timeToLive = 
> value;
> }
> 
> Any ideas?
> 
> 
> -- 
> Piotr Zarzycki 
> 
> 
> 
> -- 
> David Slotemaker de Bruïne
> Head of Educational Robotics
> 
> 
> Av. Sarriá, 130 - 08017 Barcelona 
> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>  
> T. +34 932 523 729 ext. 135
> dslotema...@vicensvives.com <mailto:dslotema...@vicensvives.com>
> 
> -- 
> David Slotemaker de Bruïne
> Head of Educational Robotics
> 
> 
> Av. Sarriá, 130 - 08017 Barcelona 
> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>  
> T. +34 932 523 729 ext. 135
> dslotema...@vicensvives.com <mailto:dslotema...@vicensvives.com>

Reply via email to