Hello I am trying to deploy my grails application to my newly installed jetty instance. I installed jetty on ubuntu 12.04 with apt-get install jetty and it’s running completely fine under port 8080.
Then I tried to deploy my small grails application by compiling it to a war-file and moving it to the standard jetty_home/webapps folder and restart jetty. Now the problem begins, whenever I go to my context path in the browser I get this:
HTTP ERROR: 503
Problem accessing /hello. Reason:
SERVICE_UNAVAILABLE
When I check the jetty logs it is almost completely empty except some logging errors?
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
I can’t get it to run my application which is just a hello-world app (I’ve tried with my real app before also). At first I thought it was because of openjre on the deployment machine but then I tried to compile it with openjdk and it still has the same results.
I have also tried to set the hello.war file under the jetty:abs user via chown command. The root app is deployed just like this and I see no reason why my app shouldn’t work.
I’ve checked some threads to see if my installation process is wrong somehow but I can’t find any solution. There is no other errors logged. If I use cat 2013_01_29.stderrout.log it’s empty. Please help me find a solution to my problem, I just want my app up and running asap.
Thanks!
EDIT:
Okay, I downloaded the jar file recommended and now I got some exception about permission denied on my applicationContext. I am still unsure how to continue since I’m kind of confused. I guess this means that jetty don’t have the permission required to write in /var/cache/jetty ?
2013-01-29 23:31:27.885:INFO::jetty-6.1.24
2013-01-29 23:31:27.945:INFO::Deploy /etc/jetty/contexts/javadoc.xml -> org.mortbay.jetty.handler.ContextHandler@ed42d08{/javadoc,file:/usr/share/jetty/javadoc}
2013-01-29 23:31:28.008:INFO::Extract file:/var/lib/jetty/webapps/hello.war to /var/cache/jetty/data/Jetty_0_0_0_0_8080_hello.war__hello__.yjv6m1/webapp
2013-01-29 23:31:28.051:WARN::Failed startup of context org.mortbay.jetty.webapp.WebAppContext@7786df0f{/hello,file:/var/lib/jetty/webapps/hello.war}
java.io.FileNotFoundException: /var/cache/jetty/data/Jetty_0_0_0_0_8080_hello.war__hello__.yjv6m1/webapp/WEB-INF/applicationContext.xml (Permission denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:209)
at java.io.FileOutputStream.<init>(FileOutputStream.java:160)
at org.mortbay.resource.JarResource.extract(JarResource.java:215)
at org.mortbay.jetty.webapp.WebAppContext.resolveWebApp(WebAppContext.java:942)
at org.mortbay.jetty.webapp.WebAppContext.getWebInf(WebAppContext.java:800)
at org.mortbay.jetty.webapp.WebInfConfiguration.configureClassLoader(WebInfConfiguration.java:62)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:457)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:985)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.mortbay.start.Main.invokeMain(Main.java:194)
at org.mortbay.start.Main.start(Main.java:534)
at org.mortbay.jetty.start.daemon.Bootstrap.start(Bootstrap.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:243)
2013-01-29 23:31:28.078:INFO::NO JSP Support for , did not find org.apache.jasper.servlet.JspServlet
2013-01-29 23:31:28.118:INFO::Opened /var/log/jetty/2013_01_29.request.log
2013-01-29 23:31:28.143:INFO::Started SelectChannelConnector@0.0.0.0:8080
It looks like you don’t have write permission to unpack the war file – it’s failing to write
/var/cache/jetty/data/Jetty_0_0_0_0_8080_hello.war__hello__.yjv6m1/webapp/WEB-INF/applicationContext.xml. Thejava.io.FileNotFoundExceptionis confusing but the“Permission denied” message is telling you the real problem.
Either grant yourself write permission under the
/var/cache/jetty/data/directory, or run Jetty as a user that has write permission, or change the directory where Jetty expands war files to a location you can write to.