Я создал весеннее загрузочное приложение и развернул его на heroku, но он не работает? - PullRequest
0 голосов
/ 12 ноября 2018

Это простое приложение с весенней загрузкой.Мое приложение работает локально, но оно не работает после того, как я развернул его на heroku как файл войны.Когда я посещаю http://127.0.0.1:8080/ на локальной машине, я получаю вывод как

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.
Mon Nov 12 20:24:07 IST 2018
There was an unexpected error (type=Not Found, status=404).
No message available

и когда я посещаю http://127.0.0.1:8080/hello, я получаю ответ как простой привет.поэтому он работает, как я ожидал, на моем локальном компьютере, но когда я захожу в приложение heroku, я получаю сообщение об ошибке следующим образом

HTTP Status 404 – Not Found

Type Status Report

Message /

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Apache Tomcat/8.5.33

Когда я запускаю логи герою, я получаю информацию ниже

2018-11-12T14:39:45.448868+00:00 app[web.1]: Default: false
2018-11-12T14:39:45.448870+00:00 app[web.1]: --expand-war-file
2018-11-12T14:39:45.448871+00:00 app[web.1]: Expand the war file and set it as source
2018-11-12T14:39:45.448873+00:00 app[web.1]: Default: true
2018-11-12T14:39:45.448875+00:00 app[web.1]: --expanded-dir-name
2018-11-12T14:39:45.448876+00:00 app[web.1]: The name of the directory the WAR file will be expanded into.
2018-11-12T14:39:45.448878+00:00 app[web.1]: Default: expanded
2018-11-12T14:39:45.448879+00:00 app[web.1]: --help
2018-11-12T14:39:45.448881+00:00 app[web.1]: 
2018-11-12T14:39:45.448883+00:00 app[web.1]: --max-threads
2018-11-12T14:39:45.448885+00:00 app[web.1]: Set the maximum number of worker threads
2018-11-12T14:39:45.448886+00:00 app[web.1]: Default: 0
2018-11-12T14:39:45.448888+00:00 app[web.1]: --memcached-transcoder-factory-class
2018-11-12T14:39:45.448890+00:00 app[web.1]: The class name of the factory that creates the transcoder to use for
2018-11-12T14:39:45.448892+00:00 app[web.1]: serializing/deserializing sessions to/from memcached.
2018-11-12T14:39:45.448894+00:00 app[web.1]: --path
2018-11-12T14:39:45.448895+00:00 app[web.1]: The context path
2018-11-12T14:39:45.448897+00:00 app[web.1]: Default: <empty string>
2018-11-12T14:39:45.448899+00:00 app[web.1]: --port
2018-11-12T14:39:45.448900+00:00 app[web.1]: The port that the server will accept http requests on.
2018-11-12T14:39:45.448902+00:00 app[web.1]: Default: 8080
2018-11-12T14:39:45.448904+00:00 app[web.1]: --proxy-base-url
2018-11-12T14:39:45.448905+00:00 app[web.1]: Set proxy URL if tomcat is running behind reverse proxy
2018-11-12T14:39:45.448907+00:00 app[web.1]: Default: <empty string>
2018-11-12T14:39:45.448908+00:00 app[web.1]: --scanBootstrapClassPath
2018-11-12T14:39:45.448910+00:00 app[web.1]: Set jar scanner scan bootstrap classpath.
2018-11-12T14:39:45.448912+00:00 app[web.1]: Default: false
2018-11-12T14:39:45.448914+00:00 app[web.1]: --session-store
2018-11-12T14:39:45.448915+00:00 app[web.1]: Session store to use (valid options are 'memcache' or 'redis')
2018-11-12T14:39:45.448917+00:00 app[web.1]: --session-store-ignore-pattern
2018-11-12T14:39:45.448918+00:00 app[web.1]: Request pattern to not track sessions for. Valid only with memcache
2018-11-12T14:39:45.448920+00:00 app[web.1]: session store. (default is '.*\.(png|gif|jpg|css|js)$'. Has no effect
2018-11-12T14:39:45.448922+00:00 app[web.1]: for 'redis')
2018-11-12T14:39:45.448923+00:00 app[web.1]: Default: .*\.(png|gif|jpg|css|js)$
2018-11-12T14:39:45.448925+00:00 app[web.1]: --session-store-locking-mode
2018-11-12T14:39:45.448926+00:00 app[web.1]: Session locking mode for use with memcache session store. (default is
2018-11-12T14:39:45.448928+00:00 app[web.1]: all. Has no effect for 'redis')
2018-11-12T14:39:45.448930+00:00 app[web.1]: Default: all
2018-11-12T14:39:45.448931+00:00 app[web.1]: --session-store-operation-timeout
2018-11-12T14:39:45.448932+00:00 app[web.1]: Operation timeout for the memcache session store. (default is 5000ms)
2018-11-12T14:39:45.448942+00:00 app[web.1]: Default: 5000
2018-11-12T14:39:45.448943+00:00 app[web.1]: --session-store-pool-size
2018-11-12T14:39:45.448945+00:00 app[web.1]: Pool size of the session store connections (default is 10. Has no effect
2018-11-12T14:39:45.448946+00:00 app[web.1]: for 'memcache')
2018-11-12T14:39:45.448948+00:00 app[web.1]: Default: 10
2018-11-12T14:39:45.448949+00:00 app[web.1]: --session-timeout
2018-11-12T14:39:45.448951+00:00 app[web.1]: The number of minutes of inactivity before a user's session is timed
2018-11-12T14:39:45.448953+00:00 app[web.1]: out.
2018-11-12T14:39:45.448954+00:00 app[web.1]: --shutdown-override
2018-11-12T14:39:45.448956+00:00 app[web.1]: Overrides the default behavior and casues Tomcat to ignore lifecycle
2018-11-12T14:39:45.448958+00:00 app[web.1]: failure events rather than shutting down when they occur.
2018-11-12T14:39:45.448959+00:00 app[web.1]: Default: false
2018-11-12T14:39:45.448961+00:00 app[web.1]: --temp-directory
2018-11-12T14:39:45.448962+00:00 app[web.1]: Define the temp directory, default value: ./target/tomcat.PORT
2018-11-12T14:39:45.448963+00:00 app[web.1]: --tomcat-users-location
2018-11-12T14:39:45.448965+00:00 app[web.1]: Location of the tomcat-users.xml file. (relative to the location of the
2018-11-12T14:39:45.448967+00:00 app[web.1]: webapp-runner jar file)
2018-11-12T14:39:45.448968+00:00 app[web.1]: --uri-encoding
2018-11-12T14:39:45.448970+00:00 app[web.1]: Set the URI encoding to be used for the Connector.
2018-11-12T14:39:45.448971+00:00 app[web.1]: --use-body-encoding-for-uri
2018-11-12T14:39:45.448982+00:00 app[web.1]: Set if the entity body encoding should be used for the URI.
2018-11-12T14:39:45.448984+00:00 app[web.1]: Default: false
2018-11-12T14:39:45.448986+00:00 app[web.1]: -A
2018-11-12T14:39:45.448987+00:00 app[web.1]: Allows setting HTTP connector attributes. For example: -Acompression=on
2018-11-12T14:39:45.448989+00:00 app[web.1]: Syntax: -Akey=value
2018-11-12T14:39:45.448990+00:00 app[web.1]: Default: {}
2018-11-12T14:39:45.448992+00:00 app[web.1]: 
2018-11-12T14:39:45.589939+00:00 heroku[web.1]: State changed from starting to crashed
2018-11-12T14:39:48.987659+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=renamedforpostingonline.herokuapp.com request_id=4109dd6b-2f1b-4929-bda4-0bbf2aec78a5 fwd="157.33.247.100" dyno= connect= service= status=503 bytes= protocol=https
2018-11-12T14:42:21.455739+00:00 heroku[web.1]: State changed from crashed to starting
2018-11-12T14:42:21.170154+00:00 app[api]: Release v6 created by user surajdeshmukh023@gmail.com
2018-11-12T14:42:21.170154+00:00 app[api]: Remove WEBAPP_RUNNER_OPTS config vars by user surajdeshmukh023@gmail.com
2018-11-12T14:42:34.354293+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -jar webapp-runner.jar ${WEBAPP_RUNNER_OPTS} --port 33928 ./Pictures/demo-0.0.1-SNAPSHOT.war`
2018-11-12T14:42:36.764389+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2018-11-12T14:42:36.771702+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2018-11-12T14:42:38.015784+00:00 app[web.1]: Expanding demo-0.0.1-SNAPSHOT.war into /app/target/tomcat.33928/webapps/expanded
2018-11-12T14:42:38.015836+00:00 app[web.1]: Adding Context  for /app/target/tomcat.33928/webapps/expanded
2018-11-12T14:42:38.636510+00:00 app[web.1]: Nov 12, 2018 2:42:38 PM org.apache.coyote.AbstractProtocol init
2018-11-12T14:42:38.636522+00:00 app[web.1]: INFO: Initializing ProtocolHandler ["http-nio-33928"]
2018-11-12T14:42:38.714487+00:00 app[web.1]: Nov 12, 2018 2:42:38 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
2018-11-12T14:42:38.714491+00:00 app[web.1]: INFO: Using a shared selector for servlet write/read
2018-11-12T14:42:38.739726+00:00 app[web.1]: Nov 12, 2018 2:42:38 PM org.apache.catalina.core.StandardService startInternal
2018-11-12T14:42:38.739730+00:00 app[web.1]: INFO: Starting service [Tomcat]
2018-11-12T14:42:38.741761+00:00 app[web.1]: Nov 12, 2018 2:42:38 PM org.apache.catalina.core.StandardEngine startInternal
2018-11-12T14:42:38.741765+00:00 app[web.1]: INFO: Starting Servlet Engine: Apache Tomcat/8.5.33
2018-11-12T14:42:38.896896+00:00 heroku[web.1]: State changed from starting to up
2018-11-12T14:42:39.262108+00:00 app[web.1]: Nov 12, 2018 2:42:39 PM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
2018-11-12T14:42:39.262120+00:00 app[web.1]: INFO: No global web.xml found
2018-11-12T14:42:39.456503+00:00 app[web.1]: Nov 12, 2018 2:42:39 PM org.apache.tomcat.util.descriptor.web.WebXml setVersion
2018-11-12T14:42:39.456506+00:00 app[web.1]: WARNING: Unknown version string [4.0]. Default version will be used.
2018-11-12T14:42:47.741228+00:00 app[web.1]: Nov 12, 2018 2:42:47 PM org.apache.jasper.servlet.TldScanner scanJars
2018-11-12T14:42:47.741240+00:00 app[web.1]: INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2018-11-12T14:42:48.068318+00:00 app[web.1]: Nov 12, 2018 2:42:48 PM org.apache.catalina.core.ApplicationContext log
2018-11-12T14:42:48.068331+00:00 app[web.1]: INFO: 1 Spring WebApplicationInitializers detected on classpath
2018-11-12T14:42:48.141385+00:00 app[web.1]: Nov 12, 2018 2:42:48 PM org.apache.coyote.AbstractProtocol start
2018-11-12T14:42:48.141389+00:00 app[web.1]: INFO: Starting ProtocolHandler ["http-nio-33928"]
2018-11-12T14:42:48.392581+00:00 heroku[router]: at=info method=GET path="/" host=renamedforpostingonline.herokuapp.com request_id=9d2b7791-e45e-4f78-bd41-f7541495a6c0 fwd="157.33.247.100" dyno=web.1 connect=0ms service=9026ms status=404 bytes=1230 protocol=https
2018-11-12T14:42:49.086720+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=renamedforpostingonline.herokuapp.com request_id=1beab1cb-39fb-4651-8eca-65204ce64a7f fwd="157.33.247.100" dyno=web.1 connect=0ms service=4ms status=404 bytes=1241 protocol=https
2018-11-12T14:43:04.308218+00:00 heroku[router]: at=info method=GET path="/" host=renamedforpostingonline.herokuapp.com request_id=d4d0709a-3f54-4066-bf16-46170e1f51d3 fwd="157.33.247.100" dyno=web.1 connect=2ms service=15ms status=404 bytes=1230 protocol=https
2018-11-12T14:43:04.826048+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=renamedforpostingonline.herokuapp.com request_id=2436a76f-720b-41fd-8c34-0fdbdb6fc6c5 fwd="157.33.247.100" dyno=web.1 connect=1ms service=7ms status=404 bytes=1241 protocol=https

Я использую spring sts 4 для локальной разработки

1 Ответ

0 голосов
/ 08 декабря 2018

Я тоже столкнулся с точно такой же проблемой.Расширение SpringBootServletInitializer из моего файла SpringBoot решило проблему.Упоминается как ниже.

@SpringBootApplication
public class A extends SpringBootServletInitializer{
   ...
}
...