shannah / RADChatApp

Full-featured chat app UI component in Java/Kotlin for Codename One.
15 stars 11 forks source link

.IllegalArgumentException: Entity type ChatMessageModel does not contain property DateProperty #16

Open jsfan3 opened 4 years ago

jsfan3 commented 4 years ago

Executing your RADChatRoom code downloaded from Github, I get an exception trying to enter the text "Hello World"...

Please note in the screenshot below the text "MultiButton", appeared after entering "Hello World".

Full log:

ant -f /home/francesco/Teamify/ChatRAD -Dnb.internal.action.name=run run
Generating GUI sources
No GUI Entries available
init:
Deleting: /home/francesco/Teamify/ChatRAD/build/built-jar.properties
deps-jar:
Updating property file: /home/francesco/Teamify/ChatRAD/build/built-jar.properties
JavaFX is loaded
Retina Scale: 1.0
Updating merge file /home/francesco/Teamify/ChatRAD/css/theme.css.merged
Input: /home/francesco/Teamify/ChatRAD/css/theme.css
Output: /home/francesco/Teamify/ChatRAD/src/theme.res
Acquiring lock on CSS checksums file /home/francesco/Teamify/ChatRAD/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled.  /home/francesco/Teamify/ChatRAD/src/theme.res
Compile is forcing compliance to the supported API's/features for maximum device compatibility. This allows smaller
        code size and wider device support
compile:
run:
JavaFX is loaded
Found theme.css file.  Watching for changes...
CSS> JavaFX is loaded
CSS> Retina Scale: 1.0
CSS> Updating merge file /home/francesco/Teamify/ChatRAD/css/theme.css.merged
CSS> Input: /home/francesco/Teamify/ChatRAD/css/theme.css
CSS> Output: /home/francesco/Teamify/ChatRAD/src/theme.res
CSS> Acquiring lock on CSS checksums file /home/francesco/Teamify/ChatRAD/.cn1_css_checksums...
CSS> Lock obtained
CSS> File has not changed since last compile.
CSS> Releasing lock
CSS> CSS file successfully compiled.  /home/francesco/Teamify/ChatRAD/src/theme.res
Retina Scale: 1.0
[EDT] 0:0:9,507 - Codename One revisions: 7dd4e7d08b3442d90959477ee52a5ae8c4361b29

java.lang.IllegalArgumentException: Entity type net.informaticalibera.test.chatrad.ChatMessageModel$1@6e07c9d1 does not contain property com.codename1.rad.models.DateProperty@54a32e09
[EDT] 0:0:9,508 - Exception: java.lang.IllegalArgumentException - Entity type net.informaticalibera.test.chatrad.ChatMessageModel$1@6e07c9d1 does not contain property com.codename1.rad.models.DateProperty@54a32e09
    at com.codename1.rad.models.Entity.get(Entity.java:440)
    at com.codename1.rad.ui.chatroom.ChatBubbleView$ChatBubbleListCellRenderer.getListCellRendererComponent(ChatBubbleView.java:591)
    at com.codename1.rad.ui.entityviews.EntityListView.lambda$new$1(EntityListView.java:78)
    at com.codename1.ui.util.EventDispatcher.fireActionEvent(EventDispatcher.java:349)
    at com.codename1.rad.models.EntityList.fireEntityAdded(EntityList.java:151)
    at com.codename1.rad.models.EntityList.add(EntityList.java:106)
    at com.codename1.rad.ui.chatroom.ChatRoomView$ViewModel.addMessages(ChatRoomView.java:462)
    at net.informaticalibera.test.chatrad.ChatFormController.lambda$new$4(ChatFormController.java:114)
    at com.codename1.rad.controllers.Controller.lambda$addActionListener$0(Controller.java:131)
    at com.codename1.ui.util.EventDispatcher.fireActionSync(EventDispatcher.java:459)
    at com.codename1.ui.util.EventDispatcher.fireActionEvent(EventDispatcher.java:362)
    at com.codename1.rad.controllers.Controller.dispatchEvent(Controller.java:154)
    at com.codename1.rad.controllers.ActionSupport.dispatchEvent(ActionSupport.java:79)
    at com.codename1.rad.nodes.ActionNode.fireEvent(ActionNode.java:438)
    at com.codename1.rad.nodes.ActionNode.fireEvent(ActionNode.java:411)
    at com.codename1.rad.ui.DefaultActionViewFactory.lambda$initUI$0(DefaultActionViewFactory.java:216)
    at com.codename1.ui.util.EventDispatcher.fireActionEvent(EventDispatcher.java:349)
    at com.codename1.ui.Button.fireActionEvent(Button.java:679)
    at com.codename1.ui.Button.released(Button.java:720)
    at com.codename1.ui.Button.pointerReleased(Button.java:827)
    at com.codename1.ui.LeadUtil.pointerReleased(LeadUtil.java:153)
    at com.codename1.ui.Form.pointerReleased(Form.java:3677)
    at com.codename1.ui.Component.pointerReleased(Component.java:4729)
    at com.codename1.ui.Display.handleEvent(Display.java:2324)
    at com.codename1.ui.Display.edtLoopImpl(Display.java:1216)
    at com.codename1.ui.Display.mainEDTLoop(Display.java:1134)
    at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
    at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Found theme.css file.  Watching for changes...
BUILD SUCCESSFUL (total time: 50 seconds)

Screenshot: error

shannah commented 4 years ago

There may be a problem with your models. Every entity in the messages list is assumed to be the same entity type. Can you post the source of the relevant entities and entity types?