jetty

java.lang.ClassNotFoundException: org.eclipse.jetty.websocket.server.WebSocketServerFactory

只愿长相守 提交于 2019-12-25 16:44:09
问题 Server server = new Server(9090); ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS); context.setContextPath("/"); server.setHandler(context); // Add the echo socket servlet to the /echo path map context.addServlet(new ServletHolder(HelloWorldWebSocket.EchoServlet.class),"/echo"); try { server.start(); context.dumpStdErr(); server.join(); } catch (Exception e) { // TODO Auto-generated catch block } public class HelloWorldWebSocket { @WebSocket public

Start java application with jetty without WAR file

佐手、 提交于 2019-12-25 16:26:29
问题 I try start Jersey + Jetty + Nginx via this tutorial and I cannot use war file. How can I start my java application? I start application by right click on BackendServer.java and click "Run" in IDEA or using in terminal java -cp /home/example/backend/build/WEB-INF/lib/backend.jar:/home/example/backend/libs/* com.example.backend.BackendServer . Project structure is described here. /opt/jetty/webapps/backend.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay

Tomcat but not Jetty: NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey

﹥>﹥吖頭↗ 提交于 2019-12-25 12:51:28
问题 I have recently upgraded my Wicket 6 application from Spring 3 to Spring 4. When I run the application locally on Jetty 7, it runs fine. When I deploy it to Tomcat 7, I get the following error: [2014-05-07 10:20:47,121] ERROR [org.springframework.web.context.ContextLoader] Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init

Jetty runs old war altought mvn clean is run

爱⌒轻易说出口 提交于 2019-12-25 09:31:13
问题 does someone had an similar issue with maven and jetty, that jetty is run with an old war althought mvn clean is run. My pom uses failsafe to start jetty with mvn verify. 回答1: see http://docs.codehaus.org/display/JETTY/Temporary+Directories for where jetty store temp files => I suggest you configure maven jetty plugin to use a unique temp directory for your application to avoid any problem. e.g.: <project> ... <plugins> ... <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty

Is there a way to unlock all http methods without changing the war file?

狂风中的少年 提交于 2019-12-25 09:29:02
问题 I have a .war file deployed in Jetty (I didn't build it, and it's not possible to create a new instance). An OPTIONS request to http://example.com/rest/object/{uuid} responds with HEAD, DELETE, GET, OPTIONS . The people that built the war claim that it's not an issue with their file. Is there a Jetty config file I can change to allow all the http methods? If this is something I have to do in a Jetty Java file, I am a Jetty noob, so please be verbose, or point me to some docs that I can read.

How to pass user context object to the response callback of async Jetty HTTP client?

拜拜、爱过 提交于 2019-12-25 09:22:17
问题 When sending notifications to single recipients over Google Firebase Cloud Messaging, sometimes a response comes back ( 200 + error:MissingRegistration , 200 + error:InvalidRegistration , 200 + error:NotRegistered ), which requires deleting the token of that recipient (because she for example reinstalled the Android app and the token has changed). My question is: How to pass that string (the FCM token) back to the response callback of the non-blocking Jetty HTTP client? Currently my

Deploy a embedded Jetty&Jersey war to jetty9,only can see static file?

喜夏-厌秋 提交于 2019-12-25 09:19:12
问题 I cteate a jetty&jersey embedded project with IDEA and Maven,I put it in Github https://github.com/Mengqi777/JettyProject. Run JettyServerStart.java start the server, in the browser address bar enter localhost:8080/dynamic , show OK, enter localhost:8080/static , show static resource file Now I package it to a war file,and put it in jetty webapps directory. But only can see static file in brower with enter localhost:8080/static .404 Not Found Error when in brower with enter localhost:8080

Need an easy to follow Hello World REST example for a Jetty + Jersey + Maven app

不想你离开。 提交于 2019-12-25 07:59:21
问题 I have not been successful in getting Jetty working with Jersey in a Hello World level app which demonstrates the REST capabilities of Jersey. Examples seem to lack detailed POM information, directory structure, html client, JDK version (I am using jdk1.7.0_51), or some other detail which I get tripped up on. I am looking for a clearly written tutorial (a link is fine) which has all of these details OR would take an example + comments which supply the missing information. 回答1: See my answer

Deprecated Embedded Jetty 7.6 using SSL

坚强是说给别人听的谎言 提交于 2019-12-25 07:48:13
问题 I am trying to build an embedded jetty application which is fine so far. But if i try to use SSL it seems all methods are deprecated. I found a post here on stackoverflow where the poster solved his problem by using the SslContextFactory but if i copy those lines my ide marks the SslContextFactory as deprecated too. What would be the proper way of solving this? i had a look at the following similar questions but they don't seem to solve my problem: Jetty SslConnector's deprecated methods How

Negative response time in Jetty server access log

扶醉桌前 提交于 2019-12-25 06:45:28
问题 I'm running on Jetty and my access log is configured to show the response time. today I noticed that a very minimal amount of the requests (about 30 out of 600K) have a negative response time and I was wondering if anyone ever encountered such a behavior. This is a sample of my response: <[IP]> - - <[date]> "POST <[url]> HTTP/1.0" 201 461 -18096 In case you want to identify this in the access log - this is the grep command i used: grep --color "-[0-9][0-9]*" server-access.2013_12_09.log Jetty