Having trouble deploying simple web app in Jettyproblem using UserService of google appengineServlet Flow on a Request via Ajaxjetty Hello World Example not compilingdoes process still continue after client disconnectsGWT deploy on Jetty Server: java.lang.IllegalStateException: No such servlet: eventServiceImplhow to prevent servlet from being invoked directly through browserWatermarking dynamically created pdf's in google app engineI want to used lang to mark languages.In the process of authentication,This parameter is lostHow to run jasper report in servlet jsp mvcSending JWT Token in the body of response Java Spring
Should disabled buttons give feedback when clicked?
If your plane is out-of-control, why does military training instruct releasing the joystick to neutralize controls?
What do the horizontal lines in a P-V phase diagram mean?
SOLVED - GFCI - should my neutral and ground have continuity?
Is there any word for "disobedience to God"?
Why were Er and Onan punished if they were under 20?
How do Windows version numbers work?
Machine learning and operations research projects
Why was hardware diversification an asset for the IBM PC ecosystem?
Is Arc Length always irrational between two rational points?
Domain of definition of Laplace Operator on L^2
How were Martello towers supposed to work?
Do you know your 'KVZ's?
Did any of the founding fathers anticipate Lysander Spooner's criticism of the constitution?
How is angular momentum conserved for the orbiting body if the centripetal force disappears?
Why didn't Thanos kill all the Dwarves on Nidavellir?
Can fluent English speakers distinguish “steel”, “still” and “steal”?
How did the hit man miss?
Can I call 112 to check a police officer's identity in the Czech Republic?
Was I subtly told to resign?
Turning arguments into exponents
For a hashing function like MD5, how similar can two plaintext strings be and still generate the same hash?
Flatten array with OPENJSON: OPENJSON on a value that may not be an array? [ [1] ], vs [1]
Is Trump personally blocking people on Twitter?
Having trouble deploying simple web app in Jetty
problem using UserService of google appengineServlet Flow on a Request via Ajaxjetty Hello World Example not compilingdoes process still continue after client disconnectsGWT deploy on Jetty Server: java.lang.IllegalStateException: No such servlet: eventServiceImplhow to prevent servlet from being invoked directly through browserWatermarking dynamically created pdf's in google app engineI want to used lang to mark languages.In the process of authentication,This parameter is lostHow to run jasper report in servlet jsp mvcSending JWT Token in the body of response Java Spring
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am using Jetty to write a simple server.
SimpleServer.java:
public class SimpleServer
public static void main(String[] args) throws Exception
Server server = new Server(8080);
server.setHandler(new ServerHandler());
server.start();
server.join();
ServerHandler.java:
public class ServerHandler extends AbstractHandler
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
response.setContentType("text/html; charset=utf-8");
response.setStatus(HttpServletResponse.SC_OK);
baseRequest.setHandled(true);
response.getWriter().println("<h1>Hello World</h1>");
I use maven to package the files up into a war file and then throw them in the jetty/webapps directory. I have the war file named root.war, so that means the context is at localhost:8080/. But when I access it, I get the following error in the browser:
HTTP ERROR 503
Problem accessing /. Reason:
Service Unavailable
In the console, I get a java.lang.reflect.InvocationTargetException
. This project works and runs in IntelliJ. It's only when I put it in the jetty/webapps folder that I get errors.
java jetty
add a comment |
I am using Jetty to write a simple server.
SimpleServer.java:
public class SimpleServer
public static void main(String[] args) throws Exception
Server server = new Server(8080);
server.setHandler(new ServerHandler());
server.start();
server.join();
ServerHandler.java:
public class ServerHandler extends AbstractHandler
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
response.setContentType("text/html; charset=utf-8");
response.setStatus(HttpServletResponse.SC_OK);
baseRequest.setHandled(true);
response.getWriter().println("<h1>Hello World</h1>");
I use maven to package the files up into a war file and then throw them in the jetty/webapps directory. I have the war file named root.war, so that means the context is at localhost:8080/. But when I access it, I get the following error in the browser:
HTTP ERROR 503
Problem accessing /. Reason:
Service Unavailable
In the console, I get a java.lang.reflect.InvocationTargetException
. This project works and runs in IntelliJ. It's only when I put it in the jetty/webapps folder that I get errors.
java jetty
Post your web.xml
– Akshay Mulgavkar
Mar 26 at 3:57
add a comment |
I am using Jetty to write a simple server.
SimpleServer.java:
public class SimpleServer
public static void main(String[] args) throws Exception
Server server = new Server(8080);
server.setHandler(new ServerHandler());
server.start();
server.join();
ServerHandler.java:
public class ServerHandler extends AbstractHandler
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
response.setContentType("text/html; charset=utf-8");
response.setStatus(HttpServletResponse.SC_OK);
baseRequest.setHandled(true);
response.getWriter().println("<h1>Hello World</h1>");
I use maven to package the files up into a war file and then throw them in the jetty/webapps directory. I have the war file named root.war, so that means the context is at localhost:8080/. But when I access it, I get the following error in the browser:
HTTP ERROR 503
Problem accessing /. Reason:
Service Unavailable
In the console, I get a java.lang.reflect.InvocationTargetException
. This project works and runs in IntelliJ. It's only when I put it in the jetty/webapps folder that I get errors.
java jetty
I am using Jetty to write a simple server.
SimpleServer.java:
public class SimpleServer
public static void main(String[] args) throws Exception
Server server = new Server(8080);
server.setHandler(new ServerHandler());
server.start();
server.join();
ServerHandler.java:
public class ServerHandler extends AbstractHandler
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
response.setContentType("text/html; charset=utf-8");
response.setStatus(HttpServletResponse.SC_OK);
baseRequest.setHandled(true);
response.getWriter().println("<h1>Hello World</h1>");
I use maven to package the files up into a war file and then throw them in the jetty/webapps directory. I have the war file named root.war, so that means the context is at localhost:8080/. But when I access it, I get the following error in the browser:
HTTP ERROR 503
Problem accessing /. Reason:
Service Unavailable
In the console, I get a java.lang.reflect.InvocationTargetException
. This project works and runs in IntelliJ. It's only when I put it in the jetty/webapps folder that I get errors.
java jetty
java jetty
asked Mar 26 at 3:55
Logan PhillipsLogan Phillips
3032 silver badges7 bronze badges
3032 silver badges7 bronze badges
Post your web.xml
– Akshay Mulgavkar
Mar 26 at 3:57
add a comment |
Post your web.xml
– Akshay Mulgavkar
Mar 26 at 3:57
Post your web.xml
– Akshay Mulgavkar
Mar 26 at 3:57
Post your web.xml
– Akshay Mulgavkar
Mar 26 at 3:57
add a comment |
1 Answer
1
active
oldest
votes
Your example codebase is written using the Jetty Handler
API.
A WAR file expects the Servlet API, not the Jetty Handler API.
If you want to continue using the Jetty Handler
API, then you'll be staying with embedded-jetty
and doing everything without a WAR file.
If you want a WAR file, then you'll have to not use the Jetty Handler
API.
Migrate your code to using the Servlet API, and add a reference to it in your Web Descriptor (WEB-INF/web.xml
). That will produce a proper WAR file that can be deployed.
public class ServerServlet extends HttpServlet
public void doGet(HttpServletRequest request, HttpServletResponse response)
response.setContentType("text/html; charset=utf-8");
response.setStatus(HttpServletResponse.SC_OK);
response.getWriter().println("<h1>Hello World</h1>");
Note: You can optionally, you can use the Servlet API Annotations instead of the WEB-INF/web.xml
, but know that you'll want your $jetty.base
instance directory configured to have the annotations
module enabled.
Okay, this makes sense. I didn't pick this up when going through the eclipse documentation.
– Logan Phillips
Mar 26 at 20:55
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55349617%2fhaving-trouble-deploying-simple-web-app-in-jetty%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Your example codebase is written using the Jetty Handler
API.
A WAR file expects the Servlet API, not the Jetty Handler API.
If you want to continue using the Jetty Handler
API, then you'll be staying with embedded-jetty
and doing everything without a WAR file.
If you want a WAR file, then you'll have to not use the Jetty Handler
API.
Migrate your code to using the Servlet API, and add a reference to it in your Web Descriptor (WEB-INF/web.xml
). That will produce a proper WAR file that can be deployed.
public class ServerServlet extends HttpServlet
public void doGet(HttpServletRequest request, HttpServletResponse response)
response.setContentType("text/html; charset=utf-8");
response.setStatus(HttpServletResponse.SC_OK);
response.getWriter().println("<h1>Hello World</h1>");
Note: You can optionally, you can use the Servlet API Annotations instead of the WEB-INF/web.xml
, but know that you'll want your $jetty.base
instance directory configured to have the annotations
module enabled.
Okay, this makes sense. I didn't pick this up when going through the eclipse documentation.
– Logan Phillips
Mar 26 at 20:55
add a comment |
Your example codebase is written using the Jetty Handler
API.
A WAR file expects the Servlet API, not the Jetty Handler API.
If you want to continue using the Jetty Handler
API, then you'll be staying with embedded-jetty
and doing everything without a WAR file.
If you want a WAR file, then you'll have to not use the Jetty Handler
API.
Migrate your code to using the Servlet API, and add a reference to it in your Web Descriptor (WEB-INF/web.xml
). That will produce a proper WAR file that can be deployed.
public class ServerServlet extends HttpServlet
public void doGet(HttpServletRequest request, HttpServletResponse response)
response.setContentType("text/html; charset=utf-8");
response.setStatus(HttpServletResponse.SC_OK);
response.getWriter().println("<h1>Hello World</h1>");
Note: You can optionally, you can use the Servlet API Annotations instead of the WEB-INF/web.xml
, but know that you'll want your $jetty.base
instance directory configured to have the annotations
module enabled.
Okay, this makes sense. I didn't pick this up when going through the eclipse documentation.
– Logan Phillips
Mar 26 at 20:55
add a comment |
Your example codebase is written using the Jetty Handler
API.
A WAR file expects the Servlet API, not the Jetty Handler API.
If you want to continue using the Jetty Handler
API, then you'll be staying with embedded-jetty
and doing everything without a WAR file.
If you want a WAR file, then you'll have to not use the Jetty Handler
API.
Migrate your code to using the Servlet API, and add a reference to it in your Web Descriptor (WEB-INF/web.xml
). That will produce a proper WAR file that can be deployed.
public class ServerServlet extends HttpServlet
public void doGet(HttpServletRequest request, HttpServletResponse response)
response.setContentType("text/html; charset=utf-8");
response.setStatus(HttpServletResponse.SC_OK);
response.getWriter().println("<h1>Hello World</h1>");
Note: You can optionally, you can use the Servlet API Annotations instead of the WEB-INF/web.xml
, but know that you'll want your $jetty.base
instance directory configured to have the annotations
module enabled.
Your example codebase is written using the Jetty Handler
API.
A WAR file expects the Servlet API, not the Jetty Handler API.
If you want to continue using the Jetty Handler
API, then you'll be staying with embedded-jetty
and doing everything without a WAR file.
If you want a WAR file, then you'll have to not use the Jetty Handler
API.
Migrate your code to using the Servlet API, and add a reference to it in your Web Descriptor (WEB-INF/web.xml
). That will produce a proper WAR file that can be deployed.
public class ServerServlet extends HttpServlet
public void doGet(HttpServletRequest request, HttpServletResponse response)
response.setContentType("text/html; charset=utf-8");
response.setStatus(HttpServletResponse.SC_OK);
response.getWriter().println("<h1>Hello World</h1>");
Note: You can optionally, you can use the Servlet API Annotations instead of the WEB-INF/web.xml
, but know that you'll want your $jetty.base
instance directory configured to have the annotations
module enabled.
answered Mar 26 at 13:12
Joakim ErdfeltJoakim Erdfelt
34.4k4 gold badges62 silver badges98 bronze badges
34.4k4 gold badges62 silver badges98 bronze badges
Okay, this makes sense. I didn't pick this up when going through the eclipse documentation.
– Logan Phillips
Mar 26 at 20:55
add a comment |
Okay, this makes sense. I didn't pick this up when going through the eclipse documentation.
– Logan Phillips
Mar 26 at 20:55
Okay, this makes sense. I didn't pick this up when going through the eclipse documentation.
– Logan Phillips
Mar 26 at 20:55
Okay, this makes sense. I didn't pick this up when going through the eclipse documentation.
– Logan Phillips
Mar 26 at 20:55
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55349617%2fhaving-trouble-deploying-simple-web-app-in-jetty%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Post your web.xml
– Akshay Mulgavkar
Mar 26 at 3:57