Error in Test Case After Upgrading to 1.13.1 with Swagger

722 views
Skip to first unread message

KimJohn Quinn

unread,
Apr 7, 2021, 11:15:40 PM4/7/21
to Quarkus Development mailing list
I just upgraded to 1.13.1 and my test cases, which are just stubs with nothing in them except a single test that prints hello world, started to fail.  What is odd is that it is only happening in my "services," other tests are running fine.

I get this error:

java.lang.RuntimeException:
java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.swaggerui.deployment.SwaggerUiProcessor#getSwaggerUiFinalDestination threw an exception: java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.toString()" because "replacement" is null
        at java.base/java.lang.String.replace(String.java:2159)
        at io.quarkus.deployment.util.WebJarUtil.insertVariables(WebJarUtil.java:348)
        at io.quarkus.deployment.util.WebJarUtil.copyResourcesForDevOrTest(WebJarUtil.java:150)
        at io.quarkus.deployment.util.WebJarUtil.copyResourcesForDevOrTest(WebJarUtil.java:109)
        at io.quarkus.swaggerui.deployment.SwaggerUiProcessor.getSwaggerUiFinalDestination(SwaggerUiProcessor.java:106)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:920)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2415)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
        at java.base/java.lang.Thread.run(Thread.java:832)
        at org.jboss.threads.JBossThread.run(JBossThread.java:501)

Caused by: java.lang.RuntimeException:
io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.swaggerui.deployment.SwaggerUiProcessor#getSwaggerUiFinalDestination threw an exception: java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.toString()" because "replacement" is null
        at java.base/java.lang.String.replace(String.java:2159)
        at io.quarkus.deployment.util.WebJarUtil.insertVariables(WebJarUtil.java:348)
        at io.quarkus.deployment.util.WebJarUtil.copyResourcesForDevOrTest(WebJarUtil.java:150)
        at io.quarkus.deployment.util.WebJarUtil.copyResourcesForDevOrTest(WebJarUtil.java:109)
        at io.quarkus.swaggerui.deployment.SwaggerUiProcessor.getSwaggerUiFinalDestination(SwaggerUiProcessor.java:106)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:920)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2415)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
        at java.base/java.lang.Thread.run(Thread.java:832)
        at org.jboss.threads.JBossThread.run(JBossThread.java:501)

Caused by: io.quarkus.builder.BuildException:
Build failure: Build failed due to errors
        [error]: Build step io.quarkus.swaggerui.deployment.SwaggerUiProcessor#getSwaggerUiFinalDestination threw an exception: java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.toString()" because "replacement" is null
        at java.base/java.lang.String.replace(String.java:2159)
        at io.quarkus.deployment.util.WebJarUtil.insertVariables(WebJarUtil.java:348)
        at io.quarkus.deployment.util.WebJarUtil.copyResourcesForDevOrTest(WebJarUtil.java:150)
        at io.quarkus.deployment.util.WebJarUtil.copyResourcesForDevOrTest(WebJarUtil.java:109)
        at io.quarkus.swaggerui.deployment.SwaggerUiProcessor.getSwaggerUiFinalDestination(SwaggerUiProcessor.java:106)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:920)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2415)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
        at java.base/java.lang.Thread.run(Thread.java:832)
        at org.jboss.threads.JBossThread.run(JBossThread.java:501)

Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.toString()" because "replacement" is null

The test cases failing look like this:

@Slf4j
@Tag("unit")
@QuarkusTest
@Disabled
public class QueryResourceTest {

    @Test
    @Disabled
    public void should_run() {
        log.debug("I am running -------------------------------");
    }

    @Test
    @Disabled
    public void testHelloEndpoint() {
        given()
          .when().get("/hello")
          .then()
             .statusCode(200)
             .body(is("Hello RESTEasy Reactive"));
    }

}
@Tag("unit")
@QuarkusTest
@Disabled
public class QueryResourceTest {

    @Test
    @Disabled
    public void should_run() {
        log.debug("I am running -------------------------------");
    }

    @Test
    @Disabled
    public void testHelloEndpoint() {
        given()
          .when().get("/hello")
          .then()
             .statusCode(200)
             .body(is("Hello RESTEasy Reactive"));
    }

}

Phillip Kruger

unread,
Apr 8, 2021, 12:20:00 AM4/8/21
to KimJohn Quinn, Quarkus Development mailing list
Can you share a small reproducer?

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/ed333b7d-d767-4733-8575-01e9da4ab829n%40googlegroups.com.

KimJohn Quinn

unread,
Apr 8, 2021, 7:39:12 PM4/8/21
to Phillip Kruger, Quarkus Development mailing list
Hello Phillip.

Attached is a reproducer as close as possible - for the most part I just killed all the code but the test.  I think it might be helpful to include the Maven POM configurations in their entirety too in case it is something I am doing there.

These are some things I have been doing and/or tested:
  • I was refactoring the "application.yml" files with the intent of having those values merged into the final service (in this case "client").

  • Downgraded back to 1.13.0 - this works fine.  The below shows the output of the test running fine.

  • Upgraded back to 1.13.1 - this fails with the error above. @Disable'ing the test gets past the error of course.

  • Double-checked I was running the actual codebase the same as the reproducer (in one I used JUnit5 tags).  

  • Reran the reproducer using the same steps above (downgrading it to 1.13.0 works).

  • In both cases, ignoring the test, it appears I can run the service and even Swagger without issue.
From the looks of it, it looks like Swagger is looking for the base path or something and that is not there for whatever reason. I can trace/dig into it more if needed...

Let me know if I should provide anything else.

Thanks.

KJQ


Output running using 1.13.0:
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running io.services.client.ClientResourceTest
Apr 08, 2021 7:28:15 PM org.jboss.threads.Version <clinit>
INFO: JBoss Threads version 3.2.0.Final
Apr 08, 2021 7:28:17 PM org.jboss.threads.Version <clinit>
INFO: JBoss Threads version 3.2.0.Final
Apr 08, 2021 7:28:17 PM io.quarkus.bootstrap.runner.Timing printStartupTime
INFO: Quarkus 1.13.0.Final on JVM started in 1.815s. Listening on: http://0.0.0.0:8081
Apr 08, 2021 7:28:17 PM io.quarkus.bootstrap.runner.Timing printStartupTime
INFO: Profile test activated.
Apr 08, 2021 7:28:17 PM io.quarkus.bootstrap.runner.Timing printStartupTime
INFO: Installed features: [cdi, config-yaml, mongodb-client, mongodb-panache, mutiny, resteasy-reactive, resteasy-reactive-jackson, smallrye-context-propagation, smallrye-openapi, swagger-ui, vertx]
2021-04-08 19:28:17,712 DEBUG [io.log.ser.cli.ClientResourceTest] (main) I am running -------------------------------
[WARNING] Tests run: 2, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 4.68 s - in io.services.client.ClientResourceTest
Apr 08, 2021 7:28:17 PM io.quarkus.bootstrap.runner.Timing printStopTime
INFO: Quarkus stopped in 0.023s

reproducer.zip

Phillip Kruger

unread,
Apr 9, 2021, 3:20:09 AM4/9/21
to KimJohn Quinn, Quarkus Development mailing list
I can confirm that this is a bug, I am not too sure what changes between 1.13.0 and 1.13.1 that cause this, I am still investigating. I'll do a fix that should be in 2.0 and if there is a 1.13.2 / 1.14.0 we can backport

Phillip Krüger

unread,
Apr 9, 2021, 4:31:53 AM4/9/21
to Quarkus Development mailing list
Reply all
Reply to author
Forward
0 new messages