Skip to content

Unable to integrate vertx-when with Vert.x application #4

@msmolyak

Description

@msmolyak

I was not able to find a version of vertx-when available in a public Maven repository. Thus, I cloned the project and built it locally. To build it I had to switch from Java 7 to Java 8, which I did. The project is installed locally as "com.englishtown.vertx:vertx-when:4.0.0-SNAPSHOT".

I added this statement to my build.gradle:
compile "com.englishtown.vertx:vertx-when:4.0.0-SNAPSHOT"

I am able to run 'gradle install' or 'gradle fatjar' for my Vert.x applicationwritten in Groovy without any problems.

Here is the code, which gives me trouble:

package test
import org.vertx.groovy.core.eventbus.Message
import org.vertx.groovy.platform.Verticle
import org.vertx.java.core.Future
import com.englishtown.promises.WhenFactory
import com.englishtown.vertx.promises.WhenVertx
import com.englishtown.promises.When
import com.englishtown.vertx.promises.impl.DefaultWhenVertx

class ApplicationVerticle extends Verticle {

    def start(Future startedResult) {
        def config = container.config

        When when = WhenFactory.createSync();
        WhenVertx whenContainer = new DefaultWhenVertx(vertx, when);
        ...

I get a runtime error when trying to run either the ApplicationVerticle or the entire module.
On line When when = WhenFactory.createSync(); I get this error:

java.lang.NoClassDefFoundError: javax/inject/Provider

I found your post suggesting adding this line to Vert.x langs.properties

groovy=com.englishtown~vertx-mod-hk2~1.7.0:com.englishtown.vertx.hk2.HK2VerticleFactory

Adding this line causes another error when I try to run the Verticle (it has no effect on the module):

java.lang.NoClassDefFoundError: org/vertx/groovy/platform/Verticle

What is the proper way of integrating vertx-when with a Vert.x application?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions