jetty

ProxyServlet stop working after migration from jetty 8 to jetty 9

女生的网名这么多〃 提交于 2019-12-07 21:11:04
问题 I have an eclipse plugin which uses jetty server with ProxyServlet. Basically, the implementation is the following: ServletHolder proxyServletHolder = new ServletHolder(new SubClassOfProxyServlet()); proxyServletHolder.setAsyncSupported(true); ServletHandler proxyServletHandler = new ServletHandler(); proxyServletHandler.addServletWithMapping(proxyServletHolder, "/mapping/url"); After that I add proxy handler to the handler list and set this list to the server: HandlerList handlers = new

Getting the real (virtual) host name under an application server

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 19:44:08
问题 I have an application running under Jetty, and I want the application to return self referencing absolute URLs (when generating an RSS feed, so a client must be able to work without a "current URL" context). The problem is that I don't know ahead of time under which host name the application will be deployed, and it is quite likely that it will be deployed in a virtual hosting environment where several host names are mapped to the same IP address. I've tried using HttpServletRequest

实现服务启动之后,马上执行任务的几种方法

自闭症网瘾萝莉.ら 提交于 2019-12-07 19:38:20
有哪些方法 实现服务启动之后,马上执行相关操作? 方式一 :@PostConstruct 对类的要求 无,普通的java bean即可 例如: /*** * 执行完构造方法之后就会执行该方法 */ @PostConstruct public void init() { System.out.println("初始化字典"); refresh2(); } 执行时机 类实例化之后 方式二: 实现org.springframework.context.ApplicationListener 的onApplicationEvent方法 对类的要求 必须使用SpringMVC的注解@Configuration , 实现org.springframework.context.ApplicationListener 的onApplicationEvent方法 示例 例如: /*** * Spring容器加载完成触发,可用于初始化环境,准备测试数据、加载一些数据到内存 * @param contextRefreshedEvent */ @Override public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) { configType=getProperty("ConfigType");

Solr server HttpParse error

混江龙づ霸主 提交于 2019-12-07 19:36:46
问题 Hi when i am sending a query to solr server using http client , solr server prints exception log saying HttpParser full. I am running solrcloud 4.0 in jetty server. Is this a problem with jetty ? What could be the reason for this and how can i resolve it ? 来源: https://stackoverflow.com/questions/15973884/solr-server-httpparse-error

How to map a servlet filter on /* in Jetty?

佐手、 提交于 2019-12-07 16:44:25
I have a servlet filter which I want to map to http://127.0.0.1:8888/ in Jetty. I have put a servlet filter mapping with url pattern /* . However, the filter is not called. I also tried with / mapping. It does not work either. How is this caused and how can I solve it? If you name your war root.war it will be deployed to the root / context. http://wiki.eclipse.org/Jetty/Howto/Deploy_Web_Applications You can redirect requests from "/" to "/urlToRedirect" and handle "/urlToRedirect" by special servlet. Like in example: public static void main(String[] args) throws Exception { Servlet frontend =

Jetty: set up general host

不想你离开。 提交于 2019-12-07 15:09:39
How can i force Jetty to open all deployed webapps starting from specific virtual host like test.localhost:8080/myapp instead of localhost:8181/myapp ? Here's snippet from jetty.xml: <Call name="addConnector"> <Arg> <New class="org.eclipse.jetty.server.nio.SelectChannelConnector"> <Set name="host"> <Property name="jetty.host"/> </Set> <Set name="port"> <Property name="jetty.port" default="8181"/> </Set> ... ... i tried to play with jetty.host value but still no success. :( How to? To LISTEN on a specific network interface, you specify that interface either via its IP address (IPv4 or IPv6) or

Jetty 8.1.9.v20130131 Web Socket issues

大兔子大兔子 提交于 2019-12-07 14:32:51
问题 I do have a strange problem with jetty 8 websockets. I found several tutorials that pretty much show the same code, yet I get this error when I try to open the websocket from a local html page: 2013-02-05 13:14:03.467:INFO:oejs.Server:jetty-8.1.9.v20130131 2013-02-05 13:14:03.770:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080 2013-02-05 13:14:18.002:WARN:oejs.ServletHandler:/echo java.lang.NullPointerException at org.eclipse.jetty.websocket.WebSocketFactory.upgrade

How to setup SSL with Eclipse's maven-jetty-plugin?

好久不见. 提交于 2019-12-07 14:22:52
问题 I would like to be able to launch Jetty with SSL using the latest Eclipse maven-jetty-plugin and the keytool-maven-plugin as seen here. However, those two plugins are now quite outdated. Could somebody please illustrate a working example of this using the latest versions of the plugins? Thanks! 回答1: These two plugin definitions should do it :- <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <version>6.1.26</version> <configuration> <jvmArgs>-Xmx2048m

Jetty 8, servlet 3.0 and continuations

旧街凉风 提交于 2019-12-07 13:24:28
问题 Is the continuation features of Jetty not needed with servlet 3.0 asychronous I/O? Is there a difference or how should I as a developer see things? Can someone elaborate on this topic? 回答1: If you know that you are always deploying to a Servlet 3.0 compliant container, and you are comfortable with the asynchronous servlet API, then there's no need for Jetty continuations. The two things continuations give you are: They have an (arguably) simpler API. They are (somewhat) portable to servlet 2

Is it accurate to say that older versions of Jetty cannot be made to work with Java 9 just by configuration changes

╄→гoц情女王★ 提交于 2019-12-07 13:23:57
问题 Trying to run a fairly old project Mamute with Java 9. I was able to get around some initial errors by using --add-modules java.xml.bind but Mamute uses an older version of Jetty (8.1.0.v20120127) and I am seeing PWC6188: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved This discussion around this thread would seem to indicate using Jetty with Java 9 is only possible with back-ported code changes and not by changing configuration. Is that correct? 回答1: To what I've