3 Replies Latest reply on Apr 14, 2011 6:55 AM by aannoo

    Errai-Cdi Examples

    aannoo Newbie

      Hello,

       

      I tried to run the Errai-Cdi Examples by doing the following:

       

      • git clone git://github.com/errai/errai-cdi.git
      • cd examples/gui
      • mvn gwt:run

       

      The GWT console pops up - I click on the 'Launch Default Browser' button. The browser opens

      'http://127.0.0.1:8888/App.html?gwt.codesvr=127.0.0.1:9997', but the content is:

       

      HTTP ERROR: 503

      Problem accessing /App.html. Reason:

          SERVICE_UNAVAILABLE

      Powered by Jetty://

       

      Am I doing something silly here? I only could see the following in the GWT console Jetty tab:

       

      00:00:01,288 [WARN] Failed startup of context org.jboss.errai.cdi.server.gwt.JettyLauncher$WebAppContextWithReload@46b113c7{/,/home/tpasch/compile/errai-cdi/examples/gui/war}

      org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions: Exception 0 :

      com.google.common.collect.ComputationException: java.lang.ClassCastException:

      org.jboss.weld.proxies.org$jboss$weld$bean-flat-Built-in-javax$enterprise$context$Conversation_$$_WeldClientProxy cannot be cast to javassist.util.proxy.ProxyObject

           at com.google.common.collect.MapMaker$StrategyImpl.compute(MapMaker.java:602)

           at com.google.common.collect.MapMaker$StrategyImpl.compute(MapMaker.java:462)

           at com.google.common.collect.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2045)

           at org.jboss.weld.bean.proxy.ClientProxyProvider.getClientProxy(ClientProxyProvider.java:113)

           at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:681)

           at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:728)

           at org.jboss.errai.cdi.server.Util.lookupCallbackBean(Util.java:51)

           at org.jboss.errai.cdi.server.CDIExtensionPoints.afterBeanDiscovery(CDIExtensionPoints.java:235)

           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

           at java.lang.reflect.Method.invoke(Method.java:597)

           at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)

           at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)

           at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)

           at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)

           at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)

           at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)

           at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)

           at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:270)

           at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)

           at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:222)

           at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:88)

           at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:52)

           at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:43)

           at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:366)

           at org.jboss.errai.container.DevModeCDIBootstrap.contextInitialized(DevModeCDIBootstrap.java:218)

           at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)

           at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)

           at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1272)

           at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)

           at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:489)

           at org.jboss.errai.cdi.server.gwt.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:434)

           at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

           at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

           at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115)

           at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

           at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

           at org.mortbay.jetty.Server.doStart(Server.java:224)     at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

           at org.jboss.errai.cdi.server.gwt.JettyLauncher.start(JettyLauncher.java:511)

           at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:421)

           at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1035)

           at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:783)

           at com.google.gwt.dev.DevMode.main(DevMode.java:275)

       

      Caused by: java.lang.ClassCastException:

      org.jboss.weld.proxies.org$jboss$weld$bean-flat-Built-in-javax$enterprise$context$Conversation_$$_WeldClientProxy cannot be cast to javassist.util.proxy.ProxyObject

           at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:250)

           at org.jboss.weld.bean.proxy.ClientProxyProvider.createClientProxy(ClientProxyProvider.java:97)

           at org.jboss.weld.bean.proxy.ClientProxyProvider.access$000(ClientProxyProvider.java:47)

           at org.jboss.weld.bean.proxy.ClientProxyProvider$1.apply(ClientProxyProvider.java:61)

           at org.jboss.weld.bean.proxy.ClientProxyProvider$1.apply(ClientProxyProvider.java:52)

           at com.google.common.collect.MapMaker$StrategyImpl.compute(MapMaker.java:592)

           ... 44 more

       

      In the examples/model and examples/server directory, mvn fails with:

       

      [ERROR] BUILD ERROR

      [INFO] ------------------------------------------------------------------------

      [INFO] One or more required plugin parameters are invalid/missing for 'gwt:run'

       

      [0] Inside the definition for plugin 'gwt-maven-plugin' specify the following:

       

      <configuration>

        ...

        <runTarget>VALUE</runTarget>

      </configuration>

       

      -OR-

       

      on the command line, specify: '-DrunTarget=VALUE'

       

      [INFO] ------------------------------------------------------------------------

      [INFO] For more information, run Maven with the -e switch

      [INFO] ------------------------------------------------------------------------

      [INFO] Total time: 3 seconds

      [INFO] Finished at: Wed Apr 13 14:50:22 CEST 2011

      [INFO] Final Memory: 31M/338M

      [INFO] ------------------------------------------------------------------------

       

      Kind regards,

           aannoo

        • 1. Errai-Cdi Examples
          Mike Brock Master

          Try running: mvn install

          • 2. Errai-Cdi Examples
            aannoo Newbie

            Hi Christopher,

             

            tried 'mvn install' on the base directory (errai-cdi). No problems. I moved on to examples/gui. Here 'mvn install' fails with (slashed):

             

            [INFO]    Scanning for additional dependencies: jar:file:/home/tpasch/.m2/repository/org/jboss/errai/errai-workspaces/1.2.3-SNAPSHOT/errai-workspaces-1.2.3-SNAPSHOT.jar!/org/jboss/errai/workspaces/client/Application.java

            [INFO]       Computing all possible rebind results for 'org.jboss.errai.workspaces.client.framework.WorkspaceConfig'

            [INFO]          Rebinding org.jboss.errai.workspaces.client.framework.WorkspaceConfig

            [INFO]             Invoking com.google.gwt.dev.javac.StandardGeneratorContext@2e1c3062

            [INFO]                Adding Errai Tool: org.jboss.errai.cdi.client.service.CalculatorClient

            [INFO]                Adding Errai Tool: org.jboss.errai.cdi.client.rpc.AccountClient

            [INFO]                Adding Errai Tool: org.jboss.errai.cdi.client.command.BatchProcesserClient

            [INFO]                Adding Errai Tool: org.jboss.errai.cdi.client.scopes.ScopeTestClient

            [INFO]                [ERROR] Error generating bootstrap loader

            [INFO] java.lang.RuntimeException: @ConversationContext should be used with type Event

            [INFO]  at org.jboss.errai.cdi.rebind.ConversationDecorator.generateDecorator(ConversationDecorator.java:49)

            [INFO]  at org.jboss.errai.ioc.rebind.ioc.DecoratorTask.doTask(DecoratorTask.java:76)

            [INFO]  at org.jboss.errai.ioc.rebind.ioc.InjectUtil.handleInjectionTasks(InjectUtil.java:105)

            [INFO]  at org.jboss.errai.ioc.rebind.ioc.InjectUtil.access$000(InjectUtil.java:33)

            [INFO]  at org.jboss.errai.ioc.rebind.ioc.InjectUtil$2.generateConstructor(InjectUtil.java:92)

            [INFO]  at org.jboss.errai.ioc.rebind.ioc.TypeInjector.getType(TypeInjector.java:54)

            [INFO]  at org.jboss.errai.ioc.rebind.ioc.InjectorFactory.generate(InjectorFactory.java:36)

            [INFO]  at org.jboss.errai.ioc.rebind.IOCGenerator.generateInjectors(IOCGenerator.java:357)

            [INFO]  at org.jboss.errai.workspaces.rebind.WorkspaceLoaderBootstrapGenerator.generateWidgetProvisioning(WorkspaceLoaderBootstrapGenerator.java:312)

            [INFO]  at org.jboss.errai.workspaces.rebind.WorkspaceLoaderBootstrapGenerator.generateBootstrapClass(WorkspaceLoaderBootstrapGenerator.java:239)

            [INFO]  at org.jboss.errai.workspaces.rebind.WorkspaceLoaderBootstrapGenerator.generateClass(WorkspaceLoaderBootstrapGenerator.java:121)

            [INFO]  at org.jboss.errai.workspaces.rebind.WorkspaceLoaderBootstrapGenerator.generate(WorkspaceLoaderBootstrapGenerator.java:79)

            [INFO]  at com.google.gwt.dev.javac.StandardGeneratorContext.runGenerator(StandardGeneratorContext.java:418)

            [INFO]  at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:38)

             

            [...]

             

            [INFO]    [ERROR] Cannot proceed due to previous errors

            [INFO] ------------------------------------------------------------------------

            [INFO] BUILD FAILURE

            [INFO] ------------------------------------------------------------------------

            [INFO] Total time: 16.259s

            [INFO] Finished at: Thu Apr 14 09:53:00 CEST 2011

            [INFO] Final Memory: 9M/162M

            [INFO] ------------------------------------------------------------------------

            [ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:1.3-12393:compile (default) on project errai-cdi-examples: Command [[

            [ERROR] /bin/sh -c /usr/lib/jvm/java-6-sun-1.6.0.24/jre/bin/java -Xmx512m -DDEBUG -classpath /home/tpasch/compile/errai-cdi.git/examples/gui/src/main/java:/home/tpasch/compile/errai-cdi.git/examples/gui/war/WEB-INF/classes:/home/tpasch/.m2/repository/org/jboss/errai/errai-bus/1.2.3-SNAPSHOT/errai-bus-1.2.3-SNAPSHOT.jar:/home/tpasch/.m2/repository/org/jboss/errai/errai-common/1.2.3-SNAPSHOT/errai-common-1.2.3-SNAPSHOT.jar:/home/tpasch/.m2/repository/com/google/code/guice/guice/2.0/guice-2.0.jar:/home/tpasch/.m2/repository/com/google/code/guice/guice/2.0/guice-2.0-aopalliance.jar:/home/tpasch/.m2/repository/com/google/code/guice/guice-servlet/2.0/guice-servlet-2.0.jar:/home/tpasch/.m2/repository/org/slf4j/slf4j-log4j12/1.5.10/slf4j-log4j12-1.5.10.jar:/home/tpasch/.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar:/home/tpasch/.m2/repository/junit/junit/4.8.1/junit-4.8.1.jar:/home/tpasch/.m2/repository/org/reflections/reflections/0.9.5-RC2_jboss-SP1/reflections-0.9.5-RC2_jboss-SP1.jar:/home/tpasch/.m2/repository/com/google/collections/google-collections/1.0/google-collections-1.0.jar:/home/tpasch/.m2/repository/dom4j/dom4j/1.6/dom4j-1.6.jar:/home/tpasch/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:/home/tpasch/.m2/repository/javassist/javassist/3.12.1.GA/javassist-3.12.1.GA.jar:/home/tpasch/.m2/repository/org/jboss/errai/errai-workspaces/1.2.3-SNAPSHOT/errai-workspaces-1.2.3-SNAPSHOT.jar:/home/tpasch/.m2/repository/org/jboss/errai/errai-widgets/1.2.3-SNAPSHOT/errai-widgets-1.2.3-SNAPSHOT.jar:/home/tpasch/.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic/0.4.0-rc4/gwt-mosaic-0.4.0-rc4.jar:/home/tpasch/.m2/repository/com/googlecode/gwtmosaic/gwt-beans-binding/0.4.0-rc4/gwt-beans-binding-0.4.0-rc4.jar:/home/tpasch/.m2/repository/com/googlecode/gwtmosaic/gwt-dnd/0.4.0-rc4/gwt-dnd-0.4.0-rc4.jar:/home/tpasch/.m2/repository/com/googlecode/gwtmosaic/gwtx/0.4.0-rc4/gwtx-0.4.0-rc4.jar:/home/tpasch/.m2/repository/com/google/code/gwt-log/gwt-log/3.0.1/gwt-log-3.0.1.jar:/home/tpasch/.m2/repository/org/jboss/errai/errai-tools/1.2.3-SNAPSHOT/errai-tools-1.2.3-SNAPSHOT.jar:/home/tpasch/.m2/repository/hsqldb/hsqldb/1.8.0.7/hsqldb-1.8.0.7.jar:/home/tpasch/.m2/repository/org/mvel/mvel2/2.0.18-RC4/mvel2-2.0.18-RC4.jar:/home/tpasch/.m2/repository/org/jboss/errai/errai-cdi/1.2.3-SNAPSHOT/errai-cdi-1.2.3-SNAPSHOT.jar:/home/tpasch/.m2/repository/org/jboss/errai/errai-ioc/1.2.3-SNAPSHOT/errai-ioc-1.2.3-SNAPSHOT.jar:/home/tpasch/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar:/home/tpasch/.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar:/home/tpasch/.m2/repository/org/jboss/errai/errai-cdi-examples-model/1.2.3-SNAPSHOT/errai-cdi-examples-model-1.2.3-SNAPSHOT.jar:/home/tpasch/.m2/repository/org/jboss/errai/errai-cdi-examples-model/1.2.3-SNAPSHOT/errai-cdi-examples-model-1.2.3-SNAPSHOT-sources.jar:/home/tpasch/.m2/repository/org/jboss/errai/errai-cdi-examples-server/1.2.3-SNAPSHOT/errai-cdi-examples-server-1.2.3-SNAPSHOT.jar:/home/tpasch/.m2/repository/org/jboss/errai/errai-cdi-jetty/1.2.3-SNAPSHOT/errai-cdi-jetty-1.2.3-SNAPSHOT.jar:/home/tpasch/.m2/repository/org/mortbay/jetty/jetty/6.1.25/jetty-6.1.25.jar:/home/tpasch/.m2/repository/org/mortbay/jetty/jetty-util/6.1.25/jetty-util-6.1.25.jar:/home/tpasch/.m2/repository/org/mortbay/jetty/servlet-api/2.5-20081211/servlet-api-2.5-20081211.jar:/home/tpasch/.m2/repository/org/mortbay/jetty/jetty-plus/6.1.25/jetty-plus-6.1.25.jar:/home/tpasch/.m2/repository/geronimo-spec/geronimo-spec-jta/1.0.1B-rc4/geronimo-spec-jta-1.0.1B-rc4.jar:/home/tpasch/.m2/repository/org/mortbay/jetty/jetty-naming/6.1.25/jetty-naming-6.1.25.jar:/home/tpasch/.m2/repository/javax/mail/mail/1.4/mail-1.4.jar:/home/tpasch/.m2/repository/org/jboss/weld/servlet/weld-servlet/1.1.0.Final/weld-servlet-1.1.0.Final.jar:/home/tpasch/.m2/repository/org/jboss/weld/servlet/weld-servlet/1.1.0.Final/weld-servlet-1.1.0.Final-sources.jar:/home/tpasch/.m2/repository/com/google/gwt/gwt-user/2.0.4/gwt-user-2.0.4.jar:/home/tpasch/.m2/repository/com/google/gwt/gwt-dev/2.0.4/gwt-dev-2.0.4.jar:/home/tpasch/.m2/repository/org/slf4j/slf4j-api/1.5.11/slf4j-api-1.5.11.jar com.google.gwt.dev.Compiler -gen /home/tpasch/compile/errai-cdi.git/examples/gui/target/.generated -logLevel TRACE -style OBF -war /home/tpasch/compile/errai-cdi.git/examples/gui/war -localWorkers 4 org.jboss.errai.cdi.App

            [ERROR] ]] failed with status 1

            [ERROR] -> [Help 1]

            [ERROR]

            [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

            [ERROR] Re-run Maven using the -X switch to enable full debug logging.

            [ERROR]

            [ERROR] For more information about the errors and possible solutions, please read the following articles:

            [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

             

            I tried both a mvn 2.2.1 and a mvn 3.0.1.

             

            Kind regards,

             

            aannoo

            • 3. Errai-Cdi Examples
              aannoo Newbie

              Hi Christopher,

               

              tried to run the examples/gui stuff from within eclipse as well. For me, it looks like the BeanManager lockup fails...

               

              Starting Jetty on port 8888

                 [WARN] failed ErraiServlet

              javax.servlet.ServletException: java.lang.RuntimeException: Failed to create service

                  at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:437)

                  at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)

                  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)

                  at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:616)

                  at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)

                  at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220)

                  at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513)

                  at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)

                  at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:447)

                  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)

                  at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

                  at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115)

                  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)

                  at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

                  at org.mortbay.jetty.Server.doStart(Server.java:222)

                  at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)

                  at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:542)

                  at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:431)

                  at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1053)

                  at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:795)

                  at com.google.gwt.dev.DevMode.main(DevMode.java:282)

              Caused by: java.lang.RuntimeException: Failed to create service

                  at org.jboss.errai.bus.server.servlet.AbstractErraiServlet.init(AbstractErraiServlet.java:98)

                  at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:433)

                  ... 20 more

              Caused by: java.lang.RuntimeException: Failed to locate BeanManager

                  at org.jboss.errai.cdi.server.Util.lookupBeanManager(Util.java:147)

                  at org.jboss.errai.cdi.server.CDIServiceLocator.locateService(CDIServiceLocator.java:14)

                  at org.jboss.errai.bus.server.servlet.AbstractErraiServlet.init(AbstractErraiServlet.java:96)

                  ... 21 more

              Caused by: javax.naming.NameNotFoundException; remaining name 'BeanManager'

                  at org.mortbay.naming.NamingContext.lookup(NamingContext.java:578)

                  at org.mortbay.naming.NamingContext.lookup(NamingContext.java:665)

                  at org.mortbay.naming.NamingContext.lookup(NamingContext.java:680)

                  at org.mortbay.naming.java.javaRootURLContext.lookup(javaRootURLContext.java:112)

                  at javax.naming.InitialContext.lookup(InitialContext.java:392)

                  at org.jboss.errai.cdi.server.Util.lookupBeanManager(Util.java:122)

                  ... 23 more

               

              Kind regards,

               

              aannoo