jetty-9

Jetty: Pass object from main method with WebAppProvider to Servlet

寵の児 提交于 2019-12-11 17:17:55
问题 I need to pass an object from the embedded jetty code in a main method to be used in a servlet. This is an issue because of the separate classloader used within the WebAppContext - otherwise I would just use a static variable. My main code sets things up like this: Server server = new Server(); // setup connectors here... ContextHandlerCollection contexts = new ContextHandlerCollection(); RequestLogHandler requestLogHandler = new RequestLogHandler(); HandlerCollection handlers = new

Jetty 9 “--module” instead of “OPTIONS”

前提是你 提交于 2019-12-11 09:28:00
问题 I am trying to switch Jetty from 7.6 to 9.2. I read and understood that "OPTION" will no more work. So I changed my command from java -jar start.jar --ini **OPTIONS**=server,jmx,resources,websocket,ext,plus,jsp,annotations /u/khandela/project/base//etc/config/cometd/cometd_jetty_config.xml to start.jar --ini **--module**=server,jmx,resources,websocket,ext,plus,jsp,annotations /u/khandela/project/base//etc/config/cometd/cometd_jetty_config.xml But I got below warning: WARNING: ** Unable to

Can i run WebAppContext with WebSocketHandler in same instance?

好久不见. 提交于 2019-12-10 19:46:15
问题 is it possible to run WebSocketHandler and WebAppContext together? I'm using latest version 9.2.1.v20140609 . I tried configuration below, but on Websocket call to localhost:8080/ WebAppContext intercepts call. Here is my Launcher: public static void main(String[] args) throws Exception { ServerConnector connector = new ServerConnector(server); connector.setPort(8080); server.addConnector(connector); WebAppContext context = new WebAppContext("webapp", "/"); // Setting up browser caching.

JSP compilation error on jetty-9.3.3

喜欢而已 提交于 2019-12-10 17:28:56
问题 I have a webapp application which was running on embedded Jetty-7.6.8 (jdk-6), but due to Diffe-Hellman error on the browser we decided to move to newer version of Jetty. So, we moved to Jetty-9.3.3. As Jetty-9.x needs jdk-8, I upgraded jdk also. Right now jetty is starting up with no error but when I try to access my login page I get an unable compile jsp error. These are the dependencies: -org.eclipse.jetty.apache-jsp-9.3.3.v20150827.jar -org.mortbay.jasper.apache-el-8.0.23.M1.jar -org

How to add a SSL connector for apache karaf?

旧时模样 提交于 2019-12-10 11:57:51
问题 While searching for an answer to this question I stumbled upon http://blog.nanthrax.net/2013/02/multiple-http-connectors-in-apache-karaf/ and Jetty SSL configuration Apache karaf but this information is outdated. I found the new documentation at https://www.eclipse.org/jetty/documentation/current/configuring-connectors.html and the examples differ from proposed configurations. Apache Karaf 4.0.2 seems to use Jetty 9. I already have a keystore at ${karaf.home}/etc/keystores/keystore.jks and

Jetty - stand alone WebSocket server

隐身守侯 提交于 2019-12-09 01:16:52
问题 in these days I try to implement a WebSocket server by using Jetty. I've created a Jetty project called "WebSocketServer" as demo-base in the distribution of Jetty 9.2.0.v20140526 . After that, I write some codes to implement the WebSocket mechanism and export all codes to a war file to push it to the webapps folder of "WebSocketServer". When I java -jar ..<jetty.home>/start.jar , it is all workable. But, after I create a new connection to this WebSocket project, there are some error codes

Working with configuration properties in Jersey

我的未来我决定 提交于 2019-12-08 11:12:44
问题 I use java/jetty self-hosted server and jersey-2 for java RESTful api. Application has application.properties file with properties. ConfigurationProperties class reads and loads properties file into java.util.Properties class. Jetty server instantiation is done in the following way. // Create and register resources final ResourceConfig resourceConfig = new ApiServiceConfig() .register(new DependencyInjectionBinder()); ServletContextHandler contextHandler = new ServletContextHandler

Camel-Jetty http proxy + large response data casue issue: Buffering capacity exceeded

ε祈祈猫儿з 提交于 2019-12-07 15:44:33
问题 jetty expert, I got error when getting back large data via camel-jetty as http proxy, any experience/idea/suggestion are welcome, thanks in advance. RouteBuilder code: from("servlet:balancer?matchOnUriPrefix=true") .to("jetty:http://vm-a38e-8f19.nam.nsroot.net:19999/balancer/?" + "bridgeEndpoint=true" + "&disableStreamCache=true" + "&throwExceptionOnFailure=false" + "&bufferSize=1024000000" + "&inboundBufferSize=1024000000" + "&outboundBufferSize=1024000000" + "&eagerCheckContentAvailable

How to remove trailing slash from embedded Jetty URLs?

[亡魂溺海] 提交于 2019-12-07 09:57:58
问题 I use embedded Jetty 9.3.8.v20160314 from Scala (Scala is incidental here, this is a pure Jetty question), configured like this: val loginService = new RepoLoginService(usersRepository, signInsRepo) val server = new Server(8080) server.addBean(loginService) val security = new ConstraintSecurityHandler() server.setHandler(security) val constraint = new Constraint() constraint.setName("auth") constraint.setAuthenticate(true) constraint.setRoles(Array[String]("user", "admin")) val mapping = new

java.lang.reflect.InvocationTargetException in jetty-web.xml when setting WebAppContext.configurationClasses

安稳与你 提交于 2019-12-06 14:56:03
问题 I'm trying to add org.eclipse.jetty.annotations.AnnotationConfiguration to the configurationClasses property of org.eclipse.jetty.webapp.WebAppContext but (when invoking Jetty with sbt containe:start ), getting: [warn] Config error at <Set name="configurationClasses"> [warn] <Array type="java.lang.String"><Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item><Item>org.eclipse.jetty.webapp.WebXmlConfiguration</Item><Item>org.eclipse.jetty.webapp.MetaInfConfiguration</Item><Item>org.eclipse