Aakash Goplani
Aakash Goplani

Reputation: 1354

GAE : No file found error

I am preparing my first GAE. My main folder name is companyreview and my src folder contains two servlets AddcompanyReview.java and CompanyreviewServlet.java

My web.xml file's description

<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">

<servlet>
    <servlet-name>Companyreview</servlet-name>
<servlet-class>com.ait.companyreview.CompanyreviewServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>Companyreview</servlet-name>
    <url-pattern>/Companyreview</url-pattern>

</servlet-mapping>
<servlet>
    <servlet-name>addReview</servlet-name>
    <servlet-class>com.ait.companyreview.AddcompanyReview</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>addReview</servlet-name>
    <url-pattern>/companyreview</url-pattern>
</servlet-mapping>

<welcome-file-list>
    <welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>

My index.html contents

<form name = "admin" action = "addReview" method = "post" >

My AddcompanyReview.java Servlet's snippet

@SuppressWarnings("serial")
public class AddcompanyReview extends HttpServlet 
{
    @Override
    public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException
......
}

These are the errors that I encounter: WARNING: No file found for:/addReview. Mar 06, 2015 7:37:32 PM com.google.appengine.tools.development.LocalResourceFileServlet doGet

I am using doPost method in my servlet so why am I getting doGet method as error and what about no file found error, though the file already exists!

Upvotes: 1

Views: 1344

Answers (1)

Roman C
Roman C

Reputation: 1

You should change mapping

<servlet-mapping>
    <servlet-name>addReview</servlet-name>
    <url-pattern>/addReview</url-pattern>
</servlet-mapping>

The servlet was mapped incorrectly and you mapped a two servlets to the same context path.

Upvotes: 1

Related Questions