Quantcast

The server has not found anything matching the request URI

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

The server has not found anything matching the request URI

jharby
We are using glassfish 2.1 with netbeans. We have been running with Restlet 1.1 with the com.noelios servlet fine for quite awhile. However I tried to upgrade to Restlet 2.1-M4 and everything compiles and deploys ok but when I try to post the same URL that was working in 1.1 I keep getting this error in the subject. I can post whichever files might help, just let me know.

TIA,
John Harby
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: The server has not found anything matching the request URI

gonzajg
I had the same problem when upgrading. I don't know if you are using any integration with spring but my problem was when setting the property for the finder. Here's an example in Restlet 1.1.x:

<bean id="root" class="org.restlet.ext.spring.SpringRouter">
                <property name="attachments">
                        <map>
                                <entry key="">
                                        <bean class="org.restlet.ext.spring.SpringFinder">
                                                <lookup-method name="createResource" bean="userResource" />
                                        </bean>
                                </entry>
                        </map>
                </property>
        </bean>

The lookup-method name changed to "create". This is more a Spring than Restlet issue but maybe it'll help you. It took some time for me to realize this.

Hope it helps!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: The server has not found anything matching the request URI

jharby
Thanks - I'm not using Spring but I did get a stack trace, maybe someone has seen before?
I only get this sometimes while debugging.

Exception while instantiating the target server resource.
java.lang.InstantiationException: gov.hhs.fha.nhinc.presentationservices.resources.ApiDocResource
        at java.lang.Class.newInstance0(Class.java:340)
        at java.lang.Class.newInstance(Class.java:308)
        at org.restlet.resource.Finder.create(Finder.java:154)
        at org.restlet.resource.Finder.create(Finder.java:183)
        at org.restlet.resource.Finder.find(Finder.java:201)
        at org.restlet.resource.Finder.handle(Finder.java:227)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Router.doHandle(Router.java:440)
        at org.restlet.routing.Router.handle(Router.java:666)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:151)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:158)
        at org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:73)
        at org.restlet.Application.handle(Application.java:381)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Router.doHandle(Router.java:440)
        at org.restlet.routing.Router.handle(Router.java:666)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Router.doHandle(Router.java:440)
        at org.restlet.routing.Router.handle(Router.java:666)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:158)
        at org.restlet.Component.handle(Component.java:388)
        at org.restlet.Server.handle(Server.java:501)
        at org.restlet.engine.ServerHelper.handle(ServerHelper.java:69)
        at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:149)
        at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1085)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:315)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
        at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1093)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1093)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:291)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:666)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:597)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:872)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
        at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:264)
        at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
No target resource was defined for this finder: Finder for ApiDocResource
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: The server has not found anything matching the request URI

gonzajg
how are you defining the routes of your classes??
could you tell the URL of your request?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: The server has not found anything matching the request URI

jharby
The base URL is http://localhost:8080/PresentationServicesMVN2

I get the error regardless of any resources I specify.

My application class "PresentationServicesApplication.java" attaches the routes like this:

        Router router = new Router(getContext());

        router.attachDefault(ApiDocResource.class);
        // router.attachDefault(new Directory(getContext(), "war:///"));
        router.attach("/", new Directory(
                getContext(),
                ROOT_URI));

        router.attach("/",
                new Redirector(router.getContext().createChildContext(),
                "/Resources",
                Redirector.MODE_CLIENT_SEE_OTHER));

        router.attach("/Allergies", AllergiesResource.class);
        router.attach("/Admissions", AdmissionsResource.class);
        router.attach("/Appointments", AppointmentsResource.class);
        router.attach("/Calendar/External", ExternalCalendarResource.class);
        router.attach("/Demographics", PatientDemographicsResource.class);
        router.attach("/DiagnosticImaging", DiagnosticImagingResource.class);
        router.attach("/Documents", DocumentsResource.class);
        router.attach("/EmergencyContact", EmergencyContactResource.class);
        router.attach("/EncounterDetail", EncounterDetailResource.class);
        router.attach("/Encounter/Detail", EncounterDetailResource.class);
        router.attach("/Encounter/Note", EncounterNoteResource.class);
        router.attach("/getMessages", GetMessagesResource.class);
        router.attach("/Immunizations", ImmunizationsResource.class);
        router.attach("/Labs", LabsResource.class);
        router.attach("/LocationSchedule", LocationScheduleResource.class);
        router.attach("/Locations/Clinics", LocationClinicsResource.class);
        router.attach("/Locations/Wards", LocationWardsResource.class);
        router.attach("/Login", LoginResource.class);
        router.attach("/Mail", MailResource.class);
        router.attach("/Mail/Status", MailStatusResource.class);
        router.attach("/MailAction", MailActionResource.class);
        router.attach("/Mail/Action", MailActionResource.class);
        router.attach("/maintainAccount", MaintainAccountResource.class);
        router.attach("/Medications", MedicationsResource.class);
        router.attach("/MessageDetail", MessageDetailResource.class);
        router.attach("/Mobile", MobileResource.class);
        router.attach("/Orders", OrdersResource.class);
        router.attach("/PatientCensus", PatientCensusResource.class);
        router.attach("/Patients", PatientsResource.class);
        router.attach("/PmrPreferences", PmrPreferencesResource.class);
        router.attach("/Problems", ProblemsResource.class);
        router.attach("/Procedures", ProcedureResource.class);
        router.attach("/Provider", ProvidersResource.class);
        router.attach("/Providers", ProvidersResource.class);
        router.attach("/Providers/Image", ProvidersImageResource.class);
        router.attach("/setMessage", SetMessageResource.class);
        router.attach("/Schedules", SchedulingResource.class);
        router.attach("/Todos", ToDoResource.class);
        router.attach("/validateAccount", ValidateAccountResource.class);
        router.attach("/Vitals", VitalsResource.class);
    //this one is for testing - sandbox related
        router.attach("/test", TestResource.class);

The ApiDocResource class that is coming up in that stack trace is:

package gov.hhs.fha.nhinc.presentationservices.resources;


import org.restlet.Context;

import org.restlet.data.MediaType;
import org.restlet.data.Reference;
import org.restlet.Request;
import org.restlet.Response;

import org.restlet.representation.Representation;
import org.restlet.resource.ResourceException;
import org.restlet.representation.StringRepresentation;
import org.restlet.representation.Variant;
import org.restlet.resource.Get;


/**
 * @author  mep
 */
public class ApiDocResource extends BaseResource
{


    /**
     * Creates a new ApiDocResource object.
     *
     * @param  context   DOCUMENT ME!
     * @param  request   DOCUMENT ME!
     * @param  response  DOCUMENT ME!
     */
    public ApiDocResource(Context context, Request request, Response response)
    {
        super(context, request, response);

        getVariants().add(new Variant(MediaType.TEXT_PLAIN));
        getVariants().add(new Variant(MediaType.APPLICATION_XML));
    }

    /**
     * @see  org.restlet.resource.Resource#represent(org.restlet.resource.Variant)
     */
    @Get
    public Representation represent(Variant variant)
        throws ResourceException
    {

        StringBuffer result = new StringBuffer();
        result.append("Availiable resources are:\n");
        addRef(result,"/Allergies");
        addRef(result,"/Admissions");
        addRef(result,"/Appointments");
        addRef(result,"/Calendar/External");
        addRef(result,"/Demographics");
        addRef(result,"/DiagnosticImaging");
        addRef(result,"/Documents");
        addRef(result,"/EmergencyContact");
        addRef(result,"/EncounterDetail");
        addRef(result,"/Encounter/Detail");
        addRef(result,"/Encounter/Note");
        addRef(result,"/Immunizations");
        addRef(result,"/Labs");
        addRef(result,"/LocationSchedule");
        addRef(result,"/Locations/Clinics");
        addRef(result,"/Locations/Wards");
        addRef(result,"/Login");
        addRef(result,"/Mail");
        addRef(result,"/Mail/Status");
        addRef(result,"/MailAction");
        addRef(result,"/maintainAccount");
        addRef(result,"/Medications");
        addRef(result,"/Mobile");
        addRef(result,"/Orders");
        addRef(result,"/PatientCensus");
        addRef(result,"/Patients");
        addRef(result,"/PmrPreferences");
        addRef(result,"/Problems");
        addRef(result,"/Procedures");
        addRef(result,"/Providers");
        addRef(result,"/Providers/Image");
        addRef(result,"/setMessage");
        addRef(result,"/Schedules");
        addRef(result,"/Todos");
        addRef(result,"/validateAccount");
        addRef(result,"/Vitals");

        Representation rep = new StringRepresentation(result.toString(),
                MediaType.TEXT_PLAIN);

        return rep;
    }
    private void addRef(StringBuffer result, String refStr)
    {
        Reference ref = getRequest().getRootRef();
        ref.setPath("/PresentationServices"+refStr);
        result.append("\t" + ref.getTargetRef().toString() + "\n");

    }
}


This was all working fine in Restlet 1.1. To migrate to 2.1 I changed the methods in the resources to use Annotations and installed the restlet api, servlet, etc jars. It's entirely possible I goofed something but I've been trying to figure this one out for a day now.
Loading...