1 2 Previous Next 22 Replies Latest reply: Jul 4, 2011 5:56 AM by Craig Greenhalgh RSS

Weld, GWT and ErraiBus project template?

slawek t Novice

Hi, I'm thinking about good eclipse (with maven, ant?) template for project based on Weld, GWT 2 and ErraiBus. Ideally would be to have possibility to use GWT plugin for quick GWT development, but in the same time have well  incorporated WELD (and ErraiBus) with maven (or ant) to build and deploy whole project. All deployed on JBoss AS 6.0.0-m3.

 

Any advise would be very helpful.

 

Slawek

  • 1. Re: Weld, GWT and ErraiBus project template?
    Heiko Braun Master

    I think the best fit at the moment is the GUI example that resides with the weld integration codebase:

    http://anonsvn.jboss.org/repos/errai/projects/weld-integration/trunk/examples/gui/

     

     

    This should work with the eclipse GWT plugin. I am planning on turning this into

    a maven archetype for the 1.1-FINAL release, which is due soon.

     

     

    Would that work for you?

  • 2. Re: Weld, GWT and ErraiBus project template?
    Heiko Braun Master

    I've created a preliminary archetype:

     

     

     mvn archetype:generate \
            -DarchetypeGroupId=org.jboss.errai \
            -DarchetypeArtifactId=cdi-archetype \
            -DarchetypeVersion=1.0-SNAPSHOT \
            -DarchetypeRepository=https://repository.jboss.org/nexus/content/groups/public/
    

     

     

    Would be nice if you could tell if it works for you. We'll base the archetype that ships with the next release on this one.

  • 3. Re: Weld, GWT and ErraiBus project template?
    Heiko Braun Master

    I've added the eclipse setup instructions to the Wiki:

     

    https://community.jboss.org/wiki/WorkingwithGWTCDIandErrai

     

    Most notable is probably the fact that you need to modify the GWT plugin launch configuration,

    so that the CDI container get's bootstrapped in GWT hosted mode.

  • 4. Re: Weld, GWT and ErraiBus project template?
    slawek t Novice

    Hi Heiko,

     

    Today I've prepared project template according to newest description here: https://community.jboss.org/wiki/WorkingwithGWTCDIandErrai

    My environment: java jdk 1.6, eclipse 3.6, GWT sdk 2.0.4, maven 2.1. Building project template from maven archetype went correctly, import into eclipse correctly (at least with no errors), final building in eclipse with maven also OK, but Run (Run As ...) with Jetty launcher ended with error:

     

    [WARN] Failed startup of context org.jboss.errai.cdi.server.gwt.JettyLauncher$WebAppContextWithReload@4e280c{/,C:\temp\eclipse-workspace\termeet-app\war}
    org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [MessageBus] with qualifiers [@Default] at injection point [[parameter 1] of [constructor] @Inject public pl.termeet.client.App(MessageBus)]
    at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:284)
    at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:134)
    at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:153)
    at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:356)
    at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:342)
    at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:383)
    at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:222)
    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)

    [WARN] Failed startup of context org.jboss.errai.cdi.server.gwt.JettyLauncher$WebAppContextWithReload@4e280c{/,C:\temp\eclipse-workspace\termeet-app\war}

    org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [MessageBus] with qualifiers [@Default] at injection point [[parameter 1] of [constructor] @Inject public pl.termeet.client.App(MessageBus)]

    at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:284)

    at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:134)

    at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:153)

    at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:356)

    at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:342)

    at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:383)

    at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:222)

    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)

     

    What can I do to fix the issue with Jetty launcher?

     

    Slawek

  • 5. Re: Weld, GWT and ErraiBus project template?
    Heiko Braun Master

    Are you using 1.1-Final already?

  • 6. Re: Weld, GWT and ErraiBus project template?
    slawek t Novice

    I hope so. I completely removed maven repo befor starting, so I understand I received newest version of Errai.

    Currently in my maven repo for Errai (.m2\repository\org\jboss\errai\) is:

     

    cdi-archetype
    errai-bus
    errai-parent
    errai-common
    errai-ioc
    errai-cdi
    cdi-integration-parent
    errai-cdi-jetty

    cdi-archetype/1.1-Final

    errai-bus/1.1-Final

    errai-parent/1.1-Final

    errai-common/1.1-Final

    errai-ioc/1.1-Final

    errai-cdi/1.1-Beta2

    cdi-integration-parent/1.1-Beta2

    errai-cdi-jetty/1.1-Beta2

     

    Is it correct?

     

    Slawek

  • 7. Re: Weld, GWT and ErraiBus project template?
    Heiko Braun Master

    yes, looks good.

    i need to reproduce the error locally. I'll get back to you soon.

  • 10. Re: Weld, GWT and ErraiBus project template?
    Heiko Braun Master

    Ah Slawek, I should have read stacktrace more carefully. It's actually the same problem we had with the new eventing code. The CDI bootstrap process scans the GWT client code and attempts dependency injection on it:

     

    at injection point [[parameter 1] of [constructor] @Inject public pl.termeet.client.App(MessageBus)]

     

    I've published a new CDI integration snapshot. If you change your org.jboss.errai:errai-cdi to 1.1-SNAPSHOT, the problem should be gone.

    Make sure that eclipse picks up the changes.

     

     


  • 11. Re: Weld, GWT and ErraiBus project template?
    slawek t Novice

    I tried to follow your suggestion but there is probably something wrong with maven repository location org/jboss/errai/errai-cdi/1.1-SNAPSHOT. Maven can't download libraries from that location (probably due to issue with maven-metadata.xml).

  • 12. Re: Weld, GWT and ErraiBus project template?
    slawek t Novice

    Heiko, could you give me more details how to change errai-cdi from version 1.1-Final to 1.1-SNAPSHOT please? I'm quite new to maven and I'm afraid I do it incorrectly.

  • 13. Re: Weld, GWT and ErraiBus project template?
    Heiko Braun Master

    just take a look at the pom.xml. The version is configured somewhere under <properties/>

  • 14. Re: Weld, GWT and ErraiBus project template?
    slawek t Novice

    That's the part of pom.xml of my project (created on base of archetype):

     

       <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <errai.version>1.1-Final</errai.version>
            <errai-cdi.version>1.1-Beta2</errai-cdi.version>
            <gwt.version>2.0.4</gwt.version>
            <hsqldb.version>1.8.0.7</hsqldb.version>
            <weld.version>1.1.0.Beta2</weld.version>
            <gwt.maven>1.3-12393</gwt.maven>
            <mvel.version>2.0.18</mvel.version>
            <jetty.version>6.1.25</jetty.version>
            <slf4j.version>1.5.11</slf4j.version>
            <webDescriptor>jetty</webDescriptor>
            <uel.impl.version>2.1.2-b04</uel.impl.version>
        </properties>...

     

    ...

     

       <properties>

            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

            <errai.version>1.1-Final</errai.version>

            <errai-cdi.version>1.1-Beta2</errai-cdi.version>

            <gwt.version>2.0.4</gwt.version>

            <hsqldb.version>1.8.0.7</hsqldb.version>

            <weld.version>1.1.0.Beta2</weld.version>

            <gwt.maven>1.3-12393</gwt.maven>

            <mvel.version>2.0.18</mvel.version>

            <jetty.version>6.1.25</jetty.version>

            <slf4j.version>1.5.11</slf4j.version>

            <webDescriptor>jetty</webDescriptor>

            <uel.impl.version>2.1.2-b04</uel.impl.version>

        </properties>

    ...
    if I change
    <errai-cdi.version>1.1-Beta2</errai-cdi.version>
    to
    <errai-cdi.version>1.1-SNAPSHOT</errai-cdi.version>

    I receive:

     

    09.12.10 11:38:35 CET: Refreshing [/termeet-app/pom.xml]

    09.12.10 11:38:45 CET: Downloaded https://repository.jboss.org/nexus/content/groups/public/org/jboss/errai/errai-cdi/1.1-SNAPSHOT/maven-metadata.xml

    09.12.10 11:38:48 CET: Downloaded https://repository.jboss.org/nexus/content/groups/public/org/jboss/errai/errai-cdi/1.1-SNAPSHOT/errai-cdi-1.1-SNAPSHOT.pom

    09.12.10 11:38:48 CET: [WARN] The POM for org.jboss.errai:errai-cdi:jar:1.1-SNAPSHOT is missing, no dependency information available

    09.12.10 11:38:54 CET: Downloaded https://repository.jboss.org/nexus/content/groups/public/org/jboss/errai/errai-cdi-jetty/1.1-SNAPSHOT/maven-metadata.xml

    09.12.10 11:38:57 CET: Downloaded https://repository.jboss.org/nexus/content/groups/public/org/jboss/errai/errai-cdi-jetty/1.1-SNAPSHOT/errai-cdi-jetty-1.1-SNAPSHOT.pom

    09.12.10 11:38:57 CET: [WARN] The POM for org.jboss.errai:errai-cdi-jetty:jar:1.1-SNAPSHOT is missing, no dependency information available

    09.12.10 11:39:00 CET: Downloaded https://repository.jboss.org/nexus/content/groups/public/org/jboss/errai/errai-cdi/1.1-SNAPSHOT/errai-cdi-1.1-SNAPSHOT.jar

    09.12.10 11:39:00 CET: Downloaded https://repository.jboss.org/nexus/content/groups/public/org/jboss/errai/errai-cdi-jetty/1.1-SNAPSHOT/errai-cdi-jetty-1.1-SNAPSHOT.jar

    09.12.10 11:39:00 CET: Missing artifact org.jboss.errai:errai-cdi:jar:1.1-SNAPSHOT:compile

    09.12.10 11:39:00 CET: Missing artifact org.jboss.errai:errai-cdi-jetty:jar:1.1-SNAPSHOT:compile

    09.12.10 11:39:06 CET: Maven Builder: AUTO_BUILD

1 2 Previous Next