Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.


Paul Yorde
Paul Yorde
10,497 Points

What are possible causes of Jetty Server Error in Gradle/Spark project?

So, this is related to building a spark application with gradle. Jetty should be running an embedded localhost server, however that's where the issue is happening.

I've tried this in two different editors on two different computers and got the same results as discussed below.

I am getting this result when I run main: STARTED @1175ms org.eclipse.jetty.server.Server@387f17e4. It will sit for a while and then show that message again. Any ideas?

I ran lsof -i:4567 and according to this its listening, I guess: java 89378 origin 51u IPv6 0x26bbf3e24d065a41 0t0 TCP *:tram (LISTEN). I also killed that process and tried to run main again, but same results.

and after a while the messages says: [org.eclipse.jetty.server.session.HashSessionManager@6e14b6c0Timer] DEBUG org.eclipse.jetty.server.session - Scavenging sessions at 1468615775992

I've also tried setting the port to 9090 before the call to get in .Main: port(9090);

The results is error 404 not found. Also the result for 4567.

I've also tried awaitInitialization(); also before the call to get. Then it just sets a waits with out any messages. So, it seems the server is not initializing. What does this mean???

Should I have a web.xml file?