Closed yissachar closed 3 years ago
I have verified that mn create-key
is unavailable in the (GraalVM-native-compiled?) mn
command installed on macOS via sdkman
:
$ sdk current micronaut
Using micronaut version 2.5.6
$ mn create-key
Unmatched argument at index 0: 'create-key'
Did you mean: create-app or create-cli-app or create-grpc-app?
I should also mention that the behavior of mn feature-diff --features acme
is very weird when using the mn
command installed by sdkman
.
I created a fresh project with Micronaut Launch.
When I try to run with Gradle I get:
./gradlew run
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :run FAILED
__ __ _ _
| \/ (_) ___ _ __ ___ _ __ __ _ _ _| |_
| |\/| | |/ __| '__/ _ \| '_ \ / _` | | | | __|
| | | | | (__| | | (_) | | | | (_| | |_| | |_
|_| |_|_|\___|_| \___/|_| |_|\__,_|\__,_|\__|
Micronaut (v2.5.6)
17:14:30.680 [main] ERROR io.micronaut.runtime.Micronaut - Error starting Micronaut server: Error instantiating bean of type [io.micronaut.acme.services.AcmeService]
Message: Validation failed for bean definition [io.micronaut.acme.AcmeConfiguration]
List of constraint violations:[
acmeServer - must not be null
accountKey - must not be blank
domainKey - must not be null
domains - must not be null
domains - must not be empty
acmeServer - must not be blank
domainKey - must not be blank
accountKey - must not be null
]
Path Taken: new AcmeCertRefresherTask([AcmeService acmeService],AcmeConfiguration acmeConfiguration) --> new AcmeService(ApplicationEventPublisher eventPublisher,[AcmeConfiguration acmeConfiguration],ResourceResolver resourceResolver,TaskScheduler taskScheduler)
io.micronaut.context.exceptions.BeanInstantiationException: Error instantiating bean of type [io.micronaut.acme.services.AcmeService]
Message: Validation failed for bean definition [io.micronaut.acme.AcmeConfiguration]
List of constraint violations:[
acmeServer - must not be null
accountKey - must not be blank
domainKey - must not be null
domains - must not be null
domains - must not be empty
acmeServer - must not be blank
domainKey - must not be blank
accountKey - must not be null
]
Path Taken: new AcmeCertRefresherTask([AcmeService acmeService],AcmeConfiguration acmeConfiguration) --> new AcmeService(ApplicationEventPublisher eventPublisher,[AcmeConfiguration acmeConfiguration],ResourceResolver resourceResolver,TaskScheduler taskScheduler)
at io.micronaut.validation.validator.DefaultValidator.failOnError(DefaultValidator.java:1774)
at io.micronaut.validation.validator.DefaultValidator.validateBean(DefaultValidator.java:1725)
at io.micronaut.inject.ValidatedBeanDefinition.validate(ValidatedBeanDefinition.java:44)
at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:2045)
at io.micronaut.context.DefaultBeanContext.createAndRegisterSingletonInternal(DefaultBeanContext.java:2768)
at io.micronaut.context.DefaultBeanContext.createAndRegisterSingleton(DefaultBeanContext.java:2754)
at io.micronaut.context.DefaultBeanContext.getBeanForDefinition(DefaultBeanContext.java:2425)
at io.micronaut.context.DefaultBeanContext.getBeanInternal(DefaultBeanContext.java:2399)
at io.micronaut.context.DefaultBeanContext.getBean(DefaultBeanContext.java:1264)
at io.micronaut.context.AbstractBeanDefinition.getBeanForConstructorArgument(AbstractBeanDefinition.java:1014)
at io.micronaut.acme.services.$AcmeServiceDefinition.build(Unknown Source)
at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:1979)
at io.micronaut.context.DefaultBeanContext.createAndRegisterSingletonInternal(DefaultBeanContext.java:2768)
at io.micronaut.context.DefaultBeanContext.createAndRegisterSingleton(DefaultBeanContext.java:2754)
at io.micronaut.context.DefaultBeanContext.getBeanForDefinition(DefaultBeanContext.java:2425)
at io.micronaut.context.DefaultBeanContext.getBeanInternal(DefaultBeanContext.java:2399)
at io.micronaut.context.DefaultBeanContext.getBean(DefaultBeanContext.java:1264)
at io.micronaut.context.AbstractBeanDefinition.getBeanForConstructorArgument(AbstractBeanDefinition.java:1014)
at io.micronaut.acme.background.$AcmeCertRefresherTaskDefinition.build(Unknown Source)
at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:1979)
at io.micronaut.context.DefaultBeanContext.createAndRegisterSingletonInternal(DefaultBeanContext.java:2768)
at io.micronaut.context.DefaultBeanContext.createAndRegisterSingleton(DefaultBeanContext.java:2754)
at io.micronaut.context.DefaultBeanContext.getBeanForDefinition(DefaultBeanContext.java:2425)
at io.micronaut.context.DefaultBeanContext.getBeanInternal(DefaultBeanContext.java:2399)
at io.micronaut.context.DefaultBeanContext.getBean(DefaultBeanContext.java:732)
at io.micronaut.context.DefaultBeanContext$BeanExecutionHandle.getTarget(DefaultBeanContext.java:3389)
at io.micronaut.context.DefaultBeanContext$BeanExecutionHandle.invoke(DefaultBeanContext.java:3410)
at io.micronaut.aop.chain.AdapterIntroduction.intercept(AdapterIntroduction.java:81)
at io.micronaut.aop.chain.MethodInterceptorChain.proceed(MethodInterceptorChain.java:96)
at io.micronaut.acme.background.AcmeCertRefresherTask$ApplicationEventListener$onStartup1$Intercepted.onApplicationEvent(Unknown Source)
at io.micronaut.context.DefaultBeanContext.notifyEventListeners(DefaultBeanContext.java:1326)
at io.micronaut.context.DefaultBeanContext.publishEvent(DefaultBeanContext.java:1311)
at io.micronaut.http.server.netty.NettyHttpServer.fireStartupEvents(NettyHttpServer.java:512)
at io.micronaut.http.server.netty.NettyHttpServer.start(NettyHttpServer.java:355)
at io.micronaut.http.server.netty.NettyHttpServer.start(NettyHttpServer.java:114)
at io.micronaut.runtime.Micronaut.lambda$start$2(Micronaut.java:77)
at java.base/java.util.Optional.ifPresent(Optional.java:178)
at io.micronaut.runtime.Micronaut.start(Micronaut.java:75)
at io.micronaut.runtime.Micronaut.run(Micronaut.java:311)
at io.micronaut.runtime.Micronaut.run(Micronaut.java:297)
at com.example.Application.main(Application.java:8)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':run'.
> Process 'command '/Users/sean/.sdkman/candidates/java/16.0.1.hs-adpt/bin/java'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 7s
3 actionable tasks: 1 executed, 2 up-to-date
I'm on macOS Big Sur (11.3.1) with sdk use java 11.0.11.hs-adpt
and I chose the minimal set of options with Launch, e.g.:
@msgilligan The acme integration requires configuration to work. You can't simply run a default app
Regarding the CLI, mn create-key
is only available in a folder where micronaut-cli.yml
exists and acme
is listed as one of the features in the file
@msgilligan The acme integration requires configuration to work. You can't simply run a default app
I will try adding the configuration to the "demo" app.
Regarding the CLI,
mn create-key
is only available in a folder wheremicronaut-cli.yml
exists andacme
is listed as one of the features in the file
I used the mn feature-diff --features acme
and tried to add the recommended changes but it didn't help. Will the GraalVM-native-compiled mn
tool dynamically add commands (e.g. create-key
) from the current project? (I thought GraalVM native-image didn't support that)
I used the mn feature-diff --features acme and tried to add the recommended changes but it didn't help. Will the GraalVM-native-compiled mn tool dynamically add commands (e.g. create-key) from the current project? (I thought GraalVM native-image didn't support that)
Yes. The commands aren't dynamically added, but are only enabled under certain conditions
OK, I'll poke at it some more and report back.
Maybe I should try the example as described here: https://github.com/micronaut-projects/micronaut-acme/tree/master/examples/hello-world-acme ?
You can, whatever works. The documentation describes how to use the integration
Thanks @jameskleeh
FYI, I have micronaut-acme
integration working with my Micronaut 2.5.6 application -- I had to switch from a Graal native-image version of the app to a Hotspot JDK version because of Issue #154 -- but my app seems to be correctly acquiring a cert via ACME!
Thanks for reporting an issue, please review the task list below before submitting the issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed.
NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (https://stackoverflow.com/tags/micronaut) or Gitter (https://gitter.im/micronautfw/). DO NOT use the issue tracker to ask questions.
Task List
Steps to Reproduce
mn create-key -n foobar
Expected Behaviour
A keypair should be created
Actual Behaviour
Micronaut Starter complains that the create-key command does not exist
Environment Information