jetty

Can't use two connectors (http and https) in Jetty v.9.4.3

别来无恙 提交于 2019-12-12 19:06:49
问题 When I'm adding two connectors to embedded Jetty server I can't use neither HTTP nor HTTPS - browser/curl is simply stuck. The code I use to create embedded Jetty is approximately the following (it is based on this example - http://self-learning-java-tutorial.blogspot.de/2015/10/jetty-configuring-many-connectors.html): HttpConfiguration httpConfiguration = new HttpConfiguration(); httpConfiguration.setRequestHeaderSize(requestHeaderSize); ServerConnector httpConnector= new ServerConnector

How to run Jetty with SPDY on JDK8?

▼魔方 西西 提交于 2019-12-12 18:32:57
问题 For a few days we have JDK8. I have tried to run Jetty with SPDY server. In JDK8 there is no NPN support so it ends with: [qtp22068985-16-selector-ServerConnectorManager@12e7b0e/1] WARN org.eclipse.jetty.io.SelectorManager - Exception while notifying connection SslConnection@e1448a{NEED_UNWRAP,eio=-1/-1,di=-1} -> NPNServerConnection@382d40{IDLE} java.lang.NoSuchMethodError: sun.security.ssl.HandshakeHash.<init>(ZZLjava/util/Set;)V at sun.security.ssl.Handshaker.activate(Handshaker.java:493) I

HttpServletRequest: How to determine Content-Type of requested asset

末鹿安然 提交于 2019-12-12 17:57:35
问题 I am writing a quick-and-dirty static file server using Jetty. I need to set the Content-Type for each response: HttpServletResponse.setContentType("content/type"); For a given file request, how do I reliably determine what content type to set? Is it a question of examining the file extension, or is there a more sophisticated method? (E.g what if there is no file extension, or the extension does not reflect the content type?) Thanks Richard 回答1: Can't you just check the request header Content

Problem with cometd and jetty 6 / 7

烈酒焚心 提交于 2019-12-12 16:14:53
问题 I'm trying to get started with cometd (http://cometd.org/) and jetty 6 or 7, but I seem to be having problems. I've got an ant script that packages my code up into a war with the cometd 1.1.1 binaries and jetty binaries that are appropriate to the version of jetty I deploy the war to (so 7.1.2.v20100523 binaries when I deploy to jetty 7.1.2.v20100523 and 6.1.24 when I deploy to 6.1.24). I first tried getting a setup with version 7.1.2.v20100523, but when I tried to deploy I got a very long

“HTTP ERROR: 500 No realm” running GWT's “MobileWebApp” sample

試著忘記壹切 提交于 2019-12-12 14:19:44
问题 I'm trying to run the GWT 2.4 sample app "MobileWebApp". I get a 500 "No Realm" error when I try to run the app in dev mode through Eclipse. I understand this is an authentication problem. I'm not familiar with Google App Engine or Jetty but from looking at the web.xml I can see there is a servlet filter where it is using the appengine UserService to presumably redirect the user to Google for authentication. I'm using: Eclipse 3.7 (Indigo SR1) Google Plugin for Eclipse 2.4 m2eclipse I'm

Embedded Jetty server, cannot see web pages under root context

老子叫甜甜 提交于 2019-12-12 13:18:30
问题 I am using jetty v9.2.10.v20150310 with java version "1.8.0_45" on a linux box with a 3.18.9 kernel. The problem is that if I set the context path to a non root value; i.e., /embed I can access my web page on my embedded jetty server. However if I set the context path to root; i.e., "/" I cannot access the page. Interestingly this problem does not show up when I interact with the servlet via curl. Here is the code: final ServletContextHandler servletHandler = new ServletContextHandler

Jetty - Servlet cannot be found

萝らか妹 提交于 2019-12-12 12:23:33
问题 I am new to Servlets and wanted to call a simple Servlet by using Eclipse's Jetty plugin. I can call the index.html, but when trying to access the Servlet I get: HTTP ERROR: 404 Problem accessing /ProjectServlet. Reason: NOT_FOUND I think I configured all my files correctly and cannot explain why Jetty returns this error. Thanks for helping me! index.html <!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>TEST</title> </head> <body> <h1>Servlet Call Test:</h1> <form action="

Upgrading to jetty 9.3.1.v20150714 caused Unsupported major.minor version 52.0

心不动则不痛 提交于 2019-12-12 11:13:00
问题 The error message doesn't seem helpful. Any idea what is going wrong? Exception in thread "main" java.lang.UnsupportedClassVersionError: org/eclipse/jetty/server/Handler : Unsupported major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) 回答1: That's a standard error from Java indicating that you are using an older JVM than the Classes you are attempting to run. (the Unsupported major.minor version numbers might

Is Comet easier in ASP.NET with Asynchronous Pages?

血红的双手。 提交于 2019-12-12 11:06:58
问题 I don't mean to ask, is Comet easier in ASPNET than in Jetty? I mean, is Comet easier inn either ASPNET or Jetty, as compared to other alternatives? I think the asynch capabilities of ASP.NET and Jetty specifically make Comet more scalable when implemented on those platforms and I'd like to confirm that. ASPNET introduced "Asynchronous pages" back in 2005. The idea was to apply the familiar .NET asynch model to ASP.NET page processing. public partial class AsyncPage : System.Web.UI.Page {

java.lang.NoSuchFieldError: IS_SECURITY_ENABLED

雨燕双飞 提交于 2019-12-12 10:44:32
问题 I want to deploy a service to 2 servers. I succeed on one server, but failed on the other one. In fact, I try my best to make their environments same. The error log is as following: 2013-01-21 22:08:18.178:WARN:oejuc.AbstractLifeCycle:FAILED jsp: java.lang.NoSuchFieldError: IS_SECURITY_ENABLED java.lang.NoSuchFieldError: IS_SECURITY_ENABLED at org.apache.jasper.compiler.JspRuntimeContext.<init>(JspRuntimeContext.java:197) at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:150) at