Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting class cast exception #64

Open
vaithu opened this issue Apr 4, 2021 · 0 comments
Open

Getting class cast exception #64

vaithu opened this issue Apr 4, 2021 · 0 comments

Comments

@vaithu
Copy link

vaithu commented Apr 4, 2021

I'm getting this error

Exception in thread "main" java.lang.ClassCastException: class com.google.gson.internal.LinkedTreeMap cannot be cast to class com.holonplatform.core.property.PropertyBox (com.google.gson.internal.LinkedTreeMap and com.holonplatform.core.property.PropertyBox are in unnamed module of loader 'app')

and my code is

ListPathProperty<PropertyBox> DASAENTRIES = ListPathProperty.propertyBox("dasaEntries",DasaEntries.PROPERTIES);
    PropertySet<?> PROPERTIES = PropertySet.builderOf(DASAENTRIES)
            .build();
    PathProperty<PropertyBox> VIMSHOTTARIDASA = PathProperty.create("vimshottariDasa", PropertyBox.class)
            .withConfiguration(PropertySet.PROPERTY_CONFIGURATION_ATTRIBUTE,PROPERTIES)

            ;


List<PropertyBox> dasaEntriesBox = propertyBox.getValue(VimshottariDasa.DASAENTRIES);

            for (PropertyBox pb : dasaEntriesBox) {
                System.out.println(pb);
            }

The error gets popup when I use this line

for (PropertyBox pb : dasaEntriesBox) {
                System.out.println(pb);
            }

Please help me to resolve this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant