<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic router.attach(String, Class&amp;lt;? extends ServerResource&amp;gt;) in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/router-attach-string-class-lt-extends-serverresource-gt/m-p/117530#M83004</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am unable to get router.attach() to work properly&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Server server = new Server(Protocol.HTTP, 8182, new TestServerApplication());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; server.start()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Here's the code that's in the client&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ClientResource clientResource = new ClientResource(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;/SPAN&gt;&lt;A href="http://localhost:8182/contacts/123" rel="nofollow noopener noreferrer"&gt;http://localhost:8182/contacts/123&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The following code does NOT work&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;router.attach("/contacts/123", ContactServerResource.class);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Exception in thread "main" Not Found (404) - Not Found&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The following code does NOT work&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;router.attach("/contacts/123", ContactServerResource.class, Router.MODE_BEST_MATCH);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Exception in thread "main" Not Found (404) - Not Found&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;* using attachDefault results in the call being handled properly&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// success!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;router.attachDefault(ContactServerResource.class);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I also tried something different rather than using a Server.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Component component = new Component();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Add a new HTTP server listening on port 8182.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;component.getServers().add(Protocol.HTTP, 8182);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Attach the sample application.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;component.getDefaultHost().attach("/contacts/123",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new TestServerApplication());&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;component.start();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In this case router.attach("/contacts/123", ContactServerResource.class) is still called and it still fails to work. You have to attachDefault() to get it to work&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can't think of anything else to try. Anybody have any ideas? thank you&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Oct 2012 11:51:32 GMT</pubDate>
    <dc:creator>gilbertoblue</dc:creator>
    <dc:date>2012-10-19T11:51:32Z</dc:date>
    <item>
      <title>router.attach(String, Class&lt;? extends ServerResource&gt;)</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/router-attach-string-class-lt-extends-serverresource-gt/m-p/117530#M83004</link>
      <description>I am unable to get router.attach() to work properly&amp;nbsp; Server server = new Server(Protocol.HTTP, 8182, new TestServerApplication());&amp;nbsp; server.start()&amp;nbsp; Here's the code that's in the client&amp;nbsp; ClientResource clientResource = new ClientResource(&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "http://localhost:8182/contacts/123");The following</description>
      <pubDate>Fri, 19 Oct 2012 11:51:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/router-attach-string-class-lt-extends-serverresource-gt/m-p/117530#M83004</guid>
      <dc:creator>gilbertoblue</dc:creator>
      <dc:date>2012-10-19T11:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: router.attach(String, Class&lt;? extends ServerResource&gt;)</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/router-attach-string-class-lt-extends-serverresource-gt/m-p/117531#M83005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Where does this code live? Are you extending the activiti-rest app? Seems to be more of a restlet-problem rather than an activiti one…&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2012 13:37:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/router-attach-string-class-lt-extends-serverresource-gt/m-p/117531#M83005</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2012-10-19T13:37:31Z</dc:date>
    </item>
  </channel>
</rss>

