quickstart
quickstart copied to clipboard
[WFLY-16472] update jaxrs-jwt quickstart
https://issues.redhat.com/browse/WFLY-16472
- update cli script to work with latest server.
- remove obsoleted
resteasy-jaxrs
and also addjakarta.activation
to fix below warning seen on client side:
Jun 13, 2022 12:12:09 PM org.jboss.resteasy.plugins.providers.RegisterBuiltin registerProviders
WARN: RESTEASY002145: NoClassDefFoundError: Unable to load builtin provider org.jboss.resteasy.plugins.providers.DataSourceProvider from jar:file:/Users/chaowan/.m2/repository/org/jboss/resteasy/resteasy-core/4.7.4.Final/resteasy-core-4.7.4.Final.jar!/META-INF/services/javax.ws.rs.ext.Providers
java.lang.NoClassDefFoundError: javax/activation/DataSource
at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3137)
at java.base/java.lang.Class.getConstructors(Class.java:1943)
at org.jboss.resteasy.spi.util.PickConstructor.pickSingletonConstructor(PickConstructor.java:30)
at org.jboss.resteasy.core.providerfactory.Utils.createConstructorInjector(Utils.java:111)
at org.jboss.resteasy.core.providerfactory.Utils.createProviderInstance(Utils.java:100)
at org.jboss.resteasy.core.providerfactory.CommonProviders.processProviderContracts(CommonProviders.java:87)
at org.jboss.resteasy.core.providerfactory.ClientHelper.processProviderContracts(ClientHelper.java:104)
at org.jboss.resteasy.core.providerfactory.ResteasyProviderFactoryImpl.processProviderContracts(ResteasyProviderFactoryImpl.java:841)
at org.jboss.resteasy.core.providerfactory.ResteasyProviderFactoryImpl.registerProvider(ResteasyProviderFactoryImpl.java:829)
at org.jboss.resteasy.core.providerfactory.ResteasyProviderFactoryImpl.registerProvider(ResteasyProviderFactoryImpl.java:816)
at org.jboss.resteasy.plugins.providers.RegisterBuiltin.registerProviders(RegisterBuiltin.java:109)
at org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(RegisterBuiltin.java:74)
at org.jboss.resteasy.plugins.providers.RegisterBuiltin.getClientInitializedResteasyProviderFactory(RegisterBuiltin.java:54)
at org.jboss.resteasy.client.jaxrs.internal.ResteasyClientBuilderImpl.getProviderFactory(ResteasyClientBuilderImpl.java:377)
at org.jboss.resteasy.client.jaxrs.internal.ResteasyClientBuilderImpl.build(ResteasyClientBuilderImpl.java:395)
at org.jboss.resteasy.client.jaxrs.internal.ResteasyClientBuilderImpl.build(ResteasyClientBuilderImpl.java:47)
at javax.ws.rs.client.ClientBuilder.newClient(ClientBuilder.java:112)
at org.jboss.quickstarts.jaxrsjwt.client.JwtRestClient.test(JwtRestClient.java:70)
at org.jboss.quickstarts.jaxrsjwt.client.JwtRestClient.main(JwtRestClient.java:50)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.ClassNotFoundException: javax.activation.DataSource
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:476)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 26 more
@fjuma please review.
@fjuma Just had this error when I tried to use "securityContext.getCallerPrincipal()".
I needed to add a default jacc policy.
https://stackoverflow.com/questions/71069366/wildlfy-26-java-lang-illegalargumentexception-unknown-handler-key-at-javax-sec
@prince-jn Just FYI, there's a more recent PR that includes changes to the jax-rs quickstart here:
https://github.com/wildfly/quickstart/pull/585/commits/b30845019150f37beb146baf1cbe9917d1a74005
@soul2zimate @fjuma is this still needed?
@emmartins These changes were already incorporated via https://github.com/wildfly/quickstart/pull/585.
@fjuma got it, thanks