Giter VIP home page Giter VIP logo

Comments (9)

jameskleeh avatar jameskleeh commented on May 23, 2024 1

@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

from micronaut-acme.

jameskleeh avatar jameskleeh commented on May 23, 2024 1

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

from micronaut-acme.

msgilligan avatar msgilligan commented on May 23, 2024

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.

from micronaut-acme.

msgilligan avatar msgilligan commented on May 23, 2024

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.:

  • Application type = Micronaut Application
  • Micronaut Version = 2.5.6
  • Features = the default with just the one feature added (SSL/acme)
  • Language = Java 11
  • Build = Gradle
  • Test Framework = Spock

from micronaut-acme.

msgilligan avatar msgilligan commented on May 23, 2024

@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 where micronaut-cli.yml exists and acme 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)

from micronaut-acme.

msgilligan avatar msgilligan commented on May 23, 2024

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 ?

from micronaut-acme.

jameskleeh avatar jameskleeh commented on May 23, 2024

You can, whatever works. The documentation describes how to use the integration

from micronaut-acme.

msgilligan avatar msgilligan commented on May 23, 2024

Thanks @jameskleeh

from micronaut-acme.

msgilligan avatar msgilligan commented on May 23, 2024

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!

from micronaut-acme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.