[keycloak-user] How i can use keycloak-admin-client in Apache Tomcat

Sebastien Blanc sblanc at redhat.com
Fri Dec 2 03:12:03 EST 2016


The admin client is just a wrapper around Resteasy client so it should be
pretty agnostic of the application server. Is that the complete stacktrace
? Do you have maybe simple app on github to share ?


On Thu, Dec 1, 2016 at 5:03 PM, <tecnologia at growingup.com.co> wrote:

> Additional info:
>
> Dependencies added to my project:
>
> <dependency>
>                         <groupId>org.keycloak</groupId>
>                         <artifactId>keycloak-admin-client</artifactId>
>                         <version>2.4.0.Final</version>
>                 </dependency>
>
>                 <dependency>
>                         <groupId>org.jboss.resteasy</groupId>
>                         <artifactId>resteasy-jaxrs</artifactId>
>                         <version>3.0.19.Final</version>
>                 </dependency>
>
>                 <dependency>
>                         <groupId>org.jboss.resteasy</groupId>
>                         <artifactId>resteasy-client</artifactId>
>                         <version>3.0.19.Final</version>
>                 </dependency>
>
>                 <dependency>
>                         <groupId>org.jboss.resteasy</groupId>
>                         <artifactId>resteasy-jackson2-
> provider</artifactId>
>                         <version>3.0.19.Final</version>
>                 </dependency>
>
>
> When i test Keycloak connection:
>
> String authServer = UriUtils.getOrigin("http://localhost:8080") + "/auth";
>
> Keycloak keycloak = Keycloak.getInstance(authServer, "example",
> "examples-admin-client", "password", "examples-admin-client", "password");
> ClientsResource clients = keycloak.realm("example").clients();
>
>
> An exception is thrown:
>
> Dec 01, 2016 10:50:32 AM org.apache.catalina.core.StandardWrapperValve
> invoke
> SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path
> [/sis] threw exception [Error processing webservice request] with root cause
> java.lang.NullPointerException
>         at org.apache.openejb.server.cxf.rs.CxfRsHttpListener.doInvoke(
> CxfRsHttpListener.java:251)
>         at org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(
> CXFJAXRSFilter.java:94)
>         at org.apache.catalina.core.ApplicationFilterChain.
> internalDoFilter(ApplicationFilterChain.java:192)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:165)
>         at org.apache.tomcat.websocket.server.WsFilter.doFilter(
> WsFilter.java:52)
>
>
>
> -----Mensaje original-----
> De: keycloak-user-bounces at lists.jboss.org [mailto:keycloak-user-bounces@
> lists.jboss.org] En nombre de tecnologia at growingup.com.co
> Enviado el: jueves, 01 de diciembre de 2016 10:47
> Para: 'keycloak-user'
> Asunto: [keycloak-user] How i can use keycloak-admin-client in Apache
> Tomcat
>
> Hello,
>
> How i can use keycloak-admin-client in Apache TomEE 7.0.2?
>
> Below the specifications:
>
>
> Apache TomEE 7.0.2 -> Apache Tomcat 8.5.6
>
> JAX-RS - Apache CXF (I understand that resteasy is needed)
>
> JAX-WS - Apache CXF
>
>
>
> keycloak-admin-client ¿Does it only work on a wildfly server?
>
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user
>
>
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user
>


More information about the keycloak-user mailing list