IModelFactory with error cast

28 views
Skip to first unread message

Oskillar21

unread,
Oct 15, 2025, 1:35:08 AM (8 days ago) Oct 15
to iDempiere

Hello everyone,

This time my question is related to the use of models.

I followed this guide step by step, which I found here on the forum:
https://wiki.idempiere.org/en/Developing_Plug-Ins_-_IModelFactory

I have my X_ models, and I also created some M_ classes that extend their corresponding X_ models.

However, I’m still having casting issues — specifically this error:
class org.adempiere.model.GenericPO cannot be cast to class org.tropicatech.payroll.models.M_PayrollEmployee (org.adempiere.model.GenericPO is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader 667f0e1b; org.tropicatech.payroll.models.M_PayrollEmployee is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader 2088dbaf)

It seems like my class that implements IModelFactory is simply being ignored, and I’m not sure why.
I’ve attached a screenshot with all the related files.Captura1.pngCaptura3.pngCaptura4.pngCaptura5.pngCaptura6.png

Nicolas Micoud

unread,
Oct 15, 2025, 1:40:20 AM (8 days ago) Oct 15
to iDempiere
Hi,

In my case, the Name (org.tropicatech.payroll) is the same as the Class (org.tropicatech.payroll.factories.PayrollrModelsFactory)
Try to set the Name =  org.tropicatech.payroll.factories.PayrollrModelsFactory
And where did you put the xml file? in the OSGI-INF directory?

Regards,

Nicolas

Oskillar21

unread,
Oct 15, 2025, 1:51:05 AM (8 days ago) Oct 15
to iDempiere

Thanks for the quick response!

I tried what you told me, and that was it! Thank you so much!

Reply all
Reply to author
Forward
0 new messages