Keycloak added custom endpooint [closed]

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!

New contributor

JDev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật