Hello Justin,
having read the exception stack trace, there is a warning : "The protocol
used by this request is not declared in
the list of client connectors. (FILE)".
I guess the error message is not as helpful as it can be because you add
this line of code which is fine:
getConnectorService().getClientProtocols().add(Protocol.FILE);
The connector service helps the application to declare the client connector
it expects in its context (see the javadocs).
But it is not sufficient, the Engine still needs to register the client
connector...
At the component level, just add :
component.getClients().add(Protocol.FILE);
I think we must complete the error message in order to enclear the real
cause of the problem.
Best regards,
Thierry Boileau
i've seriously been at this for hour & I'm really stumped something is
> missing. I can't understand why it doesn't work.
> I'm trying to pass in the location of my ftl template. I read the restlet
> wiki, searched the mailing list even read the source & I can't figure out
> wht it doesn't work.
>
> In MyApplication extend Application .........
> I've tried....
> getConnectorService().getClientProtocols().add(Protocol.FILE);
>
> I even tried this out of disperation...
>
>
> ConnectorService cs =new ConnectorService();
> cs.setClientProtocols(UtilMisc.toList(Protocol.FILE,
> Protocol.HTTP));
> setConnectorService(cs);
>
> @Override
> public Restlet createInboundRoot() {
> //I even added this in to get it to print out which had been set and
> they were in there!
> for(Protocol p :getConnectorService().getClientProtocols()){
> Debug.log(p.getName());
> }
>
> // initialize the Freemarker's configuration
> configuration = new Configuration();
> configuration
> .setTemplateLoader(new ContextTemplateLoader(
> getContext(),
>
>
> "file:/D:/development/myexample/deploy/myexample-integrations/webapp/myexample-base/service"));
>
> Then I have this in my HtmlRepresentationHandler.....
>
> String templateName = "serviceInfo.ftl";
> MediaType mediaType = MediaType.APPLICATION_XHTML;
> TemplateRepresentationrep = new TemplateRepresentation(templateName,
> getApp().getConfiguration(), cleanServiceResultMapInstance(results),
> mediaType);
>
> I always get the same error, I even tried other protocols to no avail.
>
>
> Jan 8, 2012 4:45:58 AM org.restlet.engine.component.ClientRouter getNext
> [java] WARNING: The protocol used by this request is not declared in
> the list of client connectors. (FILE)
> [java] Jan 8, 2012 4:45:58 AM org.restlet.engine.component.ClientRouter
> getNext
> [java] WARNING: The protocol used by this request is not declared in
> the list of client connectors. (FILE)
> [java] Jan 8, 2012 4:45:58 AM
> org.restlet.ext.freemarker.TemplateRepresentation getTemplate
> [java] WARNING: Unable to get the template serviceInfo.ftl. Error
> message: Template serviceInfo.ftl not found.
>
> I've read everything on google I can find about this & no answers please
> can
> someone help.
>
> --
> View this message in context:
> http://restlet-discuss.1400322.n2.nabble.com/Unable-to-get-the-template-serviceInfo-ftl-protocol-used-is-not-declared-in-the-client-connectors-FIg-tp7161931p7161931.html
> Sent from the Restlet Discuss mailing list archive at Nabble.com.
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2906796
>
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2907828