jetty

jetty server 9.1 multiple embeded ports and application in same server instance

瘦欲@ 提交于 2019-12-11 18:13:21
问题 I should use one Server object, and need to open multiple ports and multiple application(WAR files). Ex, one server object, 8080 addition.war 8081 subraction.war etc. I'm using Jetty server 9.1.0 How can I do this? 回答1: To accomplish this, you need: Each ServerConnector should have a unique name declared via ServerConnector.setName(String) When you define your WebAppContext, declare a set of virtual hosts that take a named virtual host syntax "@{name}" , where the {name} is the same one you

Using WebAppProvider in Jetty 8, Jetty deploys a WAR and then can't find it

冷暖自知 提交于 2019-12-11 17:44:41
问题 I'm trying to use Jetty's WebAppProvider to watch a directory for WARs and deploy them. Everything seems to work fine: Jetty reports that it's deploying the WAR to the context I'd expect. But then when I try to visit the page, Jetty can't find anything there. My server code is public static void main(String[] args) throws Exception { Server httpServer = new Server(3030); DeploymentManager deploymentManager = new DeploymentManager(); httpServer.setDumpBeforeStop(true); ContextHandlerCollection

Swagger UI configuration via jetty.xml

我是研究僧i 提交于 2019-12-11 17:35:15
问题 I'm trying to add Swagger UI to a Java EE project running on Jetty. I have a programmatic configuration example but I'm struggling to convert that to XML since my server configuration is defined in the jetty.xml file. My problem is the definition of the resourceBase property. Here's the example configuration : ResourceHandler rh = new ResourceHandler(); rh.setResourceBase(InsectopediaServer.class.getClassLoader() .getResource("META-INF/resources/webjars/swagger-ui/2.1.4").toURI().toString());

Jetty 6.1 with Solr 4.4

跟風遠走 提交于 2019-12-11 17:34:06
问题 Is it possible to run Solr 4.4 with jetty 6.1 from Ubuntus package repository? I followed this example: http://www.kingstonlabs.com/blog/how-to-install-solr-36-on-ubuntu-1204/ And tried some other examples, but it seemed to be impossible to run run Solr 4.4 from Jetty's webapps directory. In the example you can read in the comments, that people ended up with 404 when try to reach http://localhost:8080/solr I tried also the configuration steps from the Apache Solr 4 Cookbook by Rafal Kuc, page

Error 404 when I try to deploy my war on Jetty on Debian 9

天涯浪子 提交于 2019-12-11 17:31:42
问题 I'm trying to deploy my java web site on a Debian online server. For that, I install Jetty (following this : http://zetcode.com/java/jetty/install/) Jetty seems to be ok on the server because when I enter http://myipaddress:8080. I have the "Welcome to Jetty". Then, I use Filezilla to upload my war on the server. I compile my war with Eclipse and Maven : <groupId>com.example</groupId> <artifactId>test</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <name>test</name> I

Hot Deployment of servlet contexts loaded from classpath?

无人久伴 提交于 2019-12-11 17:18:32
问题 I've got the following embedded Jetty setup: ServletContextHandler topHandler = new ServletContextHandler(server, contextPath); // Set path of static resources topHandler.setBaseResource(...); // Bind dynamic content to /api RootResource rootResource = new RootResource(); FilterHolder restApiHandler = new FilterHolder(rootResource); for (Entry<String, String> parameter : initParams.entrySet()) restApiHandler.setInitParameter(parameter.getKey(), parameter.getValue()); topHandler.addFilter

Why can't I access a web app running on my Mac via my iPhone?

点点圈 提交于 2019-12-11 17:13:57
问题 I'm developing an iPhone app that has a network component. I'm developing the app in Java (Google App Engine actually), running on port 8080. And it works, when I test my app in the iPhone simulator. But now I am trying to test on the device, and I can't hit my Jetty instance. I can certainly access my Mac via the iPhone because I'm able to hit http://10.0.1.7/~brianpapa/ and view my Home Folder when Web Sharing is turned on. But when I try to hit http://10.0.1.7:8080/, it says it can't

How to work with client certificates on Jetty SPDY with ALPN?

馋奶兔 提交于 2019-12-11 17:12:42
问题 I have problem with client certifiacates when I use SPDY with Jetty. It works when I work with NPN and start Jetty SPDY server with: SSLconnector = new HTTPSPDYServerConnector(server, sslContextFactory); As a baseRequest.getHttpChannel() it uses org.eclipse.jetty.spdy.server.http.HttpChannelOverSPDY and I can read SSL properties like SSL_SESSION_ID and client certificates with code like: // ... HttpServletRequest request java.security.cert.X509Certificate client_certs[] = (java.security.cert

SOAP over Websocket with Appache CXF and Embedded Jetty

感情迁移 提交于 2019-12-11 17:08:45
问题 I have been trying to set a a SOAP endpoint with Websocket as transport protocol via CXF and implement invoke it via CXF. With Embeded jetty. I have tried a couple of approaches non of the aproaches worked unfortunatly. Here is what I did: Aproach 1. According to CXF documentation websocket is supported as transport protocol and its support is given via <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-transports-websocket</artifactId> <version>3.3.2</version> </dependency> I

How to run jetty server in SSL mode using PKCS12 keystore?

假装没事ソ 提交于 2019-12-11 16:24:54
问题 I am trying to run jetty web server in SSL mode using PKCS12 keystore. The code is as follows: import org.mortbay.jetty.Server; import org.mortbay.jetty.security.SslSelectChannelConnector; class MyClass { public static void main(String[] args) { Server server = new Server(); SslSelectChannelConnector connector = new SslSelectChannelConnector(); connector.setKeystore(keyStore); connector.setKeyPassword(keyPass); connector.setKeystoreType("PKCS12"); server.addConnector(connector); server.start(