代码之家  ›  专栏  ›  技术社区  ›  aleha_84

Apache Ignite。此平台不支持NET序列化委托

  •  1
  • aleha_84  · 技术社区  · 8 年前

    被问及在ignite中回避工作的问题 here .

    通过简单的文本输出到控制台和通过HttpClient的简单异步web请求对其进行了测试。工作正常。

    用大量长时间运行的任务和并行计算实现了真正的业务逻辑。

    燃烧NET版本:2.3.0

    应用平台:dotnet core 2.0

    但在服务注册时收到例外 DeployClusterSingleton .

    系统运行时。序列化。序列化异常:“序列化” 此平台不支持代表。”

    来源:系统。私有的CoreLib公司

       at System.MulticastDelegate.GetObjectData(SerializationInfo info, StreamingContext context)
       at Apache.Ignite.Core.Impl.Binary.SerializableSerializer.WriteBinary[T](T obj, BinaryWriter writer)
       at Apache.Ignite.Core.Impl.Binary.BinaryWriter.Write[T](T obj)
       at Apache.Ignite.Core.Impl.Binary.BinaryReflectiveSerializerInternal.Apache.Ignite.Core.Impl.Binary.IBinarySerializerInternal.WriteBinary[T](T obj, BinaryWriter writer)
       at Apache.Ignite.Core.Impl.Binary.BinaryWriter.Write[T](T obj)
       at Apache.Ignite.Core.Impl.Binary.BinaryUtils.WriteArray(Array val, BinaryWriter ctx, Nullable`1 elemTypeId)
       at Apache.Ignite.Core.Impl.Binary.BinarySystemHandlers.WriteArray(BinaryWriter ctx, Object obj)
       at Apache.Ignite.Core.Impl.Binary.BinaryWriter.Write[T](T obj)
       at Apache.Ignite.Core.Impl.Binary.BinaryReflectiveSerializerInternal.Apache.Ignite.Core.Impl.Binary.IBinarySerializerInternal.WriteBinary[T](T obj, BinaryWriter writer)
       at Apache.Ignite.Core.Impl.Binary.BinaryWriter.Write[T](T obj)
       at Apache.Ignite.Core.Impl.Binary.BinaryReflectiveSerializerInternal.Apache.Ignite.Core.Impl.Binary.IBinarySerializerInternal.WriteBinary[T](T obj, BinaryWriter writer)
       at Apache.Ignite.Core.Impl.Binary.BinaryWriter.Write[T](T obj)
       at Apache.Ignite.Core.Impl.Binary.BinaryReflectiveSerializerInternal.Apache.Ignite.Core.Impl.Binary.IBinarySerializerInternal.WriteBinary[T](T obj, BinaryWriter writer)
       at Apache.Ignite.Core.Impl.Binary.BinaryWriter.Write[T](T obj)
       at Apache.Ignite.Core.Impl.Binary.BinaryReflectiveSerializerInternal.Apache.Ignite.Core.Impl.Binary.IBinarySerializerInternal.WriteBinary[T](T obj, BinaryWriter writer)
       at Apache.Ignite.Core.Impl.Binary.BinaryWriter.Write[T](T obj)
       at Apache.Ignite.Core.Impl.Services.Services.<>c__DisplayClass3.<DeployMultiple>b__2(BinaryWriter w)
       at Apache.Ignite.Core.Impl.PlatformTargetAdapter.WriteToStream(Action`1 action, IBinaryStream stream, Marshaller marsh)
       at Apache.Ignite.Core.Impl.PlatformJniTarget.InStreamOutStream[TR](Int32 type, Action`1 writeAction, Func`2 readAction)
       at Apache.Ignite.Core.Impl.Services.Services.DeployMultiple(String name, IService service, Int32 totalCount, Int32 maxPerNodeCount)
       at Apache.Ignite.Core.Impl.Services.Services.DeployClusterSingleton(String name, IService service)
    

    很难猜测是哪部分代码导致了这种情况。我所要做的就是用存根一部分一部分地替换代码。

    如果需要更多详细信息,我可以提供更多信息。

    调查后:

    它是 IOptions<> , ILogger<>

    下一个是: System.PlatformNotSupportedException: 'Operation is not supported on this platform.' System.Reflection.RuntimePropertyInfo.GetObjectData(SerializationInfo info, StreamingContext context)

    另一个是: Apache.Ignite.Core.Binary.BinaryObjectException: 'Conflicting field IDs [type=HttpClient, field1=_disposed, field2=_disposed, fieldId=375705476]'

    可悲的是,我不得不改变架构,因为这一点很多;

    1 回复  |  直到 8 年前
        1
  •  6
  •   Pavel Tupitsyn    8 年前

    此异常是由引起的。NET Core,其中 does not support delegate serialization . Ignite只是调用标准 GetObjectData 方法

    这在正常情况下可以工作。净4+。

    您的服务类是否包含任何代理?

    推荐文章