Question

I am trying to deploy Spring roo project on Heroku. Everything went just fine. The deployment process was successful. but after running it on server, I got Following error:

HTTP ERROR: 503

Problem accessing /. Reason:

Service Unavailable 

Powered by Jetty://

The application is working perfectly on localhost:8080. but it gives 503 error when run from heroku.

I am following this URL (step by step): https://github.com/heroku/devcenter-spring-mvc-hibernate

This is my logs:

Palak@PSD ~/Documents/workspace-sts-3.4.0.RELEASE/T2TestHeroku4 (master)
$ heroku logs
←[36m2014-01-26T14:50:49.218169+00:00 app[web.1]:←[0m   at org.springframework.w
eb.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:1
12)
←[36m2014-01-26T14:50:48.663478+00:00 app[web.1]:←[0m   at org.eclipse.jetty.ser
vlet.ServletContextHandler.startContext(ServletContextHandler.java:229)
←[36m2014-01-26T14:50:49.219398+00:00 app[web.1]:←[0m   at org.mortbay.jetty.run
ner.Runner.run(Runner.java:447)
←[36m2014-01-26T14:50:49.219398+00:00 app[web.1]:←[0m   at org.eclipse.jetty.ser
ver.Server.doStart(Server.java:258)
←[36m2014-01-26T14:50:49.218986+00:00 app[web.1]:←[0m   at org.eclipse.jetty.ser
ver.handler.HandlerCollection.doStart(HandlerCollection.java:224)
←[36m2014-01-26T14:50:49.219398+00:00 app[web.1]:←[0m   at org.eclipse.jetty.uti
l.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
←[36m2014-01-26T14:50:49.219398+00:00 app[web.1]:←[0m   at org.eclipse.jetty.ser
ver.handler.HandlerWrapper.doStart(HandlerWrapper.java:89)
←[36m2014-01-26T14:50:49.219398+00:00 app[web.1]:←[0m   at org.eclipse.jetty.uti
l.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
←[36m2014-01-26T14:50:49.218986+00:00 app[web.1]:←[0m   at org.eclipse.jetty.uti
l.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
←[36m2014-01-26T14:50:49.219398+00:00 app[web.1]:←[0m   at java.lang.ClassLoader
.defineClass(ClassLoader.java:634)
←[36m2014-01-26T14:50:49.219398+00:00 app[web.1]:←[0m   at org.mortbay.jetty.run
ner.Runner.main(Runner.java:586)
←[36m2014-01-26T14:50:49.219398+00:00 app[web.1]:←[0m   at java.lang.ClassLoader
.defineClass1(Native Method)
←[36m2014-01-26T14:50:49.219398+00:00 app[web.1]:←[0m Caused by:
←[36m2014-01-26T14:50:49.219398+00:00 app[web.1]:←[0m java.lang.UnsupportedClass
VersionError: com/palak/domain/Visit : Unsupported major.minor version 51.0
←[36m2014-01-26T14:50:49.220168+00:00 app[web.1]:←[0m   at java.security.SecureC
lassLoader.defineClass(SecureClassLoader.java:142)
←[36m2014-01-26T14:50:49.220168+00:00 app[web.1]:←[0m   at java.net.URLClassLoad
er.defineClass(URLClassLoader.java:277)
←[36m2014-01-26T14:50:49.220168+00:00 app[web.1]:←[0m   at java.net.URLClassLoad
er.access$000(URLClassLoader.java:73)
←[36m2014-01-26T14:50:49.222801+00:00 app[web.1]:←[0m   at org.eclipse.jetty.ser
ver.handler.ContextHandler.doStart(ContextHandler.java:586)
←[36m2014-01-26T14:50:49.222801+00:00 app[web.1]:←[0m   at org.eclipse.jetty.web
app.WebAppContext.doStart(WebAppContext.java:449)
←[36m2014-01-26T14:50:49.222801+00:00 app[web.1]:←[0m   at org.eclipse.jetty.uti
l.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
←[36m2014-01-26T14:50:49.222801+00:00 app[web.1]:←[0m   at org.eclipse.jetty.ser
ver.handler.HandlerCollection.doStart(HandlerCollection.java:224)
←[36m2014-01-26T14:50:49.222801+00:00 app[web.1]:←[0m   at org.eclipse.jetty.ser
ver.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:164)
←[36m2014-01-26T14:50:49.220168+00:00 app[web.1]:←[0m   at java.lang.Class.forNa
me0(Native Method)
←[36m2014-01-26T14:50:49.220168+00:00 app[web.1]:←[0m   at org.eclipse.jetty.web
app.WebAppClassLoader.loadClass(WebAppClassLoader.java:366)
←[36m2014-01-26T14:50:49.220680+00:00 app[web.1]:←[0m   at org.springframework.b
eans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractA
utowireCapableBeanFactory.java:1509)
←[36m2014-01-26T14:50:49.220680+00:00 app[web.1]:←[0m   at org.hibernate.interna
l.util.ReflectHelper.classForName(ReflectHelper.java:192)
←[36m2014-01-26T14:50:49.220680+00:00 app[web.1]:←[0m   at org.hibernate.ejb.pac
kaging.NativeScanner.getClassesInJar(NativeScanner.java:136)
←[36m2014-01-26T14:50:49.220680+00:00 app[web.1]:←[0m   at org.hibernate.ejb.Ejb
3Configuration.addScannedEntries(Ejb3Configuration.java:487)
←[36m2014-01-26T14:50:49.220680+00:00 app[web.1]:←[0m   at org.hibernate.ejb.Ejb
3Configuration.scanForClasses(Ejb3Configuration.java:861)
←[36m2014-01-26T14:50:49.220168+00:00 app[web.1]:←[0m   at java.net.URLClassLoad
er$1.run(URLClassLoader.java:212)
←[36m2014-01-26T14:50:49.221982+00:00 app[web.1]:←[0m   at org.springframework.b
eans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:29
6)
←[36m2014-01-26T14:50:49.221982+00:00 app[web.1]:←[0m   at org.springframework.c
ontext.support.AbstractApplicationContext.finishBeanFactoryInitialization(Abstra
ctApplicationContext.java:922)
←[36m2014-01-26T14:50:49.220168+00:00 app[web.1]:←[0m   at org.eclipse.jetty.web
app.WebAppClassLoader.loadClass(WebAppClassLoader.java:404)
←[36m2014-01-26T14:50:49.220680+00:00 app[web.1]:←[0m   at org.hibernate.ejb.Hib
ernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:
75)
←[36m2014-01-26T14:50:49.221982+00:00 app[web.1]:←[0m   at org.springframework.b
eans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
←[36m2014-01-26T14:50:49.221982+00:00 app[web.1]:←[0m   at org.springframework.b
eans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAut
owireCapableBeanFactory.java:521)
←[36m2014-01-26T14:50:49.220680+00:00 app[web.1]:←[0m   at org.springframework.o
rm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(L
ocalContainerEntityManagerFactoryBean.java:288)
←[36m2014-01-26T14:50:49.220168+00:00 app[web.1]:←[0m   at java.security.AccessC
ontroller.doPrivileged(Native Method)
←[36m2014-01-26T14:50:49.220168+00:00 app[web.1]:←[0m   at java.lang.Class.forNa
me(Class.java:188)
←[36m2014-01-26T14:50:49.222801+00:00 app[web.1]:←[0m   at org.eclipse.jetty.web
app.WebAppContext.startContext(WebAppContext.java:1208)
←[36m2014-01-26T14:50:49.221982+00:00 app[web.1]:←[0m   at org.springframework.w
eb.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.
java:389)
←[36m2014-01-26T14:50:49.222801+00:00 app[web.1]:←[0m   at org.springframework.w
eb.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
←[36m2014-01-26T14:50:49.222801+00:00 app[web.1]:←[0m   at org.springframework.w
eb.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:1
12)
←[36m2014-01-26T14:50:49.220168+00:00 app[web.1]:←[0m   at java.net.URLClassLoad
er.findClass(URLClassLoader.java:205)
←[36m2014-01-26T14:50:49.220680+00:00 app[web.1]:←[0m   at org.springframework.b
eans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(Abstra
ctAutowireCapableBeanFactory.java:1571)
←[36m2014-01-26T14:50:49.220680+00:00 app[web.1]:←[0m   at org.springframework.o
rm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManager
FactoryBean.java:310)
←[36m2014-01-26T14:50:49.221982+00:00 app[web.1]:←[0m   at org.springframework.b
eans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutow
ireCapableBeanFactory.java:458)
←[36m2014-01-26T14:50:49.221982+00:00 app[web.1]:←[0m   at org.springframework.b
eans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonB
eanRegistry.java:223)
←[36m2014-01-26T14:50:49.221982+00:00 app[web.1]:←[0m   at org.springframework.b
eans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)

←[36m2014-01-26T14:50:49.224074+00:00 app[web.1]:←[0m   at org.eclipse.jetty.ser
ver.handler.HandlerCollection.doStart(HandlerCollection.java:224)
←[36m2014-01-26T14:50:49.220680+00:00 app[web.1]:←[0m   at org.hibernate.ejb.Ejb
3Configuration.configure(Ejb3Configuration.java:606)
←[36m2014-01-26T14:50:49.221982+00:00 app[web.1]:←[0m   at org.springframework.c
ontext.support.AbstractApplicationContext.getBean(AbstractApplicationContext.jav
a:1117)
←[36m2014-01-26T14:50:49.221982+00:00 app[web.1]:←[0m   at org.springframework.c
ontext.support.AbstractApplicationContext.refresh(AbstractApplicationContext.jav
a:479)
←[36m2014-01-26T14:50:49.224074+00:00 app[web.1]:←[0m   at org.eclipse.jetty.uti
l.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
←[36m2014-01-26T14:50:49.224074+00:00 app[web.1]:←[0m   at org.mortbay.jetty.run
ner.Runner.run(Runner.java:447)
←[36m2014-01-26T14:50:49.224074+00:00 app[web.1]:←[0m   at org.mortbay.jetty.run
ner.Runner.main(Runner.java:586)
←[36m2014-01-26T14:50:49.268783+00:00 app[web.1]:←[0m 2014-01-26 14:50:49.268:IN
FO::Started SelectChannelConnector@0.0.0.0:56267 STARTING
←[36m2014-01-26T14:50:49.222801+00:00 app[web.1]:←[0m   at org.eclipse.jetty.ser
ver.handler.ContextHandler.startContext(ContextHandler.java:640)
←[36m2014-01-26T14:50:49.222801+00:00 app[web.1]:←[0m   at org.eclipse.jetty.ser
vlet.ServletContextHandler.startContext(ServletContextHandler.java:229)
←[36m2014-01-26T14:50:49.224074+00:00 app[web.1]:←[0m   at org.eclipse.jetty.uti
l.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
←[36m2014-01-26T14:50:49.224074+00:00 app[web.1]:←[0m   at org.eclipse.jetty.uti
l.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
←[36m2014-01-26T14:50:49.224074+00:00 app[web.1]:←[0m   at org.eclipse.jetty.ser
ver.Server.doStart(Server.java:258)
←[36m2014-01-26T14:50:49.224074+00:00 app[web.1]:←[0m   at org.eclipse.jetty.ser
ver.handler.HandlerWrapper.doStart(HandlerWrapper.java:89)
←[36m2014-01-26T14:50:51.789872+00:00 heroku[web.1]:←[0m Stopping all processes
with SIGTERM
←[33m2014-01-26T14:50:52.186417+00:00 heroku[router]:←[0m at=info method=GET pat
h=/favicon.ico host=rocky-sea-1233.herokuapp.com request_id=8133a871-4aa9-4230-b
52a-115f7efa7039 fwd="219.91.178.205" dyno=web.1 connect=3ms service=5ms status=
503 bytes=1298
←[36m2014-01-26T14:50:52.307161+00:00 app[web.1]:←[0m 2014-01-26 14:50:52.306:IN
FO:/:Closing Spring root WebApplicationContext
←[36m2014-01-26T14:50:52.308821+00:00 app[web.1]:←[0m 2014-01-26 14:50:52.308:IN
FO::stopped o.e.j.w.WebAppContext{/,file:/app/target/T2TestHeroku4-0.1.0.BUILD-S
NAPSHOT/},file:/app/target/T2TestHeroku4-0.1.0.BUILD-SNAPSHOT.war
←[36m2014-01-26T14:50:52.362575+00:00 app[web.1]:←[0m 2014-01-26 14:50:52.362:WA
RN::1 threads could not be stopped
←[36m2014-01-26T14:50:53.588847+00:00 heroku[web.1]:←[0m Process exited with sta
tus 143
←[33m2014-01-26T14:50:55.575157+00:00 heroku[router]:←[0m at=info method=GET pat
h=/favicon.ico host=rocky-sea-1233.herokuapp.com request_id=9d76ae57-db66-4ff2-9
36a-8d85cc5095b7 fwd="219.91.178.205" dyno=web.1 connect=5ms service=9ms status=
503 bytes=1298
←[33m2014-01-26T14:50:54.643408+00:00 heroku[router]:←[0m at=info method=GET pat
h=/ host=rocky-sea-1233.herokuapp.com request_id=7a212421-9b19-429b-b94b-c61ae76
5d597 fwd="219.91.178.205" dyno=web.1 connect=100ms service=198ms status=503 byt
es=1287
←[33m2014-01-26T14:50:51.164439+00:00 heroku[router]:←[0m at=info method=GET pat
h=/ host=rocky-sea-1233.herokuapp.com request_id=42ff31b7-5101-4dc3-8826-1fa4863
23ef6 fwd="219.91.178.205" dyno=web.1 connect=3ms service=28ms status=503 bytes=
1287
←[32m2014-01-26T14:50:29.108018+00:00 heroku[api]:←[0m Scale to web=1 by palaksd
arji@gmail.com
←[32m2014-01-26T14:50:35.837958+00:00 heroku[api]:←[0m Attach HEROKU_POSTGRESQL_
RED resource by palaksdarji@gmail.com
←[32m2014-01-26T14:50:35.865107+00:00 heroku[api]:←[0m Release v3 created by pal
aksdarji@gmail.com
←[32m2014-01-26T14:50:36.011041+00:00 heroku[api]:←[0m Release v4 created by pal
aksdarji@gmail.com
←[32m2014-01-26T14:50:35.993674+00:00 heroku[api]:←[0m Add DATABASE_URL config b
y palaksdarji@gmail.com
←[32m2014-01-26T14:50:36.096492+00:00 heroku[api]:←[0m Add PATH, JAVA_OPTS, MAVE
N_OPTS config by palaksdarji@gmail.com
←[32m2014-01-26T14:50:36.119556+00:00 heroku[api]:←[0m Release v5 created by pal
aksdarji@gmail.com
←[32m2014-01-26T14:50:36.211971+00:00 heroku[api]:←[0m Release v6 created by pal
aksdarji@gmail.com
←[32m2014-01-26T14:50:36.193611+00:00 heroku[api]:←[0m Deploy 5cdbec4 by palaksd
arji@gmail.com
←[33m2014-01-26T14:53:55.184564+00:00 heroku[router]:←[0m at=info method=GET pat
h=/favicon.ico host=rocky-sea-1233.herokuapp.com request_id=70d422cd-5479-4654-9
493-e0605215ee48 fwd="219.91.178.205" dyno=web.1 connect=1ms service=5ms status=
503 bytes=1298
←[33m2014-01-26T14:53:54.368373+00:00 heroku[router]:←[0m at=info method=GET pat
h=/ host=rocky-sea-1233.herokuapp.com request_id=a2031776-a9d8-4622-9cd8-885e968
bf686 fwd="219.91.178.205" dyno=web.1 connect=2ms service=6ms status=503 bytes=1
287
←[33m2014-01-26T15:21:31.878758+00:00 heroku[router]:←[0m at=info method=GET pat
h=/ host=rocky-sea-1233.herokuapp.com request_id=5
fceb607-3079-4253-9ee6-6ddb05a06f51 fwd="219.91.178.205" dyno=web.1 connect=2ms
service=4ms status=503 bytes=1287
←[33m2014-01-26T15:21:32.670790+00:00 heroku[router]:←[0m at=info method=GET pat
h=/favicon.ico host=rocky-sea-1233.herokuapp.com request_id=d8f1ac13-c76b-4ab3-b
911-b165d90b8073 fwd="219.91.178.205" dyno=web.1 connect=1ms service=5ms status=
503 bytes=1298
←[33m2014-01-26T15:27:56.539314+00:00 heroku[router]:←[0m at=info method=GET pat
h=/ host=rocky-sea-1233.herokuapp.com request_id=303ce511-b1de-4dec-931c-a4437ef
5e775 fwd="219.91.178.205" dyno=web.1 connect=2ms service=5ms status=503 bytes=1
287
←[33m2014-01-26T15:27:58.432719+00:00 heroku[router]:←[0m at=info method=GET pat
h=/favicon.ico host=rocky-sea-1233.herokuapp.com request_id=0cb2b55e-edc4-4405-9
be7-27c1a7961d32 fwd="219.91.178.205" dyno=web.1 connect=0ms service=3ms status=
503 bytes=1298
←[33m2014-01-26T15:28:01.702016+00:00 heroku[router]:←[0m at=info method=GET pat
h=/ host=rocky-sea-1233.herokuapp.com request_id=49386bee-3420-4b50-9693-03186f2
191b1 fwd="219.91.178.205" dyno=web.1 connect=0ms service=5ms status=503 bytes=1
287
←[33m2014-01-26T15:28:03.598936+00:00 heroku[router]:←[0m at=info method=GET pat
h=/favicon.ico host=rocky-sea-1233.herokuapp.com request_id=0a285513-d915-463a-a
f9d-46d1a94bc4c2 fwd="219.91.178.205" dyno=web.1 connect=1ms service=2ms status=
503 bytes=1298
←[33m2014-01-26T15:41:09.716057+00:00 heroku[router]:←[0m at=info method=GET pat
h=/ host=rocky-sea-1233.herokuapp.com request_id=de39e4f3-0590-4b02-b379-3d7525e
67299 fwd="219.91.178.205" dyno=web.1 connect=2ms service=5ms status=503 bytes=1
287
←[33m2014-01-26T15:41:15.640819+00:00 heroku[router]:←[0m at=info method=GET pat
h=/favicon.ico host=rocky-sea-1233.herokuapp.com request_id=d8cb144e-e6a8-4d29-8
167-5c54bf488822 fwd="219.91.178.205" dyno=web.1 connect=1ms service=6ms status=
503 bytes=1298
←[33m2014-01-26T15:41:14.718912+00:00 heroku[router]:←[0m at=info method=GET pat
h=/ host=rocky-sea-1233.herokuapp.com request_id=432042b2-27b9-4818-a6a5-ef5a4a6
aa33a fwd="219.91.178.205" dyno=web.1 connect=90ms service=149ms status=503 byte
s=1287
←[33m2014-01-26T15:41:11.410797+00:00 heroku[router]:←[0m at=info method=GET pat
h=/favicon.ico host=rocky-sea-1233.herokuapp.com request_id=84bac7f3-e0aa-4985-9
fe7-d73535308182 fwd="219.91.178.205" dyno=web.1 connect=2ms service=4ms status=
503 bytes=1298
←[33m2014-01-26T15:42:48.127512+00:00 heroku[router]:←[0m at=info method=GET pat
h=/ host=rocky-sea-1233.herokuapp.com request_id=e3fd9715-049d-4bef-96b7-6c56828
554ef fwd="219.91.178.205" dyno=web.1 connect=60ms service=24ms status=503 bytes
=1287
←[33m2014-01-26T15:42:49.045254+00:00 heroku[router]:←[0m at=info method=GET pat
h=/favicon.ico host=rocky-sea-1233.herokuapp.com request_id=4c3503ee-4b98-4b6f-9
473-000f86534375 fwd="219.91.178.205" dyno=web.1 connect=1ms service=3ms status=
503 bytes=1298
←[33m2014-01-26T15:43:04.845982+00:00 heroku[router]:←[0m at=info method=GET pat
h=/ host=rocky-sea-1233.herokuapp.com request_id=6564a968-9d2c-4328-aa3b-07b41f8
d2b42 fwd="219.91.178.205" dyno=web.1 connect=2ms service=2ms status=503 bytes=1
287
←[33m2014-01-26T15:43:05.642431+00:00 heroku[router]:←[0m at=info method=GET pat
h=/favicon.ico host=rocky-sea-1233.herokuapp.com request_id=91bb9833-30a5-4104-9
bed-71e75875c704 fwd="219.91.178.205" dyno=web.1 connect=3ms service=8ms status=
503 bytes=1298
←[33m2014-01-26T16:07:41.998822+00:00 heroku[router]:←[0m at=info method=GET pat
h=/ host=rocky-sea-1233.herokuapp.com request_id=51e13f2f-1cbd-4979-9cfc-77fd90c
8fec6 fwd="219.91.178.205" dyno=web.1 connect=13ms service=18ms status=503 bytes
=1287
←[33m2014-01-26T16:07:43.143873+00:00 heroku[router]:←[0m at=info method=GET pat
h=/favicon.ico host=rocky-sea-1233.herokuapp.com request_id=11b06740-8e66-4a86-a
3d3-236f36627734 fwd="219.91.178.205" dyno=web.1 connect=3ms service=3ms status=
503 bytes=1298
←[33m2014-01-26T16:08:40.617563+00:00 heroku[router]:←[0m at=info method=GET pat
h=/ host=rocky-sea-1233.herokuapp.com request_id=6344ffa7-bab7-4ef3-b6a5-cff5374
1f9cc fwd="219.91.178.205" dyno=web.1 connect=1ms service=3ms status=503 bytes=1
287
←[33m2014-01-26T16:08:41.473618+00:00 heroku[router]:←[0m at=info method=GET pat
h=/favicon.ico host=rocky-sea-1233.herokuapp.com request_id=f5ebe12d-21fd-427f-a
4b4-6fa95ea85678 fwd="219.91.178.205" dyno=web.1 connect=0ms service=4ms status=
503 bytes=1298
Was it helpful?

Solution

Well, I got solution.. The issue was following error from my logs:

java.lang.UnsupportedClassVersionError: com/palak/domain/Visit : Unsupported major.minor version 51.0

java.lang.UnsupportedClassVersionError happens because of a higher JDK during compile time and lower JDK during runtime. My classes are built up using java 7. and I was running my app using openJdk 6 (default). All i need to do is to add new file to my root directory of project indicating that I want to use particular version of java,In my case, I want to use java 7, for instance.

So, I have to make new file "system.properties" and paste this line inside of it: java.runtime.version=1.7

Now reloaded application and uploaded again from git. Now Everything works Perfect. Hope this helps someone. Cheers. :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top