我正在使用Eclipse开发应用程序引擎应用程序,当我想部署应用程序时,我得到了这个错误:
'Deploying APP_NAME to Google' has encountered a problem
An internal error occured during "Deploying APP_NAME to Google"
详情如下:
An internal error occurred during: "Deploying APP_NAME to Google".
Received IOException parsing the input stream for /home/michael/workspace/APP_NAME/war/WEB-INF/web.xml
知道如何解决这个问题吗?
感谢您的帮助。
修改
奇怪的是,每次部署应用程序时都没有错误。
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<!-- Servlets -->
<servlet>
<servlet-name>deleteAllUniversityServlet</servlet-name>
<servlet-class>com.APP_NAME.api.DeleteAllUniversities</servlet-class>
</servlet>
<servlet>
<servlet-name>deleteAllCountryServlet</servlet-name>
<servlet-class>com.APP_NAME.api.DeleteAllCountries</servlet-class>
</servlet>
<servlet>
<servlet-name>deleteAllCitiesServlet</servlet-name>
<servlet-class>com.APP_NAME.api.DeleteAllCities</servlet-class>
</servlet>
<servlet>
<servlet-name>addUniversity</servlet-name>
<servlet-class>com.APP_NAME.api.AddUniversity</servlet-class>
</servlet>
<servlet>
<servlet-name>addCity</servlet-name>
<servlet-class>com.APP_NAME.api.AddCity</servlet-class>
</servlet>
<servlet>
<servlet-name>addCountry</servlet-name>
<servlet-class>com.APP_NAME.api.AddCountry</servlet-class>
</servlet>
<servlet>
<servlet-name>addGDP</servlet-name>
<servlet-class>com.APP_NAME.api.AddGDP</servlet-class>
</servlet>
<servlet>
<servlet-name>addHPC</servlet-name>
<servlet-class>com.APP_NAME.api.AddHPC</servlet-class>
</servlet>
<servlet>
<servlet-name>addRanking</servlet-name>
<servlet-class>com.APP_NAME.api.AddRanking</servlet-class>
</servlet>
<servlet>
<servlet-name>greetServlet</servlet-name>
<servlet-class>com.APP_NAME.server.GreetingServiceImpl</servlet-class>
</servlet>
<servlet>
<servlet-name>serverSearchServiceImpl</servlet-name>
<servlet-class>com.APP_NAME.server.ServerSearchServiceImpl</servlet-class>
</servlet>
<servlet>
<servlet-name>serverChartServiceImpl</servlet-name>
<servlet-class>com.APP_NAME.server.ServerChartServiceImpl</servlet-class>
</servlet>
<servlet>
<servlet-name>serverCoordServiceImpl</servlet-name>
<servlet-class>com.APP_NAME.server.ServerCoordServiceImpl</servlet-class>
</servlet>
<servlet>
<servlet-name>serverDataServiceImpl</servlet-name>
<servlet-class>com.APP_NAME.server.ServerDataServiceImpl</servlet-class>
</servlet>
<servlet>
<servlet-name>serverCityServiceImpl</servlet-name>
<servlet-class>com.APP_NAME.server.ServerCityServiceImpl</servlet-class>
</servlet>
<!-- Servlet-mappings -->
<servlet-mapping>
<servlet-name>addUniversity</servlet-name>
<url-pattern>/api/addUniversity</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>addCity</servlet-name>
<url-pattern>/api/addCity</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>addCountry</servlet-name>
<url-pattern>/api/addCountry</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>addGDP</servlet-name>
<url-pattern>/api/addGDP</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>addHPC</servlet-name>
<url-pattern>/api/addHPC</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>addRanking</servlet-name>
<url-pattern>/api/addRanking</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>deleteAllCitiesServlet</servlet-name>
<url-pattern>/api/deleteAllCities</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>deleteAllUniversityServlet</servlet-name>
<url-pattern>/api/deleteAllUniversities</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>deleteAllCountryServlet</servlet-name>
<url-pattern>/api/deleteAllCountries</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>greetServlet</servlet-name>
<url-pattern>/APP_NAME/greet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>serverSearchServiceImpl</servlet-name>
<url-pattern>/APP_NAME/serverSearch</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>serverChartServiceImpl</servlet-name>
<url-pattern>/APP_NAME/serverChart</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>serverCoordServiceImpl</servlet-name>
<url-pattern>/APP_NAME/serverCoord</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>serverDataServiceImpl</servlet-name>
<url-pattern>/APP_NAME/serverData</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>serverCityServiceImpl</servlet-name>
<url-pattern>/APP_NAME/serverCity</url-pattern>
</servlet-mapping>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>APP_NAME.html</welcome-file>
</welcome-file-list>
</web-app>
编辑2
实际上,当我收到错误时,会出现web.xml文件中的错误:
Multiple annotations found at this line :
- Attribute "version" must be declared for element type "web-app".
- Attribute "xmlns" must be declared for element type "web-app".
但是现在,经过更正后,我文件的开头看起来如下:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">
<!-- Servlets -->
<servlet>
<servlet-name>deleteAllUniversityServlet</servlet-name>
<servlet-class>com.APP_NAME.api.DeleteAllUniversities</servlet-class>
</servlet>
...
我不明白什么是错的......
编辑3
问题似乎来自DOCTYPE,因为当我将DOCTYPE作为注释时,应用程序正确部署。
答案 0 :(得分:0)
您没有关闭<web-app>
节点
试试这个:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">
<servlet>
<servlet-name>deleteAllUniversityServlet</servlet-name>
<servlet-class>com.APP_NAME.api.DeleteAllUniversities</servlet-class>
</servlet>
<servlet>
<servlet-name>deleteAllCountryServlet</servlet-name>
<servlet-class>com.APP_NAME.api.DeleteAllCountries</servlet-class>
</servlet>
<servlet>
<servlet-name>deleteAllCitiesServlet</servlet-name>
<servlet-class>com.APP_NAME.api.DeleteAllCities</servlet-class>
</servlet>
<servlet>
<servlet-name>addUniversity</servlet-name>
<servlet-class>com.APP_NAME.api.AddUniversity</servlet-class>
</servlet>
<servlet>
<servlet-name>addCity</servlet-name>
<servlet-class>com.APP_NAME.api.AddCity</servlet-class>
</servlet>
</web-app>