1

I'm trying to produce a bootable jar with Undertow + Resteasy + Jackson2 with those dependencies in my pom.xml:

<dependency>
    <groupId>org.jboss.resteasy</groupId>
    <artifactId>resteasy-undertow</artifactId>
    <version>${resteasy.version}</version>
</dependency>
<dependency>
    <groupId>org.jboss.resteasy</groupId>
    <artifactId>resteasy-cdi</artifactId>
    <version>${resteasy.version}</version>
</dependency>
<dependency>
    <groupId>org.jboss.resteasy</groupId>
    <artifactId>resteasy-jackson2-provider</artifactId>
    <version>${resteasy.version}</version>
</dependency>

when I use 3.* versions of resteasy, I can start the WebServer this way:

public static UndertowJaxrsServer startServer() {
    server = new UndertowJaxrsServer()
              .deploy(MyOwnApplication.class) // replace this with .deployOldStyle(MyOwnApplication.class) for versions grater than 4.0 of resteasy
              .start(
                      Undertow.builder()
                            .addHttpListener(Integer.parseInt(SERVER_PORT), SERVER_HOST)
              );
    return server;
}

but, after upgrading resteasy from v3.0.9.Final to v4.6.0.Final, this service does not work (always produces errors 405 - method not allowed, on every POST request). The solution I found was to replace the deploy method with deployOldStyle (present only in versions grater than 4 of reasteasy), but it seems to be undocumented.

Can anybody explain me how the deploy method has changed and why? Should I adapt some other part of my code and continue using the deploy method?

Thanks

  • I don't know either but finding out about the existence of method `deployOldStyle` made my day much nicer. Thank you! – chalda Oct 20 '21 at 14:35

0 Answers0