<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:Georgia;
        panose-1:2 4 5 2 5 4 5 2 3 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";
        mso-fareast-language:NL;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="NL" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<pre style="background:#2B2B2B"><span lang="EN-US">I can’t make REST endpoint work, I’m using exactly code supplied in example, I tried also to check how standard endpoints in keycloak code are created, all looks similar:<br><br><span style="color:#A9B7C6"><br></span><i><span style="color:#629755">/**<br> * <b>@author </b></span><span style="color:#77B767"><a href="mailto:<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>"></span><span style="color:#629755">Stian Thorgersen</span><span style="color:#77B767"></a><br> </span><span style="color:#629755">*/<br></span></i><span style="color:#CC7832">public class </span><span style="color:#A9B7C6">HelloResourceProvider </span><span style="color:#CC7832">implements </span><span style="color:#A9B7C6">RealmResourceProvider {<br><br> </span><span style="color:#CC7832">private </span><span style="color:#A9B7C6">KeycloakSession </span><span style="color:#9876AA">session</span><span style="color:#CC7832">;<br><br> public </span><span style="color:#FFC66D">HelloResourceProvider</span><span style="color:#A9B7C6">(KeycloakSession session) {<br> </span><span style="color:#CC7832">this</span><span style="color:#A9B7C6">.</span><span style="color:#9876AA">session </span><span style="color:#A9B7C6">= session</span><span style="color:#CC7832">;<br> </span><span style="color:#A9B7C6">}<br><br> </span><span style="color:#BBB529">@GET<br> @Produces</span><span style="color:#A9B7C6">(MediaType.</span><i><span style="color:#9876AA">TEXT_HTML</span></i><span style="color:#A9B7C6">)<br> </span><span style="color:#BBB529">@Path</span><span style="color:#A9B7C6">(</span><span style="color:#6A8759">"/{action}"</span><span style="color:#A9B7C6">)<br> </span><span style="color:#CC7832">public </span><span style="color:#A9B7C6">String </span><span style="color:#FFC66D">get</span><span style="color:#A9B7C6">(</span><span style="color:#BBB529">@PathParam</span><span style="color:#A9B7C6">(</span><span style="color:#6A8759">"action"</span><span style="color:#A9B7C6">) String action) {<br> </span><span style="color:gray">//String requestUri = session.getContext().getUri().getRequestUri().toString();<br><br> </span><span style="color:#A9B7C6">String title = </span><span style="color:#6A8759">"APP_REQUEST"</span><span style="color:#CC7832">;<br> if </span><span style="color:#A9B7C6">(action.equals(</span><span style="color:#6A8759">"auth"</span><span style="color:#A9B7C6">)) {<br> title = </span><span style="color:#6A8759">"AUTH_RESPONSE"</span><span style="color:#CC7832">;<br> </span><span style="color:#A9B7C6">} </span><span style="color:#CC7832">else if </span><span style="color:#A9B7C6">(action.equals(</span><span style="color:#6A8759">"logout"</span><span style="color:#A9B7C6">)) {<br> title = </span><span style="color:#6A8759">"LOGOUT_REQUEST"</span><span style="color:#CC7832">;<br> </span><span style="color:#A9B7C6">}<br><br> StringBuilder sb = </span><span style="color:#CC7832">new </span><span style="color:#A9B7C6">StringBuilder()</span><span style="color:#CC7832">;<br> </span><span style="color:#A9B7C6">sb.append(</span><span style="color:#6A8759">"<html><head><title>" </span><span style="color:#A9B7C6">+ title + </span><span style="color:#6A8759">"</title></head><body>"</span><span style="color:#A9B7C6">)</span><span style="color:#CC7832">;<br> </span><span style="color:#A9B7C6">UriBuilder base = UriBuilder.<i>fromUri</i>(</span><span style="color:#6A8759">"<a href="http://localhost:8180/auth" target="_blank">http://localhost:8180/auth</a>"</span><span style="color:#A9B7C6">)</span><span style="color:#CC7832">;<br> </span><span style="color:#A9B7C6">sb.append(</span><span style="color:#6A8759">"<a href=</span><span style="color:#CC7832">\"</span><span style="color:#6A8759">" </span><span style="color:#A9B7C6">+ RealmsResource.<i>accountUrl</i>(base).build(</span><span style="color:#6A8759">"test"</span><span style="color:#A9B7C6">).toString() + </span><span style="color:#6A8759">"</span><span style="color:#CC7832">\"</span><span style="color:#6A8759"> id=</span><span style="color:#CC7832">\"</span><span style="color:#6A8759">account</span><span style="color:#CC7832">\"</span><span style="color:#6A8759">>account</a>"</span><span style="color:#A9B7C6">)</span><span style="color:#CC7832">;<br><br> </span><span style="color:#A9B7C6">sb.append(</span><span style="color:#6A8759">"</body></html>"</span><span style="color:#A9B7C6">)</span><span style="color:#CC7832">;<br> return </span><span style="color:#A9B7C6">sb.toString()</span><span style="color:#CC7832">;<br> </span><span style="color:#A9B7C6">}<br><br> </span><span style="color:#BBB529">@Override<br> </span><span style="color:#CC7832">public </span><span style="color:#A9B7C6">Object </span><span style="color:#FFC66D">getResource</span><span style="color:#A9B7C6">() {<br> </span><span style="color:#CC7832">return this;<br> </span><span style="color:#A9B7C6">}<br><br> </span><span style="color:#BBB529">@Override<br> </span><span style="color:#CC7832">public void </span><span style="color:#FFC66D">close</span><span style="color:#A9B7C6">() {<br> }<br><br>}</span><o:p></o:p></span></pre>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> <o:p></o:p></span></p>
<pre style="margin:6.0pt"><span lang="EN-US">But I’m still getting:<o:p></o:p></span></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:6.0pt;margin-bottom:6.0pt;margin-left:0cm"><span lang="EN-US"> <o:p></o:p></span></pre>
<pre style="margin:6.0pt"><code><span lang="EN-US" style="font-family:Consolas;color:black">RESTEASY003815: Subresource for target class has no jax-rs annotations.: nl.vi.keycloak.providers.rest.HelloResourceProvider</span></code><span lang="EN-US"><o:p></o:p></span></pre>
<pre style="margin:6.0pt"><code><span lang="EN-US" style="font-family:Consolas;color:black"> </span></code><span lang="EN-US"><o:p></o:p></span></pre>
<pre style="margin:6.0pt"><code><span lang="EN-US" style="font-family:Consolas;color:black">Can you please help me? Thanks</span></code><o:p></o:p></pre>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<table class="MsoNormalTable" border="0" cellpadding="0" width="461" style="width:345.65pt;margin-left:-3.0pt">
<tbody>
<tr style="height:11.15pt">
<td style="padding:0cm 0cm 0cm 0cm;height:11.15pt">
<p class="MsoNormal" style="line-height:12.0pt"><span style="font-size:10.0pt;font-family:"Georgia",serif;color:black;mso-fareast-language:NL">Kind Regards,</span><span style="font-size:10.0pt;font-family:"Georgia",serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:12.0pt"><span style="font-size:10.0pt;font-family:"Georgia",serif;color:black;mso-fareast-language:NL"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:12.0pt"><span style="font-size:10.0pt;font-family:"Georgia",serif;color:black;mso-fareast-language:NL">Mariusz Chruscielewski</span><span style="font-size:10.0pt;font-family:"Georgia",serif;color:black"><o:p></o:p></span></p>
</td>
</tr>
<tr style="height:11.15pt">
<td style="padding:0cm 0cm 15.0pt 0cm;height:11.15pt">
<p class="MsoNormal" style="line-height:12.0pt"><span lang="EN-US" style="font-size:10.0pt;font-family:"Georgia",serif;color:black;mso-fareast-language:NL">Software Engineer | <a href="mailto:mariusz@info.nl"><span style="color:blue">mariusz@info.nl</span></a> <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:12.0pt"><span lang="EN-US" style="font-size:10.0pt;font-family:"Georgia",serif;color:black;mso-fareast-language:NL">+31 (0)20 530 91 13 | +48 695 555 292
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Georgia",serif;color:black"><o:p></o:p></span></p>
</td>
</tr>
<tr style="height:15.3pt">
<td style="padding:0cm 0cm 3.0pt 0cm;height:15.3pt">
<p class="MsoNormal" style="line-height:16.0pt"><span style="font-size:10.0pt;font-family:"Georgia",serif;color:black;mso-fareast-language:NL"><a href="http://www.info.nl/"><span lang="EN-US" style="font-size:14.0pt;color:white;background:black">info.nl</span><span lang="EN-US" style="color:blue"> </span></a><a href="http://www.info.nl/nl?utm_source=e-mail_sig&utm_medium=e-mail&utm_term=connecting_the_dots&utm_campaign=info_sig"><i><span lang="EN-US" style="color:black">making
platforms work</span></i></a></span><span lang="EN-US" style="font-size:10.0pt;font-family:"Georgia",serif;color:black"><o:p></o:p></span></p>
</td>
</tr>
<tr style="height:11.15pt">
<td style="padding:0cm 0cm 15.0pt 0cm;height:11.15pt">
<p class="MsoNormal" style="line-height:12.0pt"><span style="font-size:10.0pt;font-family:"Georgia",serif;color:black;mso-fareast-language:NL">Sint Antoniesbreestraat 16 | 1011 HB Amsterdam | +31 (0)20 530 91 11</span><span style="font-size:10.0pt;font-family:"Georgia",serif;color:black;mso-fareast-language:NL"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:12.0pt"><span style="font-size:10.0pt;font-family:"Georgia",serif;mso-fareast-language:NL"><a href="https://www.facebook.com/infonl"><span style="color:blue">Facebook</span></a> |
<a href="https://twitter.com/infonl"><span style="color:blue">Twitter</span></a> |
<a href="https://www.linkedin.com/company/info-nl"><span style="color:blue">LinkedIn</span></a> |
<a href="https://plus.google.com/+infonl/"><span style="color:blue">Google+</span></a></span><span style="font-size:10.0pt;font-family:"Georgia",serif"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="mso-fareast-language:NL"><o:p> </o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>