Skip to content

GWT reflection common issues and solutions

Daan van Yperen edited this page Sep 29, 2015 · 1 revision

Q: Why do I get reflection errors when using @Wire with GWT?

A: GWT does not support reflection out of the box. Artemis works around this by using a reflection cache. Extend the cache by adding component and system packages to your mygame.gwt.xml

<extend-configuration-property name="artemis.reflect.include" value="org.mygame.component" />
<extend-configuration-property name="artemis.reflect.include" value="org.mygame.system" />

Q: I added my classes to the reflection cache, and GWT still errors out! What gives?

A: Artemis does not share the reflection cache with LibGDX, which has its own implementation. You can identify Artemis originating errors via the prefix 'artemis-odb'. Extend the LibGDX cache by adding component and system packages to your mygame.gwt.xml

<extend-configuration-property name="gdx.reflect.include" value="org.mygame.mypackage" />

Q: I added my classes to gdx.reflect.include, why are they still missing from reflection cache?

This can happen when GWT is missing source files, causing all dependents of those source files to become invisible to the reflection cache generator. With LibGDX gradle projects running gradlew html:dist will reveal the missing source files.

Clone this wiki locally