Announcement Announcement Module
No announcement yet.
GWT whith Enums supported in 1.1.0M3? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • GWT whith Enums supported in 1.1.0M3?

    My small app uses some enums in entities:

    public class Communication {

    private CommunicationType type;

    private String comm_data;

    public enum CommunicationType {

    Running the app with mvn gwt:run starts the GWT developer mode and accessing the app results in the following strange exception:

    java.lang.NullPointerException: null at mplDispatches.getResourceName(RewriteSingleJsoImpl at mplDispatches.computeAllInterfaces(RewriteSingleJs at mplDispatches.access$100(RewriteSingleJsoImplDispa at mplDispatches$MyMethodVisitor.visitMethodInsn(Rewr at sn( at lasses$MyMethodAdapter.visitMethodInsn(RewriteRefs at at at writer.rewrite( at ClassBytes( at Class( at java.lang.ClassLoader.loadClass( 07) at java.lang.ClassLoader.loadClass( 48) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName( at SourceName( at at odule( at essConnection( at at

    And an error line hints to the enum:
    00:00:16,672 [ERROR] Line 18: No source code is available for type; did you forget to inherit a required module?

    Removing the enum from the Entity all is fine.

    The app uses roo 1.1.0M3 and GWT for the GUI

    Thanks for any hints!

  • #2
    This problem exists in 1.1.0 RC1, as well. I think the problem is that entity proxies on the (GWT) client-side are not being generated. I posted a question about this earlier, but haven't yet gotten any responses. I'm going to try and take a stab at figuring out how to manually define the client-side entity proxy for enum types (I think I have an idea on how to do this) -- I'll post if I'm successful.


    • #3
      I think they added support for enums in 1.1.0.M3 already, so what you need to do as a workaround is the following:

      Your enum is
      so the package is

      You'll notice that ApplicationScaffold.xml reside in and if you have a look inside ApplicationScaffold.xml you'll notice the following two source imports:

        <source path='client'/>
        <source path='shared'/>
      You need to tell GWT about your own code, so add:

      <source path='domain'/>
      I got my code to compile this way.