You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by serrnovik <se...@gmail.com> on 2016/08/03 12:34:17 UTC

Failed to deserialize the job (.net) using code from examples

I'm trying to get familiar with Ignite and write small proof of concept.

To simplify I'm using only code from exmaples. I'm coding c# .NET
application. 
For visual studio I got Ignite from nuget. For standalone I downloaded
apache-ignite-fabric-1.6.0-bin and running instance from
\platforms\dotnet\bin 

I have code:

var compute = ignite1.GetCompute();
compute.Broadcast(new HelloAction());

and  action 

[Serializable]
public class HelloAction : IComputeAction
{
      public void Invoke()
            {
                Console.WriteLine("Hello World!");
            }
}

If I start several Ignite nodes from my code everything works great. 

However if there is at least one external node (in my case same machine, but
running from console) the execution fails with following errror:

{"Failed to deserialize the job [errType=SerializationException,
errMsg=Unable to find assembly MYASSEMBLYNAME, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null'.]"} 

So the questions is how to make remote nodes to compute my compute action. 





--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Failed-to-deserialize-the-job-net-using-code-from-examples-tp6708.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Failed to deserialize the job (.net) using code from examples

Posted by serrnovik <se...@gmail.com>.
Thank you for your response and pointing to direction to think. 

I solved the problem: 
The issue was that nuget did not properly update the project. Just running
update was not enough for some reason.
1. I've removed all Ignite nuget dependencies. 
2. Just to be save manually cleaned debug/release folders. 
3. Installed nuget packages again. 

After this all tests related to this issues passed. 



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Failed-to-deserialize-the-job-net-using-code-from-examples-tp6708p7147.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Failed to deserialize the job (.net) using code from examples

Posted by Pavel Tupitsyn <pt...@apache.org>.
I tried to reproduce your scenario:

* Create a new project in Visual Studio, add Apache.Ignite 1.7 NuGet
package, paste your code from the first message, build the project
* Download binary distribution 1.7 from ignite.apache.org, run
apache.ignite.exe -assembly=ConsoleApplication13.exe
* Run the project in Visual Studio

This works for me. Both nodes print "Hello, World!".

Please make sure:
1) You have 1.7 version everywhere.
2) Apache.Ignite.exe references the same assembly that NuGet nodes use.



On Wed, Aug 17, 2016 at 5:31 PM, serrnovik <se...@gmail.com> wrote:

> I'm back with the same issue. I've just changed to 1.7 version (both nuget
> and binary execution). Same test. As before if it is just nuget nodes that
> installed then everything is perfect. If I add at least one node from
> binary
> distribution - execution fails when I try to compute with not very
> descriptive null reference:
>
>
> /
> > System.NullReferenceException : Object reference not set to an instance
> of
> > an object.
> >    at Apache.Ignite.Core.Impl.Common.Future`1.Get()
> /
>
> Full error from the console attached bellow.
>
> Other than nuget vs project I run binary as following:
> C:\apache-ignite\apache-ignite-fabric-1.7.0-bin\
> platforms\dotnet\bin\Apache.Ignite.exe
> -assembly="MY ASSEMBLY PATH"
>
>
> /
> > [15:48:04,700][SEVERE][pub-#15%null%][GridJobWorker] Failed to execute
> job
> > [jobId=ba932c89651-5dd85491-0bce-4872-83c5-49d4943cc246,
> > ses=GridJobSessionImpl [ses=GridTaskSessionImpl
> > [taskName=o.a.i.i.processors.platform.compute.
> PlatformBalancingMultiClosureTask,
> > dep=LocalDeployment [super=GridDeployment [ts=1471441453448,
> > depMode=SHARED, clsLdr=sun.misc.Launcher$AppClassLoader@c387f44,
> > clsLdrId=3dabeb89651-469415f2-3eb4-4221-a5db-d5d3e6f39441, userVer=0,
> > loc=true, sampleClsName=java.lang.String, pendingUndeploy=false,
> > undeployed=false, usage=0]],
> > taskClsName=o.a.i.i.processors.platform.compute.
> PlatformBalancingMultiClosureTask,
> > sesId=aa932c89651-5dd85491-0bce-4872-83c5-49d4943cc246,
> > startTime=1471441684674, endTime=9223372036854775807,
> > taskNodeId=5dd85491-0bce-4872-83c5-49d4943cc246,
> > clsLdr=sun.misc.Launcher$AppClassLoader@c387f44, closed=false,
> cpSpi=null,
> > failSpi=null, loadSpi=null, usage=1, fullSup=false,
> > subjId=5dd85491-0bce-4872-83c5-49d4943cc246, mapFut=IgniteFuture
> > [orig=GridFutureAdapter [resFlag=0, res=null, startTime=1471441684699,
> > endTime=0, ignoreInterrupts=false, state=INIT]]],
> > jobId=ba932c89651-5dd85491-0bce-4872-83c5-49d4943cc246]]
> > class org.apache.ignite.IgniteException: Native platform exception
> > occurred.
> >         at
> > org.apache.ignite.internal.util.IgniteUtils.
> convertException(IgniteUtils.java:908)
> >         at
> > org.apache.ignite.internal.processors.platform.compute.
> PlatformAbstractJob.execute(PlatformAbstractJob.java:83)
> >         at
> > org.apache.ignite.internal.processors.job.GridJobWorker$
> 2.call(GridJobWorker.java:509)
> >         at
> > org.apache.ignite.internal.util.IgniteUtils.
> wrapThreadLoader(IgniteUtils.java:6521)
> >         at
> > org.apache.ignite.internal.processors.job.GridJobWorker.
> execute0(GridJobWorker.java:503)
> >         at
> > org.apache.ignite.internal.processors.job.GridJobWorker.
> body(GridJobWorker.java:456)
> >         at
> > org.apache.ignite.internal.util.worker.GridWorker.run(
> GridWorker.java:110)
> >         at
> > org.apache.ignite.internal.processors.job.GridJobProcessor.
> processJobExecuteRequest(GridJobProcessor.java:1161)
> >         at
> > org.apache.ignite.internal.processors.job.GridJobProcessor$
> JobExecutionListener.onMessage(GridJobProcessor.java:1766)
> >         at
> > org.apache.ignite.internal.managers.communication.
> GridIoManager.invokeListener(GridIoManager.java:1238)
> >         at
> > org.apache.ignite.internal.managers.communication.GridIoManager.
> processRegularMessage0(GridIoManager.java:866)
> >         at
> > org.apache.ignite.internal.managers.communication.
> GridIoManager.access$1700(GridIoManager.java:106)
> >         at
> > org.apache.ignite.internal.managers.communication.GridIoManager$5.run(
> GridIoManager.java:829)
> >         at
> > java.util.concurrent.ThreadPoolExecutor.runWorker(
> ThreadPoolExecutor.java:1142)
> >         at
> > java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:617)
> >         at java.lang.Thread.run(Thread.java:745)
> > Caused by: PlatformNativeException [cause=BinaryObject
> [idHash=1737396909,
> > hash=28379535, typeId=87]]
> >         at
> > org.apache.ignite.internal.processors.platform.PlatformContextImpl.
> createNativeException(PlatformContextImpl.java:652)
> >         at
> > org.apache.ignite.internal.processors.platform.utils.PlatformUtils.
> readInvocationResult(PlatformUtils.java:770)
> >         at
> > org.apache.ignite.internal.processors.platform.compute.
> PlatformClosureJob.execute0(PlatformClosureJob.java:74)
> >         at
> > org.apache.ignite.internal.processors.platform.compute.
> PlatformAbstractJob.execute(PlatformAbstractJob.java:80)
> >         ... 14 more
> /
>
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Failed-to-deserialize-the-job-net-using-
> code-from-examples-tp6708p7134.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Re: Failed to deserialize the job (.net) using code from examples

Posted by serrnovik <se...@gmail.com>.
I'm back with the same issue. I've just changed to 1.7 version (both nuget
and binary execution). Same test. As before if it is just nuget nodes that
installed then everything is perfect. If I add at least one node from binary
distribution - execution fails when I try to compute with not very
descriptive null reference: 


/
> System.NullReferenceException : Object reference not set to an instance of
> an object.
>    at Apache.Ignite.Core.Impl.Common.Future`1.Get()
/

Full error from the console attached bellow. 

Other than nuget vs project I run binary as following: 
C:\apache-ignite\apache-ignite-fabric-1.7.0-bin\platforms\dotnet\bin\Apache.Ignite.exe
-assembly="MY ASSEMBLY PATH"


/
> [15:48:04,700][SEVERE][pub-#15%null%][GridJobWorker] Failed to execute job
> [jobId=ba932c89651-5dd85491-0bce-4872-83c5-49d4943cc246,
> ses=GridJobSessionImpl [ses=GridTaskSessionImpl
> [taskName=o.a.i.i.processors.platform.compute.PlatformBalancingMultiClosureTask,
> dep=LocalDeployment [super=GridDeployment [ts=1471441453448,
> depMode=SHARED, clsLdr=sun.misc.Launcher$AppClassLoader@c387f44,
> clsLdrId=3dabeb89651-469415f2-3eb4-4221-a5db-d5d3e6f39441, userVer=0,
> loc=true, sampleClsName=java.lang.String, pendingUndeploy=false,
> undeployed=false, usage=0]],
> taskClsName=o.a.i.i.processors.platform.compute.PlatformBalancingMultiClosureTask,
> sesId=aa932c89651-5dd85491-0bce-4872-83c5-49d4943cc246,
> startTime=1471441684674, endTime=9223372036854775807,
> taskNodeId=5dd85491-0bce-4872-83c5-49d4943cc246,
> clsLdr=sun.misc.Launcher$AppClassLoader@c387f44, closed=false, cpSpi=null,
> failSpi=null, loadSpi=null, usage=1, fullSup=false,
> subjId=5dd85491-0bce-4872-83c5-49d4943cc246, mapFut=IgniteFuture
> [orig=GridFutureAdapter [resFlag=0, res=null, startTime=1471441684699,
> endTime=0, ignoreInterrupts=false, state=INIT]]],
> jobId=ba932c89651-5dd85491-0bce-4872-83c5-49d4943cc246]]
> class org.apache.ignite.IgniteException: Native platform exception
> occurred.
>         at
> org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils.java:908)
>         at
> org.apache.ignite.internal.processors.platform.compute.PlatformAbstractJob.execute(PlatformAbstractJob.java:83)
>         at
> org.apache.ignite.internal.processors.job.GridJobWorker$2.call(GridJobWorker.java:509)
>         at
> org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6521)
>         at
> org.apache.ignite.internal.processors.job.GridJobWorker.execute0(GridJobWorker.java:503)
>         at
> org.apache.ignite.internal.processors.job.GridJobWorker.body(GridJobWorker.java:456)
>         at
> org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
>         at
> org.apache.ignite.internal.processors.job.GridJobProcessor.processJobExecuteRequest(GridJobProcessor.java:1161)
>         at
> org.apache.ignite.internal.processors.job.GridJobProcessor$JobExecutionListener.onMessage(GridJobProcessor.java:1766)
>         at
> org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1238)
>         at
> org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:866)
>         at
> org.apache.ignite.internal.managers.communication.GridIoManager.access$1700(GridIoManager.java:106)
>         at
> org.apache.ignite.internal.managers.communication.GridIoManager$5.run(GridIoManager.java:829)
>         at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>         at java.lang.Thread.run(Thread.java:745)
> Caused by: PlatformNativeException [cause=BinaryObject [idHash=1737396909,
> hash=28379535, typeId=87]]
>         at
> org.apache.ignite.internal.processors.platform.PlatformContextImpl.createNativeException(PlatformContextImpl.java:652)
>         at
> org.apache.ignite.internal.processors.platform.utils.PlatformUtils.readInvocationResult(PlatformUtils.java:770)
>         at
> org.apache.ignite.internal.processors.platform.compute.PlatformClosureJob.execute0(PlatformClosureJob.java:74)
>         at
> org.apache.ignite.internal.processors.platform.compute.PlatformAbstractJob.execute(PlatformAbstractJob.java:80)
>         ... 14 more
/




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Failed-to-deserialize-the-job-net-using-code-from-examples-tp6708p7134.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Failed to deserialize the job (.net) using code from examples

Posted by serrnovik <se...@gmail.com>.
Thank you. Looking forward that functionality.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Failed-to-deserialize-the-job-net-using-code-from-examples-tp6708p6718.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Failed to deserialize the job (.net) using code from examples

Posted by Pavel Tupitsyn <pt...@apache.org>.
This is called peer deployment, which is present in Ignite on Java, but not
in Ignite.NET.
It is planned for the future release:
https://issues.apache.org/jira/browse/IGNITE-2492

On Wed, Aug 3, 2016 at 5:41 PM, serrnovik <se...@gmail.com> wrote:

> Thank you for this information. So I'll put this issue aside before the
> update.
>
> By the way are there ways to make computations without updating each
> machine
> with dlls?
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Failed-to-deserialize-the-job-net-using-code-from-examples-tp6708p6716.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Re: Failed to deserialize the job (.net) using code from examples

Posted by serrnovik <se...@gmail.com>.
Thank you for this information. So I'll put this issue aside before the
update.

By the way are there ways to make computations without updating each machine
with dlls? 



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Failed-to-deserialize-the-job-net-using-code-from-examples-tp6708p6716.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Failed to deserialize the job (.net) using code from examples

Posted by Pavel Tupitsyn <pt...@apache.org>.
> For visual studio I got Ignite from nuget. For standalone I downloaded apache-ignite-fabric-1.6.0-bin
and running instance from \platforms\dotnet\bin
This is a known issue with 1.6 that nodes started from NuGet and binary
release do not interconnect properly.
Please use either only NuGet nodes, or only binary release nodes.

This is fixed in 1.7, which should be released next week.

On Wed, Aug 3, 2016 at 4:50 PM, serrnovik <se...@gmail.com> wrote:

> Thank you for pointing out to -assembly parameter. I was looking for
> something like it but didn't notice.
>
> With this parameter set I've got:
> {"Failed to deserialize the job [errType=InvalidCastException,
> errMsg=Unable
> to cast object of type '[MYASSEMBLYNAME].HelloAction' to type
> 'Apache.Ignite.Core.Compute.IComputeAction'.]"}
>
> Are there other steps needed besides implementing IComputeAction C#
> interface?
>
>
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Failed-to-deserialize-the-job-net-using-code-from-examples-tp6708p6712.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Re: Failed to deserialize the job (.net) using code from examples

Posted by serrnovik <se...@gmail.com>.
Thank you for pointing out to -assembly parameter. I was looking for
something like it but didn't notice. 

With this parameter set I've got: 
{"Failed to deserialize the job [errType=InvalidCastException, errMsg=Unable
to cast object of type '[MYASSEMBLYNAME].HelloAction' to type
'Apache.Ignite.Core.Compute.IComputeAction'.]"}

Are there other steps needed besides implementing IComputeAction C#
interface?





--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Failed-to-deserialize-the-job-net-using-code-from-examples-tp6708p6712.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Failed to deserialize the job (.net) using code from examples

Posted by Pavel Tupitsyn <pt...@apache.org>.
Hi,

When using [Serializable] jobs, you have to have the assembly with the job
class loaded on all nodes.
As you can see, the node can't deserialize the job since it does not have
the class.

Use -assembly parameter with Apache.Ignite.exe to load the assembly with
your job class on standalone nodes.

Pavel.

On Wed, Aug 3, 2016 at 3:34 PM, serrnovik <se...@gmail.com> wrote:

> I'm trying to get familiar with Ignite and write small proof of concept.
>
> To simplify I'm using only code from exmaples. I'm coding c# .NET
> application.
> For visual studio I got Ignite from nuget. For standalone I downloaded
> apache-ignite-fabric-1.6.0-bin and running instance from
> \platforms\dotnet\bin
>
> I have code:
>
> var compute = ignite1.GetCompute();
> compute.Broadcast(new HelloAction());
>
> and  action
>
> [Serializable]
> public class HelloAction : IComputeAction
> {
>       public void Invoke()
>             {
>                 Console.WriteLine("Hello World!");
>             }
> }
>
> If I start several Ignite nodes from my code everything works great.
>
> However if there is at least one external node (in my case same machine,
> but
> running from console) the execution fails with following errror:
>
> {"Failed to deserialize the job [errType=SerializationException,
> errMsg=Unable to find assembly MYASSEMBLYNAME, Version=1.0.0.0,
> Culture=neutral, PublicKeyToken=null'.]"}
>
> So the questions is how to make remote nodes to compute my compute action.
>
>
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Failed-to-deserialize-the-job-net-using-code-from-examples-tp6708.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>