keycloak.version = 21.1.1
here logs as start up docker container with registration new resource
2024-07-17 15:05:45,949 INFO [com.mtsmda.CustomRealmResourceProviderFactory] (build-9) CustomRealmResourceProviderFactory.getId —–
2024-07-17 15:05:45,950 INFO [com.mtsmda.CustomRealmResourceProviderFactory] (build-9) CustomRealmResourceProviderFactory.getId —–
2024-07-17 15:05:45,955 INFO [com.mtsmda.CustomRealmResourceProviderFactory] (build-9) CustomRealmResourceProviderFactory.getId —–
2024-07-17 15:05:45,955 WARN [org.keycloak.services] (build-9) KC-SERVICES0047: custom-endpoint (com.mtsmda.CustomRealmResourceProviderFactory) is implementing the internal SPI realm-restapi-extension. This SPI is internal and may change without notice
2024-07-17 15:05:45,955 INFO [com.mtsmda.CustomRealmResourceProviderFactory] (build-9) CustomRealmResourceProviderFactory.getId —–
2024-07-17 15:05:46,314 WARN [org.keycloak.services] (build-9) KC-SERVICES0047: groups-protocol-mapper (com.mtsmda.GroupsProtocolMapper) is implementing the internal SPI protocol-mapper. This SPI is internal and may change without notice
2024-07-17 15:05:46,579 WARN [io.quarkus.arc.deployment.SplitPackageProcessor] (build-21) Detected a split package usage which is considered a bad practice and should be avoided. Following packages were detected in multiple archives:
- “com.mtsmda” found in [/opt/keycloak/lib/../providers/custom_endpoint.jar, /opt/keycloak/lib/../providers/keycloak-groups-protocol-mapper.jar]
2024-07-17 15:05:47,762 INFO [com.mtsmda.CustomRealmResourceProviderFactory] (build-9) CustomRealmResourceProviderFactory.getId —–
registered success
2024-07-17 15:08:34,652 INFO [com.mtsmda.endpoint.CustomEndpointResource] (executor-thread-0) CUSTOM RealmResourceProvider.getResource
2024-07-17 15:08:34,657 ERROR [org.keycloak.services.error.KeycloakErrorHandler] (executor-thread-0) Uncaught server error: org.jboss.resteasy.spi.InternalServerErrorException: RESTEASY003815: Subresource for target class has no jax-rs annotations.: com.mtsmda.endpoint.CustomEndpointResource
at org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:170)
at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:141)
at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:32)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:492)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:261)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:161)
at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:164)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:247)
at io.quarkus.resteasy.runtime.standalone.RequestDispatcher.service(RequestDispatcher.java:73)
at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.dispatch(VertxRequestHandler.java:151)
at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.handle(VertxRequestHandler.java:82)
at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.handle(VertxRequestHandler.java:42)
at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1284)
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:173)
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:140)
at io.quarkus.vertx.http.runtime.StaticResourcesRecorder$2.handle(StaticResourcesRecorder.java:84)
at io.quarkus.vertx.http.runtime.StaticResourcesRecorder$2.handle(StaticResourcesRecorder.java:71)
at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1284)
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:173)
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:140)
at io.quarkus.vertx.http.runtime.VertxHttpRecorder$6.handle(VertxHttpRecorder.java:430)
at io.quarkus.vertx.http.runtime.VertxHttpRecorder$6.handle(VertxHttpRecorder.java:408)
at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1284)
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:173)
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:140)
at org.keycloak.quarkus.runtime.integration.web.QuarkusRequestFilter.lambda$createBlockingHandler$0(QuarkusRequestFilter.java:82)
at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:576)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)
2024-07-17 15:08:34,658 INFO [com.mtsmda.endpoint.CustomEndpointResource] (executor-thread-0) CUSTOM RealmResourceProvider.close
Problem is here –
Uncaught server error: org.jboss.resteasy.spi.InternalServerErrorException: RESTEASY003815: Subresource for target class has no jax-rs annotations.: com.mtsmda.endpoint.CustomEndpointResource
org.jboss.resteasy.resteasy_jaxrs.i18n.Messages_$bundle#subresourceHasNoJaxRsAnnotations$str
problem here –
if (!GetRestful.isSubResourceClass(clazz))
{
String msg = Messages.MESSAGES.subresourceHasNoJaxRsAnnotations(clazz.getName());
throw new InternalServerErrorException(msg);
}
org.jboss.resteasy.util.GetRestful#isSubResourceClass
in class level shouble be – javax.ws.rs.Path
now in my class – i do not set this annotation(I did as here – https://github.com/dasniko/keycloak-extensions-demo/blob/main/rest-endpoint/src/main/java/dasniko/keycloak/resource/MyResourceProvider.java)
If i right understand I should set in class level that – javax.ws.rs.Path annotation
Can you please give me your expert advice? thanks!
JDev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.