embedded-jetty

Jetty 9.0 embedded and RestEasy 3.0 keeps throwing NoSuchMethodError

前提是你 提交于 2019-11-30 09:18:29
Today I had the idea to build a very simple web application, which would be powered by a REST backend. Since I wanted a very lightweight server I started looking at Jetty. And since I wanted to try another JAX-RS implementation than Jersey I looked at RestEasy. I thought those 2 would be easy to implement. I was wrong... I imported the basic Jetty server and servlet dependencies since I thought that were the only server requirements for a basic (REST only) Jetty server (I alto tried to use the webapp dependency; this gave the same errors). <dependency> <groupId>org.eclipse.jetty</groupId>

How to add servlet Filter with embedded jetty

时光毁灭记忆、已成空白 提交于 2019-11-30 06:48:14
问题 I am embedding jetty into my app, and trying to work out how to add servlet filters (for cookie handling). The wiki and the javadoc's dont make it very clear, what am I missing: Server server = new Server(port); ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS); context.setContextPath("/"); FilterHolder f = new FilterHolder(new AuthorisationFilter()); context.addFilter(... f ...); // ????? context.addServlet(new ServletHolder(new TestServlet()), "/");

Is it possible to create Desktop Application using Java backend & Web Technologies UI

狂风中的少年 提交于 2019-11-30 02:26:24
I would like to create a desktop application in Java & web technologies. The main reason for selecting Java is that it is free, open source, and hence our investment would be minimal and we would save lots of investment with respect to licensing costs, etc. Also, the main reason for selecting web technologies is because our current programmers are well versed with web technologies like HTMl, css, Ajax, and we have good experience in creating amazing UI in web technologies. I will give you some idea about the software that we would like to create. It would be a desktop based software, namely

Embedded Jetty with exploded war, using annotated config

て烟熏妆下的殇ゞ 提交于 2019-11-29 17:59:09
I am learning Java EE 7 Servlets and tried to deploy hello2 example from Java EE 7 tutorial using embedded Jetty (v 9.3.7) with little success. hello2 consists of two servlets and an image file. The configuration is annotated and the project does not have any web.xml. Following the WebAppContext part from embedded Jetty examples I created this main class to initiate my embedded server: public class MyServer { public static void main(String[] args) throws Exception { Server server = new Server(8080); String webappPath = new File(MyServer.class.getProtectionDomain().getCodeSource().getLocation()

Jetty 9.0 embedded and RestEasy 3.0 keeps throwing NoSuchMethodError

旧巷老猫 提交于 2019-11-29 14:42:07
问题 Today I had the idea to build a very simple web application, which would be powered by a REST backend. Since I wanted a very lightweight server I started looking at Jetty. And since I wanted to try another JAX-RS implementation than Jersey I looked at RestEasy. I thought those 2 would be easy to implement. I was wrong... I imported the basic Jetty server and servlet dependencies since I thought that were the only server requirements for a basic (REST only) Jetty server (I alto tried to use

Starting Wicket web application with OSGi HTTP Service

余生长醉 提交于 2019-11-29 11:53:49
I'm trying to start a Wicket Application using Felix implementation of OSGi HTTP service, for that I just register the service using WicketServlet with applicationClassName parameter: props.put("applicationClassName", MainApplication.class.getName()); service = (HttpService)context.getService(httpReference); service.registerServlet("/", new WicketServlet(), props, null); I have also tried using Felix Whiteboard implementation and registering the web service as a Servlet one: props.put("alias", "/"); props.put("init.applicationClassName", MainApplication.class.getName()); registration = context

Starting up embedded jetty server for a JAR file

时光总嘲笑我的痴心妄想 提交于 2019-11-29 10:11:06
What I am trying to do, is to build an executable JAR file which will contain my project. I have included its dependencies right next to it, also in JAR files, so my directory listing looks something like this: ~/Projects/Java/web-app/out: web-app.jar dependency1.jar dependency2.jar dependency3.jar I know and am sure that my problem does not arise from dependencies, as my application functions properly, right up to the moment I start up Jetty embedded. The code I use to start Jetty is like this: public class ServerExecutionGoal implements ExecutionGoal { private final static Logger logger =

How to run jetty 7+ with specified war with groovy/gradle?

[亡魂溺海] 提交于 2019-11-29 06:46:24
I want to run Jetty 7+ with gradle build, but unlucky looks like there is no way to do this with jettyRun. So probably simplest idea to achieve what I want would be to use custom target: task runJetty << { def server = new Server() // more code here server.start() server.join() } Unlucky I just started with gradle and I don't know groovy either, so it's hard for me to create proper target. I was looking over the internet but I wasn't able to find any solution. Can anyone hit me with some sample groovy code which can run existing jar with jetty? Ok, I found out how to run it using jetty

How to override jetty.xml with jetty.port

霸气de小男生 提交于 2019-11-29 06:16:41
I'm using maven-jetty-plugin and trying to override my jetty.xml setting with the -Djetty.port=8090 but it's not working. Only when I remove the connector part from the jetty.xml file I get the port to be 8090. So: mvn jetty:run -Djetty.port=8090 With the connector starts in port 8080 Without the connector starts in port 8090 Problem is I need to configure acceptors, stats and other stuff. I tried removing only the port from the connector but it didn't work. I'm using: JAVA 1.7_05 MAVEN 3.0.4 Jetty 8.1.4 Linux Ubuntu 12.04 64bits Here's my pom.xml plugin configuration: <plugin> <groupId>org

Java / Jetty: How to Add Filter to Embedded Jetty

佐手、 提交于 2019-11-29 04:04:24
I am working with embedded Jetty and I want to add a servlet filter to check for authentication before each request. I tried following this example but it looks like the signature has changed. <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-server</artifactId> <version>9.0.4.v20130625</version> </dependency> My Jetty starter looks like this: public class JettyStarter { public static void main( final String[] args ) throws Exception { Server server = new Server(8080); final ServletHolder servletHolder = new ServletHolder(new CXFServlet()); final ServletContextHandler context