11 Replies Latest reply on Dec 12, 2011 10:23 AM by jfuerth

    Second try with Gwt, Errai and CDI ...fail again...

    n3k0

      Hi again.

      In my free time, i decided to modify my example application, and give it an view like a tradicional

      MVC application, i modified like this:

       

      Config file:

       

      <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6//EN"
      "http://google-web-toolkit.googlecode.com/svn/releases/1.6/distro-source/core/src/gwt-module.dtd">
      <module rename-to='Login'>
      
      <inherits name="com.google.gwt.user.User"/>
      <inherits name="com.google.web.bindery.event.Event"/>
      <inherits name="com.google.gwt.user.theme.standard.Standard"/>
          
      <inherits name="org.jboss.errai.bus.ErraiBus"/>
      <inherits name="org.jboss.errai.ioc.Container"/>
      <inherits name="org.jboss.errai.enterprise.CDI"/>
                  
      </module>   
      

       

      View (in client side):

       

       

      package com.service.errai.login.client.local;
      import javax.annotation.PostConstruct;
      import javax.enterprise.inject.Typed;
      import javax.inject.Inject;
      import org.jboss.errai.bus.client.api.RemoteCallback;
      import org.jboss.errai.bus.client.api.base.MessageBuilder;
      import com.google.gwt.user.client.Window;
      import com.service.errai.login.client.shared.TheRemoteService;
      import org.jboss.errai.bus.client.framework.ClientMessageBus;
      import org.jboss.errai.bus.client.framework.MessageBus;
      import org.jboss.errai.ioc.client.api.EntryPoint;
      
      @EntryPoint
      public class Login {
      
          private MessageBus bus;
          
          @Inject
           public Login(MessageBus bus) {
              this.setBus(bus);
           }
          
          @PostConstruct
          public void onModuleLoad(){
              ((ClientMessageBus) bus).addPostInitTask(new Runnable() {
                     public void run() {
                         MessageBuilder.createCall(new RemoteCallback<Boolean>() {      
                             public void callback(Boolean isHappy) {                   
                                 if (isHappy) Window.alert("Everyone is happy!");         
                             }                                                           
                         }, TheRemoteService.class).isEveryoneHappy();
                     }
              });
          }
      
          public MessageBus getBus() {
              return bus;
          }
      
          public void setBus(MessageBus bus) {
              this.bus = bus;
          }
      }
      

       

      Control (shared folder, client and server can make references in this interface):

       

      package com.service.errai.login.client.shared;
      
      import org.jboss.errai.bus.server.annotations.Remote;
      
      @Remote
      public interface TheRemoteService {
          public boolean isEveryoneHappy();
      }
      

       

      Control (implementation in server side):

       

      package com.service.errai.login.server;
      import javax.inject.Inject;
      import org.jboss.errai.bus.client.framework.MessageBus;
      import org.jboss.errai.bus.server.annotations.Service;
      import com.service.errai.login.client.shared.TheRemoteService;
      import com.service.errai.login.server.dao.TheDao;
      
      @Service
      public class TheRemoteServiceImpl implements TheRemoteService {
      
          private MessageBus bus;
          
          @Inject                    //THIS IS THE NEW REFERENCE
          private TheDao theDao;    //TO A DAO
          
          @Inject
          public TheRemoteServiceImpl( MessageBus bus ){
              this.setBus(bus);
          }
          
          public boolean isEveryoneHappy() {
             return theDao.isEveryoneHappy();//THIS IS A METHOD THAT USE THE DAO
          }
      
          public MessageBus getBus() {
              return bus;
          }
      
          public void setBus(MessageBus bus) {
              this.bus = bus;
          }
      
          public TheDao getTheDao() {
              return theDao;
          }
      
          public void setTheDao(TheDao theDao) {
              this.theDao = theDao;
          }
      }
      

       

      Model (interface in server side):

       

      package com.service.errai.login.server.dao;
      
      public interface TheDao {
          
          public boolean isEveryoneHappy();
      }
      

       

      Model (implementation in server side):

      package com.service.errai.login.server.dao.impl;
      
      import javax.inject.Inject;
      import org.jboss.errai.bus.client.framework.MessageBus;
      import com.service.errai.login.server.dao.TheDao;
      
      public class TheDaoImpl implements TheDao {
          
          private MessageBus bus;
          
          @Inject
          public TheDaoImpl( MessageBus bus ){
              this.setBus(bus);
          }
          
          @Override
          public boolean isEveryoneHappy() {
              return true;
          }
      
          public MessageBus getBus() {
              return bus;
          }
      
          public void setBus(MessageBus bus) {
              this.bus = bus;
          }
      }
      

       

      I have a beans.xml in WEB-INF folder with no content.

       

      When i deploy my application, this exception appears:

       

       

      1)No implementation for com.service.errai.login.server.dao.TheDao was bound.
        while locating com.service.errai.login.server.dao.TheDao
        for field at com.service.errai.login.server.TheRemoteServiceImpl.theDao(TheRemoteServiceImpl.java:47)
        while locating com.service.errai.login.server.TheRemoteServiceImpl
      

       

      Well, i read some articles about CDI, and (like the examples in errai) it's enough to

      add an @Inject annotation in the constructor/setter/field desired to get the default implementation

      of a service (it's no neccesary the @Default annotation when you just have one implementation

      of a service, in this case TheDao interface)

       

      Could someone give me some guidance to make this works?

      I tested adding the annotations @Default, @Named @Typed ...a but non of these works neither.

      Thanks in advance.

        • 1. Re: Second try with Gwt, Errai and CDI ...fail again...
          csa

          You need an @ApplicationScoped annotation on your DaoImpl in order for it to be injectable.

          1 of 1 people found this helpful
          • 2. Re: Second try with Gwt, Errai and CDI ...fail again...
            n3k0

            Mmmm... no, i put the @ApplicationScope annotation, in the TheDaoImpl class, but the same effect appears:

             

            com.google.inject.ConfigurationException: Guice configuration errors:
            
            1) No implementation for com.contacts.mexico.login.server.dao.ProfileDao annotated with @javax.enterprise.inject.Default() was bound.
              while locating com.contacts.mexico.login.server.dao.ProfileDao annotated with @javax.enterprise.inject.Default()
                for field at com.contacts.mexico.login.server.service.impl.ProfileServiceImpl.profileDao(ProfileServiceImpl.java:22)
              while locating com.contacts.mexico.login.server.service.impl.ProfileServiceImpl
            
            1 error
                at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1004)
                at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:961)
                at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013)
            ...
            

             

            In some articles says that i have to put the beans.xml in META-INF folder, but in others in WEB-INF folder... i put it both paths and the exception is the same...

            • 3. Re: Second try with Gwt, Errai and CDI ...fail again...
              csa

              Can you check your classpath for the Guice version you use? You should see guice-3.0.jar and no other version (like e.g. guice-2.0-aopalliance.jar).

               

              BTW, you can use field injection for the MessageBus (rather than constructor injection) using javax.inject.Inject.

              • 4. Re: Second try with Gwt, Errai and CDI ...fail again...
                csa

                Also, when using constructor injection, make sure you add a default no-arg constructor to your server-side beans (your DAOs and @Service classes). This limitation does not apply to client-side beans managed by Errai.

                • 5. Re: Second try with Gwt, Errai and CDI ...fail again...
                  n3k0

                  Sorry about my late reply.

                  Effectively i removed the  guice-2.0-aopalliance.jar and i have only guice-3.0.jar file.

                   

                  I read about how to start the CDI container, adding this tags in the web.xml file.

                   

                   <listener>
                      <listener-class>org.jboss.errai.container.DevModeCDIBootstrap</listener-class>
                    </listener>
                   
                    <resource-env-ref>
                      <description>Object factory for the CDI Bean Manager</description>
                      <resource-env-ref-name>BeanManager</resource-env-ref-name>
                      <resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>
                    </resource-env-ref>
                  

                   

                  After this, i add the next jars, because some ClassNotFoundException's appears.

                   

                  jetty-naming-6.0.0.jar

                  jetty-plus-6.0.0.jar

                  weld-servlet.jar

                  el-api-6.0.20.jar

                   

                  And add this, in the Run Configurations -> Arguments -> Program arguments

                   

                   

                  -server org.jboss.errai.cdi.server.gwt.JettyLauncher
                  

                   

                   

                  But, after all, the exception is:

                   

                   

                  org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions:
                  Exception 0 :
                  java.lang.RuntimeException: could not initialize ErraiService instance
                      at org.jboss.errai.cdi.server.Util.lookupErraiService(Util.java:142)
                      at org.jboss.errai.cdi.server.CDIExtensionPoints.afterBeanDiscovery(CDIExtensionPoints.java:264)
                      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:186)
                      at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:543)
                      at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
                      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 org.jboss.errai.cdi.server.gwt.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:450)
                      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 org.jboss.errai.cdi.server.gwt.JettyLauncher.start(JettyLauncher.java:526)
                      at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
                      at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1068)
                      at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811)
                      at com.google.gwt.dev.DevMode.main(DevMode.java:311)
                  Caused by: com.google.inject.ProvisionException: Guice provision errors:
                  
                  1) Error injecting constructor, java.lang.RuntimeException: Server bootstrap failed
                    at org.jboss.errai.bus.server.service.ErraiServiceImpl.<init>(ErraiServiceImpl.java:51)
                    at org.jboss.errai.bus.server.service.ErraiServiceImpl.class(ErraiServiceImpl.java:51)
                    while locating org.jboss.errai.bus.server.service.ErraiServiceImpl
                    while locating org.jboss.errai.bus.server.service.ErraiService
                  
                  1 error
                      at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:987)
                      at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013)
                      at org.jboss.errai.container.ServiceFactory.create(ServiceFactory.java:35)
                      at org.jboss.errai.cdi.server.Util.lookupErraiService(Util.java:136)
                      ... 38 more
                  Caused by: java.lang.RuntimeException: Server bootstrap failed
                      at org.jboss.errai.bus.server.service.bootstrap.OrderedBootstrap.execute(OrderedBootstrap.java:71)
                      at org.jboss.errai.bus.server.service.ErraiServiceImpl.boostrap(ErraiServiceImpl.java:60)
                      at org.jboss.errai.bus.server.service.ErraiServiceImpl.<init>(ErraiServiceImpl.java:55)
                      at org.jboss.errai.bus.server.service.ErraiServiceImpl$$FastClassByGuice$$7879947c.newInstance(<generated>)
                      at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
                      at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60)
                      at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
                      at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
                      at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
                      at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
                      at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
                      at com.google.inject.Scopes$1$1.get(Scopes.java:65)
                      at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
                      at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:54)
                      at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978)
                      at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
                      at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
                      ... 41 more
                  Caused by: com.google.inject.ConfigurationException: Guice configuration errors:
                  
                  1) No implementation for com.service.errai.login.server.dao.TheDao was bound.
                    while com.service.errai.login.server.dao.TheDao
                      for field at com.service.errai.login.server.TheRemoteServiceImpl(ProfileServiceImpl.java:14)
                    while locating com.service.errai.login.server.TheRemoteServiceImpl
                  
                  1 error
                  

                   

                  :-( ...

                  • 6. Re: Second try with Gwt, Errai and CDI ...fail again...
                    n3k0

                    I followed your recommendations about the use of annotations.

                    I tried changing the application server, i moved to JBoss 6 instead to using the embebbed Jetty provided by the GWT plugin.

                    My web.xml file is like this:

                     

                     

                    <?xml version="1.0" encoding="UTF-8"?>
                    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
                        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
                        id="WebApp_ID" version="3.0">
                        <display-name>erraiServices</display-name>
                    
                        <servlet>
                            <servlet-name>ErraiServlet</servlet-name>
                            <servlet-class>org.jboss.errai.bus.server.servlet.DefaultBlockingServlet</servlet-class>
                            <load-on-startup>1</load-on-startup>
                        </servlet>
                    
                        <servlet-mapping>
                            <servlet-name>ErraiServlet</servlet-name>
                            <url-pattern>*.erraiBus</url-pattern>
                        </servlet-mapping>
                    
                        <welcome-file-list>
                            <welcome-file>Login.html</welcome-file>
                        </welcome-file-list>
                    </web-app>
                    

                      

                    I erased some jars from the project because JBoss is already include them, i put the list of included jars in my project:

                     

                    aopalliance-1.0.jar

                    errai-bus-1.3.1.Final.jar

                    errai-cdi-client-1.3.1.Final.jar

                    errai-common-1.3.1.Final.jar

                    errai-ioc-1.3.1.Final.jar

                    errai-javax-enterprise-1.3.1.Final.jar

                    errai-tools-1.3.1.Final.jar

                    guava-r09.jar

                    guice-3.0.jar

                    gwt-log-3.0.1.jar

                    jsr250-api-1.0.jar

                    msgpack-0.5.1-devel.jar

                    mvel2-2.0.18-RC4.jar

                    reflections-0.9.6_jboss_errai_r2.jar

                    smartgwt-skins.jar

                    smartgwt.jar

                     

                    I don't put the classes code, because is practically the same (just a little refactor with recommendations of Christian)

                     

                    Now, the exception is this:

                     

                    DEPLOYMENTS MISSING DEPENDENCIES:
                      Deployment "jboss-switchboard:appName=erraiServices,module=erraiServices" is missing the following dependencies:
                        Dependency "java:global/cdi/erraiServices/erraiServices/BeanManager" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'java:global/cdi/erraiServices/erraiServices/BeanManager' **")
                      Deployment "jboss.web.deployment:war=/erraiServices" is missing the following dependencies:
                        Dependency "vfs:///usr/java/jboss-6.1.0.Final/server/default/deploy/erraiServices.war_WeldBootstrapBean" (should be in state "Create", but is actually in state "**ERROR**")
                    
                    DEPLOYMENTS IN ERROR:
                      Deployment "vfs:///usr/java/jboss-6.1.0.Final/server/default/deploy/erraiServices.war_WeldBootstrapBean" is in error due to the following reason(s): org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [MessageBus] with qualifiers [@Default] at injection point [[field] @Inject private com.service.errai.login.server.TheRemoteServiceImpl.bus], **ERROR**
                      Deployment "java:global/cdi/erraiServices/erraiServices/BeanManager" is in error due to the following reason(s): ** NOT FOUND Depends on 'java:global/cdi/erraiServices/erraiServices/BeanManager' **
                    
                        at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.2.GA]
                        at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.2.GA]
                        at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.1.0.Final]
                        at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:107) [:0.2.2]
                        at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:135) [:6.1.0.Final]
                        at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.1.0.Final]
                        at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]
                        at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]
                        at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]
                    
                    

                     

                    When i compile, it does not appears any error... but the problem is, launching the server, any idea of this?

                     

                    Message was edited by: n3k0 Reason: the exception is different...

                    • 7. Re: Second try with Gwt, Errai and CDI ...fail again...
                      n3k0

                      Can anybody give me a hand?

                      I can't believe i'm the only with this (weird) exception  :-( ....if the trace is not clear enough, i can give more data....

                      • 8. Re: Second try with Gwt, Errai and CDI ...fail again...
                        csa

                        I think the easiest way forward from here is to create an app using our CDI quickstart archetype: http://docs.jboss.org/errai/1.3.2.Final/errai-cdi/quickstart/html_single/.

                         

                        You can then either copy your source into this new app or just compare the setups. The app which will be created for you has separate maven profiles for JBoss AS 6 and 7, Tomcat and Jetty.

                        1 of 1 people found this helpful
                        • 9. Re: Second try with Gwt, Errai and CDI ...fail again...
                          n3k0

                          I agree with it, i created the archetype:

                           

                          mvn archetype:generate -DarchetypeGroupId=org.jboss.errai.archetypes -DarchetypeArtifactId=cdi-quickstart -DarchetypeVersion=1.3.2.Final -DarchetypeRepository=https://repository.jboss.org/nexus/content/groups/public
                          

                           

                          But, when i try to install it:

                           

                          mvn clean install -Pjboss6
                          [INFO] Trace
                          org.apache.maven.lifecycle.LifecycleExecutionException: Unable to build project for plugin 'org.jboss.errai:jacoco-gwt-maven-plugin': Cannot find parent: org.jacoco:org.jacoco.build for project: org.jboss.errai:jacoco-gwt-m
                          en-plugin:maven-plugin:null for project org.jboss.errai:jacoco-gwt-maven-plugin:maven-plugin:null
                                  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1557)
                                  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.bindPluginToLifecycle(DefaultLifecycleExecutor.java:1503)
                                  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.constructLifecycleMappings(DefaultLifecycleExecutor.java:1282)
                                  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:534)
                                  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
                                  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
                                  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
                                  at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
                                  at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
                                  at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
                                  at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
                                  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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
                                  at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
                                  at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
                                  at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
                          Caused by: org.apache.maven.plugin.InvalidPluginException: Unable to build project for plugin 'org.jboss.errai:jacoco-gwt-maven-plugin': Cannot find parent: org.jacoco:org.jacoco.build for project: org.jboss.errai:jacoco-gw
                          maven-plugin:maven-plugin:null for project org.jboss.errai:jacoco-gwt-maven-plugin:maven-plugin:null
                                  at org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(DefaultPluginManager.java:293)
                                  at org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(DefaultPluginManager.java:205)
                                  at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:184)
                                  at org.apache.maven.plugin.DefaultPluginManager.loadPluginDescriptor(DefaultPluginManager.java:1642)
                                  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1540)
                                  ... 18 more
                          Caused by: org.apache.maven.project.ProjectBuildingException: Cannot find parent: org.jacoco:org.jacoco.build for project: org.jboss.errai:jacoco-gwt-maven-plugin:maven-plugin:null for project org.jboss.errai:jacoco-gwt-mav
                          -plugin:maven-plugin:null
                                  at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1396)
                                  at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:823)
                                  at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:255)
                                  at org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(DefaultPluginManager.java:277)
                                  ... 22 more
                          Caused by: org.apache.maven.project.ProjectBuildingException: POM 'org.jacoco:org.jacoco.build' not found in repository: Unable to download the artifact from any repository
                          
                            org.jacoco:org.jacoco.build:pom:0.5.4-SNAPSHOT
                          
                          from the specified remote repositories:
                            central (http://repo1.maven.org/maven2),
                            jboss-public-repository-group (https://repository.jboss.org/nexus/content/groups/public/)
                          
                          
                                  at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:228)
                                  at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:90)
                                  at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:558)
                                  ... 26 more
                          Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository
                                  at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:404)
                                  at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:216)
                                  ... 28 more
                          

                           

                           

                          I have in my .m2 repository, the jacoco-gwt-maven-plugin-0.5.4-SNAPSHOT.jar but not other else...

                          Do i have to configure anything else?

                          • 10. Re: Second try with Gwt, Errai and CDI ...fail again...
                            csa

                            No, that's our fault. We will fix that asap. In the meantime, you can use the 1.3.1.Final archetype and then just upgrade the errai version in the generated pom.xml to 1.3.2.Final.

                             

                             

                            {code} mvn archetype:generate -DarchetypeGroupId=org.jboss.errai.archetypes -DarchetypeArtifactId=cdi-quickstart -DarchetypeVersion=1.3.1.Final -DarchetypeRepository=https://repository.jboss.org/nexus/content/groups/public {code}

                            • 11. Re: Second try with Gwt, Errai and CDI ...fail again...
                              jfuerth

                              Hi n3k0,

                               

                              Sorry, this was my fault. It appears this jacoco-gwt-maven-plugin dependency has a parent POM that's not in Maven Central. We will re-publish a jacoco-gwt-maven-plugin that doesn't depend on that 3rd party parent POM, but in the mean time, you can add this to the repositories section in your newly created project's pom.xml:

                               

                                              <pluginRepository>

                                                      <id>jacoco-snapshot-repository</id>

                                                      <name>JaCoCo Snapshot Build Repository</name>

                                                      <url>https://oss.sonatype.org/content/repositories/snapshots</url>

                                                      <layout>default</layout>

                                              </pluginRepository>

                               

                              Sorry for the inconvienience. All the machines we tested that archetype on must have had the missing POM cached in their local repo.

                               

                              -Jonathan