morpheus05
morpheus05

Reputation: 4872

404 on google endpoint in devserver

I have the problem, that my google endpoints ondevserver return a 404. Web.xml:

<servlet>
    <servlet-name>ServiceServlet</servlet-name>
    <servlet-class>com.google.api.server.spi.SystemServiceServlet</servlet-class>
    <init-param>
        <param-name>services</param-name>
        <param-value>package.endpoint1,package.endpoint2</param-value>
    </init-param>
</servlet>
<servlet-mapping>
    <servlet-name>ServiceServlet</servlet-name>
    <url-pattern>/_ah/spi/*</url-pattern>
</servlet-mapping>

I get the following message in the log:

 WARNING: No file found for: /endpoint1/v1/endpointMethod

So I guess the url-pattern is off for some reason. On live everything works just fine. Worth mentioning: - I use one servlet declaration for two disting endpoint APIs. Is this ok? - I use Version 1.8.8

I already tried some of the other solutions on stackoverflow but none of them worked.

Upvotes: 1

Views: 164

Answers (1)

Dan Holevoet
Dan Holevoet

Reputation: 9183

Including multiple, comma-delimited classes in your servlet definition is fine, but you need to use the entire class plus package name. For example:

<servlet>
    <servlet-name>SystemServiceServlet</servlet-name>
    <servlet-class>com.google.api.server.spi.SystemServiceServlet</servlet-class>
    <init-param>
        <param-name>services</param-name>
        <param-value>com.google.devrel.samples.helloendpoints.Greetings</param-value>
    </init-param>
</servlet>

Upvotes: 1

Related Questions