Hi, all-

I'm running into a problem with a server app I'm modifying.

After getting an OAuth Proof of Concept app working last week, I'm modifying an 
existing app to demonstrate that it's straightforward to use an OAuth 
authenticating filter. . (Full disclosure: I'm currently using very recent code 
out of the SVN repo for the OAuth extension. I think it's my app that's causing 
this problem, though; my PoC app works fine with this new version of the 
library.)

Having modified the app, though, any outbound requests cause some debugging 
warnings, followed by an exception:

By default, the outbound root of an application can't handle calls without 
being attached to a parent component.
Exception or error caught in status service

Internal Server Error (500) - The server isn't properly configured to handle 
client calls.
     at org.restlet.resource.ClientResource.doError(ClientResource.java:484)
     at org.restlet.resource.ClientResource.handle(ClientResource.java:917)
     at org.restlet.resource.ClientResource.handle(ClientResource.java:888)
     at org.restlet.resource.ClientResource.post(ClientResource.java:1271)
     at 
org.restlet.ext.oauth.OAuthAuthorizer.authorize(OAuthAuthorizer.java:222)

The exception is happening when the authenticator attempts to POST a request to 
an authentication server.  I haven't seen this behavior before in this app, and 
I'm also not seeing it in my PoC app, which works fine. I can't figure out what 
I need to change to make this work correctly.

From reading the warning above, I've been trying to figure out if I need to do 
something in a createOutboundRoot() override, but I'm not overriding that in 
the PoC app, and am not clear on what its purpose is or how it's supposed to 
work.

I've looked at a bunch of different issues during initialization, but things 
seem (to me) to be starting up correctly. After removing (hopefully) unrelated 
stuff, the app initialization boils down to this, which looks pretty vanilla:

    private static Component component = null;

    public static void main(String... args) throws Exception
    {
        component = createComponent();
        component.start();
    }

    private static Component createComponent() throws Exception
    {
        Component comp = new Component();
        comp.getClients().add(Protocol.FILE);
        comp.getClients().add(Protocol.HTTP);
        comp.getServers().add(Protocol.HTTP, 8082);

        Application app = new 
AdRestApplication(comp.getContext().createChildContext());
        comp.getDefaultHost().attach("/v2", app);

        return comp;
    }

    @Override
    public Restlet createInboundRoot()
    {
        creator = new RouteCreator();
        creator.configureRoutes(getContext(), this.webRootPath);
        Router rootRouter = creator.getRootRouter();
        return rootRouter;
    }

Is there something I'm missing or not thinking of?

Thanks for any help!

--------------------------
John Wismar
Alldata Technology
916-478-3296

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2803896

Reply via email to