Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't start the app with oauth2 - NoSuchMethodError #24

Closed
phi1ipp opened this issue Apr 6, 2019 · 3 comments
Closed

Can't start the app with oauth2 - NoSuchMethodError #24

phi1ipp opened this issue Apr 6, 2019 · 3 comments
Assignees

Comments

@phi1ipp
Copy link

phi1ipp commented Apr 6, 2019

Hi guys,

Trying to inject into my app oauth2 authentication based on your guide for OKTA, but ran into an issue trying to start the app

19:58:26.765 [main] ERROR io.micronaut.runtime.Micronaut - Error starting Micronaut server: io.micronaut.inject.annotation.DefaultAnnotationMetadata.registerAnnotationType(Lio/micronaut/core/annotation/AnnotationClassValue;)V
java.lang.NoSuchMethodError: io.micronaut.inject.annotation.DefaultAnnotationMetadata.registerAnnotationType(Lio/micronaut/core/annotation/AnnotationClassValue;)V
	at io.micronaut.security.oauth2.openid.configuration.$OpenIdConfigurationClient$InterceptedDefinitionClass$$AnnotationMetadata.<clinit>(Unknown Source)
	at io.micronaut.security.oauth2.openid.configuration.$OpenIdConfigurationClient$InterceptedDefinitionClass.<clinit>(Unknown Source)
	at java.base/java.lang.Class.forName0(Native Method)

Can you give an advice what I can check to fix the issue?

Here is my build.gradle

plugins {
    id "io.spring.dependency-management" version "1.0.6.RELEASE"
    id "com.github.johnrengelman.shadow" version "4.0.2"
    id "net.ltgt.apt-eclipse" version "0.18"
    id "net.ltgt.apt-idea" version "0.18"
}

ext {
    micronautVersion = '1.0.0.BUILD-SNAPSHOT'
}

apply plugin:"application"
apply plugin:"java"

version "0.1"
group "cloud.cert"

repositories {
    mavenLocal()
    mavenCentral()
    jcenter()
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}

dependencyManagement {
    imports {
        mavenBom "io.micronaut:micronaut-bom:${micronautVersion}"
    }
}

dependencies {
    annotationProcessor "io.micronaut:micronaut-inject-java"
    annotationProcessor "io.micronaut:micronaut-validation"
    annotationProcessor "io.micronaut:micronaut-security"
    compile "io.micronaut:micronaut-security-jwt"
    compile "io.micronaut:micronaut-inject"
    compile "io.micronaut:micronaut-validation"
    compile "io.micronaut:micronaut-runtime"
    compile "io.micronaut:micronaut-http-client"
    compile "io.micronaut.configuration:micronaut-hibernate-jpa"
    compile "io.micronaut.configuration:micronaut-hibernate-validator"
    compile "io.micronaut.configuration:micronaut-jdbc-hikari"
    compile "io.micronaut.configuration:micronaut-oauth2:$micronautVersion"
    compile "javax.annotation:javax.annotation-api"
    compile "io.micronaut:micronaut-http-server-netty"
    compile "io.micronaut:micronaut-views"
    compileOnly "io.micronaut:micronaut-inject-java"
    runtime "ch.qos.logback:logback-classic:1.2.3"
    runtime "com.h2database:h2"
    runtime "org.thymeleaf:thymeleaf:3.0.11.RELEASE"
    testCompile "junit:junit:4.12"
    testCompile "io.micronaut:micronaut-inject-java"
    testCompile "org.hamcrest:hamcrest-all:1.3"
}

shadowJar {
    mergeServiceFiles()
}

run.jvmArgs('-noverify', '-XX:TieredStopAtLevel=1')

mainClassName = "com.xxx.xxxx.Application"
tasks.withType(JavaCompile){
    options.encoding = "UTF-8"
    options.compilerArgs.add('-parameters')
}
@puneetbehl puneetbehl self-assigned this Apr 9, 2019
@puneetbehl
Copy link
Contributor

@phi1ipp micronaut-oauth2 is based on 1.1.0.BUILD-SNAPSHOT and it seems like you are using 1.0.0.BUILD-SNAPSHOT that might be the reason for java.lang.NoSuchMethodError. So, I would request you to please try again with Micronaut 1.1.0.BUILD-SNAPSHOT.

@jameskleeh
Copy link
Contributor

Closing due to a lack of feedback

@phi1ipp
Copy link
Author

phi1ipp commented Apr 17, 2019

Sorry guys, it took me a while to return back to this side project. With 1.1.0.BUILD-SNAPSHOT I have a missing dependency, so can't even build. The missing one is

    compile "io.micronaut.configuration:micronaut-oauth2:$micronautVersion"

I checked your repo it doesn't have 1.1.0

@jameskleeh jameskleeh transferred this issue from micronaut-projects/micronaut-oauth2 Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants