jetty

Problems with CDI in setup for functional testing with TomEE (or OpenEJB), Jetty and Selenium

≡放荡痞女 提交于 2019-12-11 08:45:24
问题 I'm trying to setup programatically an environment with Jetty, OpenEJB and WebApps to development and run Selenium tests. Something very similar described in this article: http://tomee.apache.org/functional-testing-with-openejb,-jetty-and-selenium.html. This setup is very good, because I can start selenium test by the IDE or Maven, and use the same code to start a Server for development. I saw this setup working using an old version of Jetty (6.2) and with an unknown EJB container (called

welcome-file-list not working in jetty + spring

折月煮酒 提交于 2019-12-11 08:06:52
问题 I'm using Jetty 8.1.4 with Spring 3.2.4. Following is my web.xml file. I have an index.html file under WEB-INF and I want that page to be hit when I do http://myapp.com/ or simple http://myapp.com but I'm getting 404. If I do http://myapp.com/index.html it works. I'm not sure what I'm missing. Also, I'm bit confused if I must use / or /* in the url-pattern below, I tried both. <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org

Maven Jetty - do not reload the whole application when modifying only static files

丶灬走出姿态 提交于 2019-12-11 07:14:36
问题 Maven Jetty plugin is very nice (I'm using version 6.1.26). The only annoying thing concerns static files' modifications. My web application uses Spring, follows the standard webapp Maven layout and I basically do not want the whole context to be reloaded whenever I change a JSP or a CSS file. I checked the configuration settings, but didn't find anything about this. Any idea ? Thanks in advance ! Rolf 回答1: You can set manual reload and: Your IDE (i.e. Eclipse) will copy static resources to

Deploying existing WAR to embedded Jetty

五迷三道 提交于 2019-12-11 06:57:00
问题 My intention is to deploy an existing WAR to embedded Jetty 9.4.5. Unfortunately I get the following error when trying to open a page (JSP): An error occurred at line: [52] in the generated java file: [/tmp/embedded-jetty-jsp/jsp/org/apache/jsp/WEB_002dINF/jsp/MainLayout_jsp.java] Type mismatch: cannot convert from HashSet<?> to Set<String> An error occurred at line: [52] in the generated java file: [/tmp/embedded-jetty-jsp/jsp/org/apache/jsp/WEB_002dINF/jsp/MainLayout_jsp.java] Cannot

Embedded jetty application not working from jar

核能气质少年 提交于 2019-12-11 06:54:21
问题 I have the following code: Server server = new Server(9090); final URL warUrl = Main.class.getClassLoader().getResource("com/domain/webapps/app"); final String warUrlString = warUrl.toExternalForm(); WebAppContext wac = new WebAppContext(warUrlString, "/app"); server.setHandler(wac); I have the Main class in the com.domain package. The jsp's and html's are in the com.domain.webapps.app package. When run inside Netbeans (or java -cp <classpath> com.domain.Main on the exploded jar) the

Google Cloud Bigtable Java Client - tcnative errors

时光毁灭记忆、已成空白 提交于 2019-12-11 06:29:56
问题 I am trying to connect to Cloud Bigtable; however, I'm getting issues with netty-tcnative not being found. Maven dependencies: <dependency> <groupId>com.google.cloud.bigtable</groupId> <artifactId>bigtable-hbase-1.2</artifactId> <version>0.9.2</version> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-tcnative-boringssl-static</artifactId> <version>1.1.33.Fork19</version> </dependency> Error output: ERROR 2016-09-09 22:26:00,969 [main] com.google.cloud.bigtable.grpc

Jetty, websocket, java.lang.RuntimeException: Cannot load platform configurator

故事扮演 提交于 2019-12-11 06:24:46
问题 I try to get http session in Endpoint. I followed this recomendations https://stackoverflow.com/a/17994303 . Thats why I did: public class MyConfigurator extends ServerEndpointConfig.Configurator { @Override public void modifyHandshake(ServerEndpointConfig config, HandshakeRequest request, HandshakeResponse response) { HttpSession httpSession = (HttpSession)request.getHttpSession(); config.getUserProperties().put(HttpSession.class.getName(),httpSession); } } and @ServerEndpoint(value = "/foo"

When does OnWebSocketClose fire in Jetty 9

寵の児 提交于 2019-12-11 05:43:49
问题 I have a simple embedded Jetty 9 websocket server. I have a method like this in my annotated websocket implementation: @OnWebSocketClose void onClose(int statusCode, String reason) { logger.info "Closed connection [${this}]" connectionManager.remove(this) Event closeEvent = commsEventFactory.buildCloseEvent(this, statusCode, reason) eventReceiver.postEvent(closeEvent) } I have a spock test which connects to the server using async-http-client. I get a successful connection and can send

How to set an object to context so that i can get it anywhere in the application with @Context

廉价感情. 提交于 2019-12-11 05:38:41
问题 I want to set MyObject class instance to the application context so that I can use it anywhere with the following: @Context MyObject object I used Jedis which gives me access for the jedis through the above approach. Please help in setting the context. I am using dropwizard (jetty,jersery and jackson) . 回答1: I had some time and wrote up the way to do it (jersey only, no other DI framework used). Jersey is compliant with javax.inject annotations. The reason you do NOT use a context annotation

Where did the Connection object in the Connectors in Jetty 9.x go?

℡╲_俬逩灬. 提交于 2019-12-11 05:26:30
问题 When I am trying to migrate to Jetty 9.4.x from Jetty 8.1.12, I am getting errors because of following issue. We use connector.getConnection() method. And I did not find any replacement in Jetty 9.4.x. This is followup question on Jetty upgrade 8 to 9 We use connector.getConnection() to get inet socket address. private InetSocketAddress findFirstInetConnector(Server server) { Connector[] connectors = server.getConnectors(); if (connectors != null) { for (Connector connector : connectors) {