vertx-hk2 | Create Vert.x Verticles | Dependency Injection library
kandi X-RAY | vertx-hk2 Summary
kandi X-RAY | vertx-hk2 Summary
Create Vert.x Verticles with dependency injection using HK2
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Create a real Verticle
- Stops the service locator .
- Initialize the verticle .
- Create a Verticle
- Destroy the service locator .
- Returns the ServiceLocator instance .
- Adds the dependency .
- private static final
vertx-hk2 Key Features
vertx-hk2 Examples and Code Snippets
Community Discussions
Trending Discussions on vertx-hk2
QUESTION
I'm trying to build an application with Vert.x and HK2 extension for dependency injection. I however cannot seem to find any examples that show me the full picture.
Note that I am completely new to dependency injection.
I did as shown in this example, however I am getting a NoSuchMethodException when starting the application because it tries to access a default, parameterless constructor in the verticle class (SimpleVerticle), which does not exist.
In my build.gradle, the mainClassName is set to 'io.vertx.core.Launcher', and in the shadowJar manifest attributes, "Main-Verticle" is set to the SimpleVerticle as seen in the example.
Surely I'm missing something somewhere. Could anyone show me what I'm missing or point me to some up-to-date, full examples?
- Vert.x version: 3.4.2
- Vert.x HK2 version: 2.5.0
build.gradle:
...ANSWER
Answered 2017-Oct-17 at 12:05Looks to me like you need to actually create the ServiceLocator somewhere. Something like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vertx-hk2
You can use vertx-hk2 like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the vertx-hk2 component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page