According to the exception, the field name OrderId is of "long" type in Java and of "double" type in Node.JS (or vice versa). The types of the fields have to be identical. It seems like OrderId is a primitive field and you, probably, should enforce its type to "long" on Node.JS end.
Also, check this example that shows how to enforce specific field types from Node.JS to ensure they match the types of Java counterparts: https://github.com/apache/ignite/blob/master/modules/platforms/nodejs/examples/CachePutGetExample.js#L73 If nothing works, please share a GitHub project with Java POJOs and anything else that will help to get to the bottom of this. - Denis On Thu, Feb 13, 2020 at 1:49 AM nithin91 < [email protected]> wrote: > Hi > > Pasted below the code and error i got.Actually i am trying query an > existing > cache using node js which is loaded using Cache JDBC Pojo Store in Java.It > would be really helpful share me if you have any sample code. > > PS C:\Users\ngovind\NodeApp> node NodeIgnite.js > ERROR: Binary type has different field types [typeName=OrderId, > fieldName=OrderID, fieldTypeName1=long, fieldTypeName2=double] > (node:13596) UnhandledPromiseRejectionWarning: ReferenceError: igniteClient > is not defined > at start (C:\Users\ngovind\NodeApp\NodeIgnite.js:44:5) > at processTicksAndRejections (internal/process/task_queues.js:93:5) > (node:13596) UnhandledPromiseRejectionWarning: Unhandled promise rejection. > This error originated either by throwing inside of an async function > without > a catch block, or by rejecting a promise which was not handled with > .catch(). (rejection id: 1) > (node:13596) [DEP0018] DeprecationWarning: Unhandled promise rejections are > deprecated. In the future, promise rejections > that are not handled will terminate the Node.js process with a non-zero > exit > code. > > > > > const IgniteClient = require('apache-ignite-client'); > const IgniteClientConfiguration = IgniteClient.IgniteClientConfiguration; > const ObjectType = IgniteClient.ObjectType; > const CacheEntry = IgniteClient.CacheEntry; > const ComplexObjectType = IgniteClient.ComplexObjectType; > > class OrderKey { > constructor(OrderID = null, CityID= null) { > this.OrderID = OrderID; > this.CityID = CityID; > } > } > > class OrderDetails { > constructor(Productname = null, CustomerName= null,StoreName=null) { > this.Productname = Productname; > this.CustomerName = CustomerName; > this.StoreName = StoreName; > } > } > > async function start(){ > try { > const igniteClient = new IgniteClient(); > await igniteClient.connect(new > IgniteClientConfiguration('127.0.0.1:10800')); > const cache = await igniteClient.getCache('OrdersCache'); > const OrderKeyComplexObjectType = > new ComplexObjectType(new OrderKey(0,0),'OrderId'); > const OrderComplexObjectType = new ComplexObjectType(new > OrderDetails('','',''),'Orders') > ; > > cache.setKeyType(OrderKeyComplexObjectType). > setValueType(OrderComplexObjectType); > > const data = await cache.get(new OrderKey(1,1)); > console.log(data.Productname); > > } > catch (err) { > console.log('ERROR: ' + err.message); > } > finally { > > igniteClient.disconnect(); > > console.log(" Data Fetch Completed"); > > } > } > > start(); > > > > -- > Sent from: http://apache-ignite-users.70518.x6.nabble.com/ >
