embedded-jetty

Failed startup of context c.g.g.d.s.j.WebAppContextWithReload

让人想犯罪 __ 提交于 2020-01-05 07:10:09
问题 I need help with an issue I have no idea how to resolve. Your help will be greatly appreciated. I just added log4j2 jars (log4j-api-2.10.0.jar, log4j-core-2.10.0.jar) to my Web app and it started running into this problem in my dev. Later I added log4j-web-2.10.0.jar and tried, it still fails with the same message. Here's my environment: IDE: Eclipse Oxygen2 JDK: 1.8.0_162 Jetty (embedded in Eclipse): jetty-9.2.z-SNAPSHOT OS: Win 10 (64bit) Framework: GWT 2.8.2 Stack trace (partial): [WARN]

Embedded Jetty does not find Annotated Servlet

假如想象 提交于 2020-01-04 03:50:14
问题 Short: I have a project that provides a war artifact which includes a servlet with annotations but no web.xml. If i try to use the war in jetty i always get only the directory listing of the war content but not the servlet execution. Any idea? Long story: My servlets look like this package swa; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet

Webapp with embedded jetty giving exception

浪尽此生 提交于 2020-01-03 15:36:43
问题 I am trying to maintain a java web app that is run standalone using embedded jetty, using Java 7 and Jetty 9.1.3. Everything runs except all of the links in one of the JSP pages. Each link on that page is supposed to fetch a png file or a text file and display it below the link. When run through Netbeans, each link just hangs when clicked and the console gives the following errors: Apr 10, 2014 4:23:34 PM org.apache.struts.chain.commands.AbstractExceptionHandler execute WARNING: Unhandled

Setting Jetty resourcebase to static file embedded in the same jar file

雨燕双飞 提交于 2020-01-03 15:05:34
问题 I am trying to access static resource (eg. first.html) packed inside the same .jar file (testJetty.jar), which also has a class which starts the jetty (v.8) server (MainTest.java). I am unable to set the resource base correctly. The structure of my jar file (testJetty.jar): testJetty.jar first.html MainTest.java == Works fine on local machine, but when I wrap it in jar file and then run it, it doesn't work, giving "404: File not found" error. I tried to set the resourcebase with the following

Setting Jetty resourcebase to static file embedded in the same jar file

你。 提交于 2020-01-03 15:04:29
问题 I am trying to access static resource (eg. first.html) packed inside the same .jar file (testJetty.jar), which also has a class which starts the jetty (v.8) server (MainTest.java). I am unable to set the resource base correctly. The structure of my jar file (testJetty.jar): testJetty.jar first.html MainTest.java == Works fine on local machine, but when I wrap it in jar file and then run it, it doesn't work, giving "404: File not found" error. I tried to set the resourcebase with the following

How to configure embedded jetty to access Jersey resources?

半城伤御伤魂 提交于 2020-01-03 11:26:04
问题 I'm trying to configure embedded jetty to talk to my Jersey resources but I can't figure out how to do it. I've tried a couple of different things but nothing seems to work. The jetty tutorials don't really handle how to do it with Jersey. Any code suggestions or links are greatly appreciated EDIT: package pojo; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.servlet.DefaultServlet; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet

How to configure embedded jetty to access Jersey resources?

柔情痞子 提交于 2020-01-03 11:25:07
问题 I'm trying to configure embedded jetty to talk to my Jersey resources but I can't figure out how to do it. I've tried a couple of different things but nothing seems to work. The jetty tutorials don't really handle how to do it with Jersey. Any code suggestions or links are greatly appreciated EDIT: package pojo; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.servlet.DefaultServlet; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet

Minimum set of files needed from Jetty to serve static content?

为君一笑 提交于 2020-01-02 17:32:33
问题 Background Disclaimer: I have very little experience with Java. We previously used a wrapped version of Jetty 6 for on-demand static content (JS, CSS, images, HTML) during our Ant build so we can run unit tests with PhantomJS against an HTTP-hosted environment. However, Jetty is now on version 8.1.3 and we no longer need that wrapping (which solves a different problem which is now moot), so I wanted to update to just using Jetty 8.1.3 directly. First I downloaded the whole Jetty distribution,

How to pass parameters to REST resource using Jersey 2.5

风格不统一 提交于 2020-01-02 14:31:22
问题 I have a Java server which serves my clients (Not application server). Now I'm interested to add REST support. I've initialized a Jetty server and created few REST resources. My question is: How can I pass parameters at the creation of the REST resources? Normally I would prefer in the constructor of each resource, but I don't control it. I understand there is a way to inject dependencies. How to do it using Jersey 2.5?? Thank you! 回答1: Define your Application public class MyApplication

Embedded Jetty: In secure https server, ContextHandler redirects to http URI

偶尔善良 提交于 2020-01-02 08:48:08
问题 I'm building a sandbox RESTful API using embedded Jetty. My Proof-of-Concept design: a simple embedded jetty server that (1) accepts connections on an SSL port and (2) uses a ContextHandlerCollection to invoke the proper Handler based on the URI prefix. My original test, using a simple non-SSL connection, seemed to work perfectly (note, code for imports and helper HelloHandler class in APPENDIX). public static void main(String[] args) throws Exception { Server server = new Server(12000);