cancel
Showing results for 
Search instead for 
Did you mean: 

java.lang.IllegalArgumentException: invalid pks [10] - unknown typecode 0

Former Member
0 Kudos

Hi Experts, I'm trying to fire Flexible Search Query from DAO layer my query is something like "SELECT {loyaltypoints},{redeemedloyaltypoints} FROM {LoyaltyUser} WHERE {uid} =?uid" it is throwing me like unknown type code but my type code is proper. I see the stack-trace message like "SEVERE: Servlet.service() for servlet [DispatcherServlet] in context with path [/store] threw excepti on [Request processing failed; nested exception is java.lang.IllegalArgumentException: invalid pks [1 0] - unknown typecode 0] with root cause java.lang.IllegalArgumentException: invalid pks [10] - unknown typecode 0 at de.hybris.platform.core.WrapperFactory.getCachedItems(WrapperFactory.java:304) at de.hybris.platform.core.LazyLoadItemList.loadPage(LazyLoadItemList.java:230) at de.hybris.platform.servicelayer.search.impl.LazyLoadModelList.loadPage(LazyLoadModelList.java)"

my items.xml looks like &ltitemtype code="LoyaltyUser" extends="Customer" autocreate="true" generate="true" jaloclass="de.hybris.merchandise.core.jalo.LoyaltyUser"> &ltdeployment table="LoyaltyUsers" typecode="10010"/> &ltattributes> &ltattribute generate="true" autocreate="true" qualifier="loyaltypoints" type="java.lang.Integer" > &ltdescription&gtLoyalty points given for each purchase</description> &ltmodifiers read="true" write="true" search="true" optional="true" /> &ltdefaultvalue&gtInteger.valueOf(0)</defaultvalue> </attribute> &ltattribute generate="true" autocreate="true" qualifier="redeemedloyaltypoints" type="java.lang.Integer" > &ltdescription&gtRedeemed Loyalty points For a customer</description> &ltmodifiers read="true" write="true" search="true" optional="true" /> &ltdefaultvalue&gtInteger.valueOf(0)</defaultvalue> &ltpersistence type="property"/> </attribute>
</attributes> </itemtype>

Could anyone help me out from this issue.

Thank You, .

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi, This is giving an exception while calling result.getResult().get(0); method.

Thank You, Manohar.

Former Member
0 Kudos

Try this, change your query to "SELECT {pk} FROM {LoyaltyUser} WHERE {uid} =?uid" the flexi result will be only model with PK as it uses lazy fetch you can invoke getter methods post that. let me know.

Former Member
0 Kudos

Thank you, adbul it worked for me.

Former Member
0 Kudos

you are wc. you should close this thread probably.

Answers (1)

Answers (1)

Former Member
0 Kudos

does your query work fine in hac? can you see the type in hmc? you can also see the data for the type in hmc. BTW you created a deployment for the type extending Customer which means it creates a new table with Customer type attributes. New customer registrations will not be saved to your new table.

Former Member
0 Kudos

Hi Abdul, Thank You for your reply. Query is working fine from the hac, I tried checking the Type from the hmc It was available, I also verified data which was persisted for my Type it was saved successfully I'm able to see the data from hmc. Yeah it will create a new table which will be used for my customized functionality. did you experienced this issue anytime in your past experience?

Thank You, Manohar.