Uploaded image for project: 'Errai'
  1. Errai
  2. ERRAI-332

Errai UI codegen failure when @Templated class is not a widget

    Details

    • Type: Feature Request
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 2.1.0.CR1
    • Fix Version/s: 2.1.0.Beta1
    • Component/s: ErraiUI
    • Labels:
      None

      Description

      It would be easier to figure out what's wrong if the code generator failed with an explicit message if a @Templated clas doesn't extend any of the required interfaces/base classes.

      Here's the class that caused the failure:

      @Templated("#whole-page")
      @EntryPoint
      public class GroceryListClient

      { ... }

      and here's the codegen stack trace:

      [ERROR] org.jboss.errai.codegen.exception.UndefinedMethodException: undefined method: initWidget(org.jboss.errai.demo.grocery.client.local.GroceryListClient, com.google.gwt.dom.client.Element, java.util.Collection); in class: org.jboss.errai.ui.shared.TemplateUtil
      [ERROR] at org.jboss.errai.codegen.builder.callstack.MethodCall.handleCall(MethodCall.java:82)
      [ERROR] at org.jboss.errai.codegen.builder.callstack.AbstractCallElement.nextOrReturn(AbstractCallElement.java:46)
      [ERROR] at org.jboss.errai.codegen.builder.callstack.LoadClassReference.handleCall(LoadClassReference.java:48)
      [ERROR] at org.jboss.errai.codegen.builder.impl.AbstractStatementBuilder.generate(AbstractStatementBuilder.java:63)
      [ERROR] at org.jboss.errai.codegen.BlockStatement.generate(BlockStatement.java:67)
      [ERROR] at org.jboss.errai.codegen.builder.impl.AnonymousClassStructureBuilderImpl$2$1.doGenerate(AnonymousClassStructureBuilderImpl.java:109)
      [ERROR] at org.jboss.errai.codegen.builder.impl.AnonymousClassStructureBuilderImpl.doGenerate(AnonymousClassStructureBuilderImpl.java:180)
      [ERROR] at org.jboss.errai.codegen.builder.impl.AnonymousClassStructureBuilderImpl.access$200(AnonymousClassStructureBuilderImpl.java:43)
      [ERROR] at org.jboss.errai.codegen.builder.impl.AnonymousClassStructureBuilderImpl$3.generate(AnonymousClassStructureBuilderImpl.java:148)
      [ERROR] at org.jboss.errai.codegen.builder.impl.ObjectBuilder$2.doDeferred(ObjectBuilder.java:174)
      [ERROR] at org.jboss.errai.codegen.builder.callstack.DeferredCallElement.handleCall(DeferredCallElement.java:39)
      [ERROR] at org.jboss.errai.codegen.builder.impl.AbstractStatementBuilder.generate(AbstractStatementBuilder.java:63)
      [ERROR] at org.jboss.errai.codegen.builder.impl.ObjectBuilder.generate(ObjectBuilder.java:182)
      [ERROR] at org.jboss.errai.codegen.util.GenUtil.generate(GenUtil.java:130)
      [ERROR] at org.jboss.errai.codegen.util.GenUtil.generateCallParameters(GenUtil.java:76)
      [ERROR] at org.jboss.errai.codegen.builder.callstack.MethodCall.handleCall(MethodCall.java:60)
      [ERROR] at org.jboss.errai.codegen.builder.callstack.AbstractCallElement.nextOrReturn(AbstractCallElement.java:46)
      [ERROR] at org.jboss.errai.codegen.builder.callstack.LoadVariable.handleCall(LoadVariable.java:122)
      [ERROR] at org.jboss.errai.codegen.builder.impl.AbstractStatementBuilder.generate(AbstractStatementBuilder.java:63)
      [ERROR] at org.jboss.errai.codegen.BlockStatement.generate(BlockStatement.java:67)
      [ERROR] at org.jboss.errai.codegen.builder.impl.AnonymousClassStructureBuilderImpl$2$1.doGenerate(AnonymousClassStructureBuilderImpl.java:109)
      [ERROR] at org.jboss.errai.codegen.builder.impl.AnonymousClassStructureBuilderImpl.doGenerate(AnonymousClassStructureBuilderImpl.java:180)
      [ERROR] at org.jboss.errai.codegen.builder.impl.AnonymousClassStructureBuilderImpl.access$200(AnonymousClassStructureBuilderImpl.java:43)
      [ERROR] at org.jboss.errai.codegen.builder.impl.AnonymousClassStructureBuilderImpl$3.generate(AnonymousClassStructureBuilderImpl.java:148)
      [ERROR] at org.jboss.errai.codegen.builder.impl.ObjectBuilder$2.doDeferred(ObjectBuilder.java:174)
      [ERROR] at org.jboss.errai.codegen.builder.callstack.DeferredCallElement.handleCall(DeferredCallElement.java:39)
      [ERROR] at org.jboss.errai.codegen.builder.impl.AbstractStatementBuilder.generate(AbstractStatementBuilder.java:63)
      [ERROR] at org.jboss.errai.codegen.builder.impl.ObjectBuilder.generate(ObjectBuilder.java:182)
      [ERROR] at org.jboss.errai.codegen.util.GenUtil.convert(GenUtil.java:177)
      [ERROR] at org.jboss.errai.codegen.Variable.generate(Variable.java:225)
      [ERROR] at org.jboss.errai.codegen.builder.callstack.DeclareVariable.handleCall(DeclareVariable.java:37)
      [ERROR] at org.jboss.errai.codegen.builder.impl.AbstractStatementBuilder.generate(AbstractStatementBuilder.java:63)
      [ERROR] at org.jboss.errai.codegen.BlockStatement.generate(BlockStatement.java:67)
      [ERROR] at org.jboss.errai.codegen.meta.impl.build.BuildMetaMethod.toJavaString(BuildMetaMethod.java:340)
      [ERROR] at org.jboss.errai.codegen.meta.impl.build.BuildMetaClass.membersToString(BuildMetaClass.java:664)
      [ERROR] at org.jboss.errai.codegen.meta.impl.build.BuildMetaClass.toJavaString(BuildMetaClass.java:599)
      [ERROR] at org.jboss.errai.codegen.builder.impl.ClassBuilder.toJavaString(ClassBuilder.java:495)
      [ERROR] at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCBootstrapGenerator.generateExtensions(IOCBootstrapGenerator.java:274)
      [ERROR] at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCBootstrapGenerator._generate(IOCBootstrapGenerator.java:225)
      [ERROR] at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCBootstrapGenerator.generate(IOCBootstrapGenerator.java:136)
      [ERROR] at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator.generateIOCBootstrapClass(IOCGenerator.java:94)
      [ERROR] at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator.generate(IOCGenerator.java:63)
      [ERROR] at com.google.gwt.core.ext.GeneratorExtWrapper.generate(GeneratorExtWrapper.java:48)
      [ERROR] at com.google.gwt.core.ext.GeneratorExtWrapper.generateIncrementally(GeneratorExtWrapper.java:60)
      [ERROR] at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:647)
      [ERROR] at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
      [ERROR] at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:78)
      [ERROR] at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:268)
      [ERROR] at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:141)
      [ERROR] at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:585)
      [ERROR] at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:455)
      [ERROR] at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
      [ERROR] at com.google.gwt.core.client.GWT.create(GWT.java:97)
      [ERROR] at org.jboss.errai.ioc.client.Container.bootstrapContainer(Container.java:44)
      [ERROR] at org.jboss.errai.ioc.client.Container.onModuleLoad(Container.java:34)
      [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [ERROR] at java.lang.reflect.Method.invoke(Method.java:597)
      [ERROR] at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)
      [ERROR] at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
      [ERROR] at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:525)
      [ERROR] at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
      [ERROR] at java.lang.Thread.run(Thread.java:680)
      [ERROR] Caused by: java.lang.RuntimeException: Problem was caused by this call
      [ERROR] at org.jboss.errai.codegen.builder.callstack.AbstractCallElement.<init>(AbstractCallElement.java:33)
      [ERROR] at org.jboss.errai.codegen.builder.callstack.MethodCall.<init>(MethodCall.java:51)
      [ERROR] at org.jboss.errai.codegen.builder.impl.StatementBuilder.invokeStatic(StatementBuilder.java:222)
      [ERROR] at org.jboss.errai.codegen.builder.impl.StatementBuilder.invokeStatic(StatementBuilder.java:228)
      [ERROR] at org.jboss.errai.codegen.util.Stmt.invokeStatic(Stmt.java:172)
      [ERROR] Caused by: java.lang.RuntimeException: External call to API
      [ERROR] at org.jboss.errai.ui.shared.DecoratorTemplated.generateComponentCompositions(DecoratorTemplated.java:252)
      [ERROR] at org.jboss.errai.ui.shared.DecoratorTemplated.generateTemplatedInitialization(DecoratorTemplated.java:152)
      [ERROR] at org.jboss.errai.ui.shared.DecoratorTemplated.generateDecorator(DecoratorTemplated.java:90)
      [ERROR] at org.jboss.errai.ioc.rebind.ioc.injector.api.DecoratorTask.doTask(DecoratorTask.java:88)
      [ERROR] at org.jboss.errai.ioc.rebind.ioc.injector.InjectUtil.handleInjectionTasks(InjectUtil.java:165)
      [ERROR] at org.jboss.errai.ioc.rebind.ioc.injector.InjectUtil.access$000(InjectUtil.java:70)
      [ERROR] at org.jboss.errai.ioc.rebind.ioc.injector.InjectUtil$2.generateConstructor(InjectUtil.java:153)
      [ERROR] at org.jboss.errai.ioc.rebind.ioc.injector.TypeInjector._getType(TypeInjector.java:153)
      [ERROR] at org.jboss.errai.ioc.rebind.ioc.injector.TypeInjector.getBeanInstance(TypeInjector.java:93)
      [ERROR] at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCProcessorFactory$3.handle(IOCProcessorFactory.java:320)
      [ERROR] at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCProcessorFactory$5.process(IOCProcessorFactory.java:467)
      [ERROR] at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCProcessorFactory.process(IOCProcessorFactory.java:426)
      [ERROR] at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCBootstrapGenerator.generateExtensions(IOCBootstrapGenerator.java:251)
      [ERROR] at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCBootstrapGenerator._generate(IOCBootstrapGenerator.java:225)
      [ERROR] at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCBootstrapGenerator.generate(IOCBootstrapGenerator.java:136)
      [ERROR] at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator.generateIOCBootstrapClass(IOCGenerator.java:94)
      [ERROR] at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator.generate(IOCGenerator.java:63)
      [ERROR] at com.google.gwt.core.ext.GeneratorExtWrapper.generate(GeneratorExtWrapper.java:48)
      [ERROR] at com.google.gwt.core.ext.GeneratorExtWrapper.generateIncrementally(GeneratorExtWrapper.java:60)
      [ERROR] at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:647)
      [ERROR] at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
      [ERROR] at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:78)
      [ERROR] at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:268)
      [ERROR] at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:141)
      [ERROR] at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:585)
      [ERROR] at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:455)
      [ERROR] at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
      [ERROR] at com.google.gwt.core.client.GWT.create(GWT.java:97)
      [ERROR] at org.jboss.errai.ioc.client.Container.bootstrapContainer(Container.java:44)
      [ERROR] at org.jboss.errai.ioc.client.Container.onModuleLoad(Container.java:34)
      [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [ERROR] at java.lang.reflect.Method.invoke(Method.java:597)
      [ERROR] at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)
      [ERROR] at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
      [ERROR] at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:525)
      [ERROR] at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
      [ERROR] at java.lang.Thread.run(Thread.java:680)
      [ERROR] java.lang.RuntimeException: Deferred binding failed for 'org.jboss.errai.ioc.client.Bootstrapper' (did you forget to inherit a required module?)
      [ERROR] at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53)
      [ERROR] at com.google.gwt.core.client.GWT.create(GWT.java:97)
      [ERROR] at org.jboss.errai.ioc.client.Container.bootstrapContainer(Container.java:44)
      [ERROR] at org.jboss.errai.ioc.client.Container.onModuleLoad(Container.java:34)
      [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [ERROR] at java.lang.reflect.Method.invoke(Method.java:597)
      [ERROR] at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)
      [ERROR] at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
      [ERROR] at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:525)
      [ERROR] at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
      [ERROR] at java.lang.Thread.run(Thread.java:680)
      [ERROR] Caused by: com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
      [ERROR] at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:503)
      [ERROR] at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
      [ERROR] ... 12 more

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                lincolnthree Lincoln Baxter III
                Reporter:
                jfuerth Jonathan Fuerth
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: