2011-09-30 2 views
0

appspot에서 Java 응용 프로그램에 액세스하려고 할 때 브라우저에 다음 오류가 표시됩니다.appspot에 응용 프로그램을 배포 한 후 오류가 발생했습니다.

Error: NOT_FOUND 

그러나 이클립스 또는 개미에서 실행하면 정상적으로 작동합니다. GAE 관리 콘솔에서 로그를 확인했지만 오류 메시지를 찾을 수 없습니다.

또한 빌드하기 전에 모든 * .class 파일을 제거하여 시도했습니다.

응용 프로그램은 appengine-java-sdk-1.5.3에서 제공되는 appcfg 스크립트를 사용하여 배포됩니다. 이 행동에 대한 특별한 이유가 있습니까? 여기

는 GAE 로그 콘솔에서 디버그 메시지입니다 :

2011-10-02 22:11:39.306/302 14950ms 10348cpu_ms 315api_cpu_ms 0kb Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1 
115.119.214.18 - - [02/Oct/2011:22:11:39 -0700] "GET/HTTP/1.1" 302 191 - "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1" "xxxxxxxx-test.appspot.com" ms=14950 cpu_ms=10348 api_cpu_ms=315 cpm_usd=0.287514 loading_request=1 throttle_code=1 instance=00c61b117c46324075b13d0c2ce04f5678c813 
I 2011-10-02 22:11:26.447 
javax.servlet.ServletContext log: Initializing Spring root WebApplicationContext 
W 2011-10-02 22:11:26.728 
[s~xxxxxxxx-test/8.353561328003056299].<stderr>: log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader). 

W 2011-10-02 22:11:26.728 
[s~xxxxxxxx-test/8.353561328003056299].<stderr>: log4j:WARN Please initialize the log4j system properly. 

I 2011-10-02 22:11:37.075 
javax.servlet.ServletContext log: Initializing Spring FrameworkServlet 'dispatcher' 
I 2011-10-02 22:11:39.306 
This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application. 

의 web.xml : index.jsp에서의

<?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"> 

<filter> 
       <filter-name>springSecurityFilterChain</filter-name> 
       <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> 
     </filter> 

     <filter-mapping> 
       <filter-name>springSecurityFilterChain</filter-name> 
       <url-pattern>/*</url-pattern> 
     </filter-mapping> 

     <context-param> 
       <param-name>contextConfigLocation</param-name> 
       <param-value>/WEB-INF/spring/*.xml</param-value> 
     </context-param> 
     <listener> 
       <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 
     </listener> 
     <servlet> 
       <servlet-name>dispatcher</servlet-name> 
       <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
       <init-param> 
         <param-name>contextConfigLocation</param-name> 
         <param-value>/WEB-INF/spring/servlet-config.xml</param-value> 
       </init-param> 
       <load-on-startup>1</load-on-startup> 
     </servlet> 
     <servlet-mapping> 
       <servlet-name>dispatcher</servlet-name> 
       <url-pattern>/ExampleApp/*</url-pattern> 
     </servlet-mapping> 
     <welcome-file-list> 
       <welcome-file>index.jsp</welcome-file> 
     </welcome-file-list> 
</web-app> 

내용 (환영 파일) 여기

<% response.sendRedirect("/ExampleApp/user/login"); %> 

build.xml :

<project> 
    <property name="sdk.dir" location="../appengine-java-sdk-1.5.3" /> 
    <import file="${sdk.dir}/config/user/ant-macros.xml" /> 

    <path id="project.classpath"> 
     <pathelement path="war/WEB-INF/classes" /> 
     <fileset dir="war/WEB-INF/lib"> 
      <include name="**/*.jar" /> 
     </fileset> 
     <fileset dir="${sdk.dir}/lib"> 
      <include name="shared/**/*.jar" /> 
     </fileset> 
    </path> 
<!-- 
    <target name="copyjars" description="Copies the App Engine JARs to the WAR."> 
     <copy todir="war/WEB-INF/lib" flatten="true"> 
     <fileset dir="${sdk.dir}/lib/user"> 
      <include name="**/*.jar" /> 
     </fileset> 
     </copy> 
    </target> 
--> 
    <target name="compile" description="Compiles Java source and copies other source files to the WAR."> 
     <mkdir dir="war/WEB-INF/classes" /> 
     <copy todir="war/WEB-INF/classes"> 
      <fileset dir="src"> 
      <exclude name="**/*.java" /> 
      </fileset> 
     </copy> 
     <javac srcdir="src" destdir="war/WEB-INF/classes" classpathref="project.classpath" debug="on" /> 
    </target> 

    <target name="datanucleusenhance" depends="compile" description="Performs JDO enhancement on compiled data classes."> 
     <enhance_war war="war" /> 
    </target> 

    <target name="runserver" depends="datanucleusenhance" description="Starts the development server."> 
     <dev_appserver war="war" /> 
    </target> 

    <target name="update" depends="datanucleusenhance" description="Uploads the application to App Engine."> 
     <appcfg action="update" war="war" /> 
    </target> 

    <target name="update_indexes" depends="datanucleusenhance" description="Uploads just the datastore index configuration to App Engine."> 
     <appcfg action="update_indexes" war="war" /> 
    </target> 

    <target name="rollback" depends="datanucleusenhance" description="Rolls back an interrupted application update."> 
     <appcfg action="rollback" war="war" /> 
    </target> 

    <target name="request_logs" description="Downloads log data from App Engine for the application."> 
     <appcfg action="request_logs" war="war"> 
     <options> 
      <arg value="--num_days=5"/> 
     </options> 
     <args> 
      <arg value="logs.txt"/> 
     </args> 
     </appcfg> 
    </target> 
</project> 
+0

귀하의 브라우저에서 앱의 URL을 사용해 본 것으로 가정합니다. 그게 다보고있는거야? 어떤 종류의 스택 추적이 있습니까? –

+0

예, ** 찾을 수 없음 ** 브라우저에서 볼 수있는 유일한 오류 메시지입니다. GAE 로그 콘솔에서 디버그 메시지를 추가했습니다. 응용 프로그램은 Eclipse 및 ant에서 아무 문제없이 실행 중입니다. – libregeek

+0

나는 오류가 AppEngine의 것이 아니라고 확신한다. Spring의 설정 비트가'war' 폴더에 없을 가능성이 있습니까? –

답변

0

몇 일간의 테스트와 실험 끝에 appspot.com에서 문제에 대한 해결책을 얻었습니다. 접두어에 슬래시가 추가 된 JSP 구성에 문제점이 있습니다.

올드 구성 :

<bean 
    class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 
       <property name="order" value="2" /> 
       <property name="prefix" value="/WEB-INF/views/" /> 
       <property name="suffix" value=".jsp" /> 
</bean> 

새로운 구성 : 리턴 경로가 "/Login/LoginPage.jsp"이었다 컨트롤러에서

<bean 
    class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 
       <property name="order" value="2" /> 
       <property name="prefix" value="/WEB-INF/views" /> 
       <property name="suffix" value=".jsp" /> 
</bean> 

. (jsp 파일 위치를 반환 한 컨트롤러 메서드가 너무 많아서 xml 파일이 변경되었습니다.)

log4j에서 디버그 문제를 기록 할 때까지는 문제를 추적 할 수 없습니다. 문제를 식별하는 데 핵심은 다음과 같습니다.

2011-10-10 21:38:14.644 
[s~exampleapp-test/8.353868453989422042].<stdout>: 16:08:14,644 DEBUG [org.springframework.web.servlet.view.JstlView] - Forwarding to resource [/WEB-INF/views//Login/LoginPage.jsp] in InternalResourceView '/Login/LoginPage' 

감사합니다. 양해 해 주셔서 감사합니다.

관련 문제