I am trying to build a jar that can execute simple keycloak configuration. I am using the keycloak-admin-client and newest keycloak version 22.0.5. However after trying many different options in dependecies and even the quarkus-keycloak-admin-client. I constantly get stuck on;
Exception in thread "main" jakarta.ws.rs.ProcessingException: RESTEASY004655: Unable to invoke request: jakarta.ws.rs.ProcessingException: RESTEASY003215: could not find writer for content-type application/x-www-form-urlencoded type: jakarta.ws.rs.core.Form$1
I know that spring 2 > 3 also has some javax to jakarta migration troubles, but In this I do not have a way to solve this. What is this writer I am looking for and am I understanding it correctly that it goes wrong at the constructor of Form?
public Form(MultivaluedMap<String, String> store) {
this.parameters = store;
}
The java version is openjdk 17.0.9 LTS The commands I run are simply mvn clean package and java -jar jarfile The current pom.xml I have is;
<parent>
<groupId>config.keycloak</groupId>
<artifactId>keycloak-config-tryout</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>java-configuration</artifactId>
<properties>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<resteasy.version>6.2.6.Final</resteasy.version>
<keycloak.version>22.0.5</keycloak.version>
<maven.jar.plugin.version>3.3.0</maven.jar.plugin.version>
<lombok.version>1.18.26</lombok.version>
</properties>
<dependencies>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-client</artifactId>
<version>${keycloak.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>${resteasy.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson2-provider</artifactId>
<version>${resteasy.version}</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-core</artifactId>
<version>${keycloak.version}</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-services</artifactId>
<version>${keycloak.version}</version>
</dependency>
<!--Tooling-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven.jar.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>${maven.shade.plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>config.keycloak.KeycloakConfigurationApplication</mainClass>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/services/javax.ws.rs.ext.Providers</resource>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<outputFile>${project.build.directory}/${project.artifactId}.jar</outputFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Did you try changing from
to
Both files were renamed in resteasy-client and resteasy-jackson2-provider from
javax.ws.rs.ext.Providers
tojakarta.ws.rs.ext.Providers
See here for resteasy-client and here for resteasy-jackson2-provider