Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

LCDS application error on updateItem

Avatar

Level 2
Hi all,



i'm having a problem with the LCDS.

My application is almost copied from the sample application
sample8 -> data management service. I can fetch the data to the
datagrid from my MySQL server, but the update doesn't work at all.
The returning object from the client is not Product, but for some
reason flex.messaging.io.amf.ASObject




here the debug from my app:

Object type: flex.messaging.io.amf.ASObject

field1: private boolean
flex.messaging.io.amf.ASObject.inHashCode

field2: private boolean
flex.messaging.io.amf.ASObject.inToString

field3: java.lang.String
flex.messaging.io.amf.ASObject.namedType




the same debug for the Sample8 app:

Object type: flex.samples.product.Product

field1: private java.lang.String
flex.samples.product.Product.name

field2: private java.lang.String
flex.samples.product.Product.description

field3: private java.lang.String
flex.samples.product.Product.image

field4: private java.lang.String
flex.samples.product.Product.category

field5: private double flex.samples.product.Product.price

field6: private int flex.samples.product.Product.qtyInStock



therefore i receive a classcastexception for the line in the
ProductAssembler.java - function updateItem:


boolean success = service.update((Product) newVersion);



what i think is ok, because the newVersion is not Product but
ASObject.



But why the newVersion is ASObject and why not Product as in
the sample app?



thx
1 Accepted Solution

Avatar

Correct answer by
Level 2
I've solved the problem...after days of coding...

First of all, i forgot to add to my MXML file the <Product
/> tag, to reference the Product.as, therefore the client
returned the ASObject instead of Product.

After this I received a stack overflow error. The problem was
that I had the same name for Product.as, and Product.mxml.

Renamed the mxml, and now the update works fine.



Happy coding!

View solution in original post

1 Reply

Avatar

Correct answer by
Level 2
I've solved the problem...after days of coding...

First of all, i forgot to add to my MXML file the <Product
/> tag, to reference the Product.as, therefore the client
returned the ASObject instead of Product.

After this I received a stack overflow error. The problem was
that I had the same name for Product.as, and Product.mxml.

Renamed the mxml, and now the update works fine.



Happy coding!