2

I try to run project with gretty. It throws exception:

10:47:39 WARN  Failed startup of context o.a.g.JettyWebAppContext@52045dbe{/,file:/C:/IdeaProjects/example-tab/build/inplaceWebapp/,STARTING}
java.lang.RuntimeException: Error scanning entry module-info.class from jar file:/C:/Users/user1/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.10.0/fec5797a55b786184a537abd39c3fa1449d752d6/log4j-api-2.10.0.jar
    at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:913) ~[jetty-annotations-9.2.24.v20180105.jar:9.2.24.v20180105]
    at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:831) ~[jetty-annotations-9.2.24.v20180105.jar:9.2.24.v20180105]
    at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:164) ~[jetty-annotations-9.2.24.v20180105.jar:9.2.24.v20180105]
    at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:549) ~[jetty-annotations-9.2.24.v20180105.jar:9.2.24.v20180105]
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) ~[jetty-util-9.2.24.v20180105.jar:9.2.24.v20180105]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) ~[jetty-util-9.2.24.v20180105.jar:9.2.24.v20180105]
    at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_171]
Caused by: java.lang.UnsupportedOperationException: null
    at org.objectweb.asm.ClassVisitor.visitModule(ClassVisitor.java:129) ~[asm-6.1.1.jar:na]
    at org.objectweb.asm.ClassReader.readModule(ClassReader.java:667) ~[asm-6.1.1.jar:na]
    at org.objectweb.asm.ClassReader.accept(ClassReader.java:503) ~[asm-6.1.1.jar:na]
    at org.objectweb.asm.ClassReader.accept(ClassReader.java:355) ~[asm-6.1.1.jar:na]
    at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:974) ~[jetty-annotations-9.2.24.v20180105.jar:9.2.24.v20180105]
    at org.eclipse.jetty.annotations.AnnotationParser.parseJarEntry(AnnotationParser.java:956) ~[jetty-annotations-9.2.24.v20180105.jar:9.2.24.v20180105]
    at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:909) ~[jetty-annotations-9.2.24.v20180105.jar:9.2.24.v20180105]
    ... 6 common frames omitted

gradle:

plugins {
    id 'java'
    id 'war'
    id "org.gretty" version "2.2.0"
}
group 'ru.example'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'

ext {
    SPRING_VERSION = '5.1.0.RELEASE'
    JUNIT_VERSION = '5.3.1'
    JACKSON_VERSION = '2.9.7'
}

repositories {

    mavenCentral()
    jcenter()

    maven {
        url 'https://oss.sonatype.org/content/repositories/releases/'
    }
}

gretty {
    springBootVersion = '2.0.5.RELEASE'
    contextPath = "/"
}

dependencies {
    annotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.2'
    compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.2'
    compileOnly group: 'com.google.appengine', name: 'appengine-endpoints-deps', version: '1.9.65'
    compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
    compile group: 'org.springframework', name: 'spring-webmvc', version: SPRING_VERSION
    compile group: 'org.springframework', name: 'spring-web', version: SPRING_VERSION
    compile group: 'org.springframework', name: 'spring-jdbc', version: SPRING_VERSION
    compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: '2.0.5.RELEASE'
    compile group: 'com.mchange', name: 'c3p0', version: '0.9.5.2'
    compile group: 'com.zaxxer', name: 'HikariCP', version: '3.2.0'
    compile group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.3.0'
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: JACKSON_VERSION
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: JACKSON_VERSION
    compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.6'
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.7'
    testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: JUNIT_VERSION
    testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: JUNIT_VERSION
    testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.3.1'
    testCompile group: 'org.mockito', name: 'mockito-core', version: '2.22.0'
    testCompile group: 'org.springframework', name: 'spring-test', version: SPRING_VERSION
    testCompile group: 'org.hamcrest', name: 'hamcrest-library', version: '1.3'
    testCompile group: 'com.jayway.jsonpath', name: 'json-path-assert', version: '2.4.0'
}

test {
    useJUnitPlatform()
}

Scanning internet not helped. Please advice how to run it correctly. I had problems with downloading dependencies from jcenter(), may be, problem is here.

Validator write that my question have mostly code, but I have no Idea what to add to my explain, than, my apologies, I'll quote Steve Jobs:

“You can’t connect the dots looking forward; you can only connect them looking backward. So you have to trust that the dots will somehow connect in your future.”

1

1 Answer 1

9

You introduced a JEP-238 Jar file into your project: log4j-api-2.10.0.jar

Support for JEP-238 Jar files on any Java Runtime (doesn't matter if it's Java 7, Java 8, Java 9, Java 10, Java 11, or even the new Java 12-ea releases) was first introduced in Jetty 9.4.9.

You have 2 options:

  1. Don't use JEP-238 Jar Files in your project.
  2. Upgrade to Jetty 9.4.9 (or newer) to have support for JEP-238 Jar Files.

See past answers:

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.