<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Happy to help and glad it worked! &nbsp;Adding the group back in case this would help someone else searching the list.<div class=""><br class=""></div><div class="">Best,</div><div class="">Scott</div><div class=""><br class=""></div><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Scott Rossillo</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Smartling | Senior Software Engineer</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:srossillo@smartling.com" class="">srossillo@smartling.com</a></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
</div>
</div></div><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 6, 2016, at 8:42 PM, Crafton Williams &lt;<a href="mailto:crafton.williams@qut.edu.au" class="">crafton.williams@qut.edu.au</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div id="divtagdefaultwrapper" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 12pt; background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif;" class=""><div style="margin-top: 0px; margin-bottom: 0px;" class="">Hi Scott, this works perfectly! Thanks for your response.</div></div><hr tabindex="-1" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline-block; width: 1207.359375px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""></span><div id="divRplyFwdMsg" dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><font face="Calibri, sans-serif" style="font-size: 11pt;" class=""><b class="">From:</b><span class="Apple-converted-space">&nbsp;</span>Scott Rossillo &lt;<a href="mailto:srossillo@smartling.com" class="">srossillo@smartling.com</a>&gt;<br class=""><b class="">Sent:</b><span class="Apple-converted-space">&nbsp;</span>07 September 2016 10:32:30<br class=""><b class="">To:</b><span class="Apple-converted-space">&nbsp;</span>Crafton Williams; <a href="mailto:keycloak-dev@lists.jboss.org" class="">keycloak-dev@lists.jboss.org</a><br class=""><b class="">Subject:</b><span class="Apple-converted-space">&nbsp;</span>Re: [keycloak-dev] Class is not visible from class loader exception</font><div class="">&nbsp;</div></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">We had to specify the class loader of the interface we wanted to make into a client.<span class="Apple-converted-space">&nbsp;</span><br class=""><br class="">Take a look at this code:<br class=""><a href="http://github.com/Smartling/keycloak-user-migration-provider/blob/master/user-migration-federation-provider/src/main/java/com/smartling/keycloak/provider/RemoteUserFederationProvider.java" class="">github.com/Smartling/keycloak-user-migration-provider/blob/master/user-migration-federation-provider/src/main/java/com/smartling/keycloak/provider/RemoteUserFederationProvider.java</a><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Tue, Sep 6, 2016 at 7:45 PM Crafton Williams &lt;<a href="mailto:crafton.williams@qut.edu.au" class="">crafton.williams@qut.edu.au</a>&gt; wrote:<br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div style="font-size: 12pt; background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif;" class=""><div style="margin-top: 0px; margin-bottom: 0px;" class="">Hi all:</div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div><div style="margin-top: 0px; margin-bottom: 0px;" class="">I'm in the process of developing a web&nbsp;service-based User Federation SPI. I've gone through the properties SPI example and had a look at the ldap and kerberos SPIs. They seem pretty straightforward and at first glance I think I've implemented things properly. For my service requests, I'm using the Resteasy client through the proxy interface with a few simple calls to test things out. When I package and deploy, Keycloak doesn't seem to complain, however when I search for a user, i get the following trace:</div><p style="margin-top: 0px; margin-bottom: 0px;" class=""></p><div class=""><i class="">09:20:20,956 ERROR [io.undertow.request] (default task-15) UT005023: Exception handling request to /auth/admin/realms/master/users: org.jboss.resteasy.spi.UnhandledException: java.lang.IllegalArgumentException: interface org.keycloak.federation.ws.client.WsServiceClient is not visible from class loader</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:76)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:212)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:168)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:411)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:202)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at org.keycloak.services.filters.KeycloakSessionServletFilter.doFilter(KeycloakSessionServletFilter.java:90)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)</i></div><div class=""><i class=""><span style="white-space: pre-wrap;" class=""></span>at java.lang.Thread.run(Thread.java:745)</i></div><div class=""><i class=""><br class=""></i></div><div class="">Some details about my environment:</div><div class="">Keycloak version: 2.1.0.Final, running in standalone mode</div><div class="">Java version: 1.8.0_101</div><div class=""><br class=""></div><div class="">Project structure:</div><div class=""><a href="http://or.keycloak.federation.ws/" target="_blank" class="">or.keycloak.federation.ws</a></div><div class=""><i class="">-client</i></div><div class=""><i class="">--WsServiceClient.java</i></div><div class=""><i class="">-ServiceModel.java</i></div><div class=""><i class="">-WsFederationProvider.java</i></div><div class=""><i class="">-WsFederationProviderFactory.java</i></div><div class=""><i class=""><br class=""></i></div><div class=""><i class="">-resources</i></div><div class=""><i class="">--META-INF.services</i></div><div class=""><i class="">---org.keycloak.models.UserFederationProviderFactory</i></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">My getInstance for the factory class looks like this:</div><div class=""><pre style="background-color: rgb(43, 43, 43); color: rgb(169, 183, 198); font-family: 'DejaVu Sans Mono'; font-size: 10.5pt;" class=""><span style="color: rgb(187, 181, 41);" class="">@Override<br class=""></span><span style="color: rgb(204, 120, 50);" class="">public </span>WsFederationProvider <span style="color: rgb(255, 198, 109);" class="">getInstance</span>(KeycloakSession session<span style="color: rgb(204, 120, 50);" class="">, </span>UserFederationProviderModel model) {<br class="">    ResteasyClient client = <span style="color: rgb(204, 120, 50);" class="">new </span><span style="color: rgb(204, 120, 51);" class="">ResteasyClientBuilder</span>().<span style="color: rgb(204, 120, 51);" class="">build</span>()<span style="color: rgb(204, 120, 50);" class="">;<br class=""></span><span style="color: rgb(204, 120, 50);" class="">    </span>ResteasyWebTarget target = client.<span style="color: rgb(204, 120, 51);" class="">target</span>(<span style="color: rgb(152, 118, 170); font-style: italic;" class="">BASE_URL</span>)<span style="color: rgb(204, 120, 50);" class="">;<br class=""></span><span style="color: rgb(204, 120, 50);" class="">    </span><span style="font-size: 10.5pt;" class="">WsClientService</span><span style="font-size: 10.5pt;" class=""> serviceClient = target.</span><span style="font-size: 10.5pt; color: rgb(204, 120, 51);" class="">proxy</span><span style="font-size: 10.5pt;" class="">(</span><span style="font-size: 10.5pt;" class="">WsClientService</span><span style="font-size: 10.5pt;" class="">.</span><span style="font-size: 10.5pt; color: rgb(204, 120, 50);" class="">class</span><span style="font-size: 10.5pt;" class="">)</span><span style="font-size: 10.5pt; color: rgb(204, 120, 50);" class="">;</span><span style="color: rgb(204, 120, 50);" class=""><br class=""></span><span style="color: rgb(204, 120, 50);" class=""><br class=""></span><span style="color: rgb(204, 120, 50);" class="">    return new </span><span style="color: rgb(204, 120, 51);" class="">WsFederationProvider</span>(session<span style="color: rgb(204, 120, 50);" class="">, </span>model<span style="color: rgb(204, 120, 50);" class="">, </span>serviceClient)<span style="color: rgb(204, 120, 50);" class="">;<br class=""></span>}</pre><div class="">All dependencies in my POM are 'provided', so i've already ensured that the libraries aren't duplicated.</div><div class=""><br class=""></div>Based on my research so far, this seems to be the preferred way to instantiate the RestClient to ensure the classloader picks it up on boot, however I'm still getting the exception. Can anybody provide any clues?&nbsp;</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><i class=""></i>Regards,<p style="margin-top: 0px; margin-bottom: 0px;" class=""></p><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div><div style="margin-top: 0px; margin-bottom: 0px;" class="">Crafton</div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div></div></div>_______________________________________________<br class="">keycloak-dev mailing list<br class=""><a href="mailto:keycloak-dev@lists.jboss.org" target="_blank" class="">keycloak-dev@lists.jboss.org</a><br class=""><a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank" class="">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a></blockquote></div></div></div></blockquote></div><br class=""></body></html>