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

  • GWT whith Enums supported in 1.1.0M3?

    My small app uses some enums in entities:

    @Entity
    @RooJavaBean
    @RooToString
    @RooEntity
    public class Communication {

    @Enumerated
    private CommunicationType type;

    private String comm_data;
    }

    public enum CommunicationType {
    TEL, FAX, MAIL, HTTP
    }

    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 com.google.gwt.dev.shell.rewrite.RewriteSingleJsoI mplDispatches.getResourceName(RewriteSingleJsoImpl Dispatches.java:251) at com.google.gwt.dev.shell.rewrite.RewriteSingleJsoI mplDispatches.computeAllInterfaces(RewriteSingleJs oImplDispatches.java:230) at com.google.gwt.dev.shell.rewrite.RewriteSingleJsoI mplDispatches.access$100(RewriteSingleJsoImplDispa tches.java:58) at com.google.gwt.dev.shell.rewrite.RewriteSingleJsoI mplDispatches$MyMethodVisitor.visitMethodInsn(Rewr iteSingleJsoImplDispatches.java:88) at com.google.gwt.dev.asm.MethodAdapter.visitMethodIn sn(MethodAdapter.java:124) at com.google.gwt.dev.shell.rewrite.RewriteRefsToJsoC lasses$MyMethodAdapter.visitMethodInsn(RewriteRefs ToJsoClasses.java:97) at com.google.gwt.dev.asm.ClassReader.accept(ClassRea der.java:1371) at com.google.gwt.dev.asm.ClassReader.accept(ClassRea der.java:420) at com.google.gwt.dev.shell.rewrite.HostedModeClassRe writer.rewrite(HostedModeClassRewriter.java:251) at com.google.gwt.dev.shell.CompilingClassLoader.find ClassBytes(CompilingClassLoader.java:1158) at com.google.gwt.dev.shell.CompilingClassLoader.find Class(CompilingClassLoader.java:985) at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07) at java.lang.ClassLoader.loadClass(ClassLoader.java:2 48) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at com.google.gwt.dev.shell.ModuleSpace.loadClassFrom SourceName(ModuleSpace.java:645) at com.google.gwt.dev.shell.ModuleSpace.onLoad(Module Space.java:363) at com.google.gwt.dev.shell.OophmSessionHandler.loadM odule(OophmSessionHandler.java:183) at com.google.gwt.dev.shell.BrowserChannelServer.proc essConnection(BrowserChannelServer.java:510) at com.google.gwt.dev.shell.BrowserChannelServer.run( BrowserChannelServer.java:352) at java.lang.Thread.run(Thread.java:619)

    And an error line hints to the enum:
    00:00:16,672 [ERROR] Line 18: No source code is available for type de.ifm.officemanager.domain.CommunicationType; 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!
    Marcel

  • #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.

    Comment


    • #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 de.ifm.officemanager.domain.CommunicationType
      so the package is de.ifm.officemanager.domain

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

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

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

      Comment

      Working...
      X