jetty

gwt jetty jndi lookup fails

拟墨画扇 提交于 2019-12-07 09:42:43
问题 I am using gwt with jetty but want use jndi for datasource so followed the documentation for eclipse gwt jetty jndi and did below to run my gwt app Run my gwt app with following options in eclipse -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -startupUrl myapp.html -logLevel INFO -codeServerPort 9997 -war war\location -server com.myproject.MyCustomJettyLauncher com.my.apps.app My jetty-env.xml under WEB-INF configuration <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE

Jetty embedded and JSP compilation to 1.7?

坚强是说给别人听的谎言 提交于 2019-12-07 07:32:06
问题 Could i specify somehow the target version of vm for jsp compilation? (I need 1.7, not 1.5 which is by default). I have a WebAppContext , some filters in code on it etc. The webapp itself is an exploded war.. so no xml configuration is used as it was not needed. But seems, xml configuration are strictly necessary in order to do this? How it shall look like (and wouldn't it conflict with the in-code definitions) ? ..or is there any way to do the trick through the code? Thanks. 回答1: http://www

Programmatically configure Jetty's logger

蹲街弑〆低调 提交于 2019-12-07 07:16:33
问题 How do I programmatically configure Jetty's logger? I'm using Jetty in a standalone application and want to change the log level of some of Jetty's internally generated warnings. Ideally I could do this programmatically (ie, in code) without having to specify an XML file. I'm using Jetty 6.1.20. 回答1: Jetty uses slf4j, so you can use any logging framework or slf4j implementation you want . Jetty comes with the Simple slf4j implementation, which logs INFO levels or above. So, you either change

GRPC - .IllegalArgumentException: Jetty ALPN/NPN has not been properly configured

元气小坏坏 提交于 2019-12-07 06:13:45
问题 I am trying to spin up the GRPC server with TLS enabled in docker container on pods but getting below error during server start up I am trying referring https://github.com/grpc/grpc-java/blob/master/SECURITY.md#transport-security-tls Java : jdk1.8.0_131 OpenSSL version: OpenSSL 1.0.1e-fips Exception: *Exception in thread "main" java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been properly configured. at io.grpc.netty.GrpcSslContexts.selectApplicationProtocolConfig(GrpcSslContexts

How do I send an HTTP response without Transfer Encoding: chunked?

柔情痞子 提交于 2019-12-07 05:40:43
问题 I have a Java Servlet that responds to the Twilio API. It appears that Twilio does not support the chunked transfer that my responses are using. How can I avoid using Transfer-Encoding: chunked ? Here is my code: // response is HttpServletResponse // xml is a String with XML in it response.getWriter().write(xml); response.getWriter().flush(); I am using Jetty as the Servlet container. 回答1: Try setting the Content-length before writing to the stream. Don't forget to calculate the amount of

Redirect non www version of domain to www in Jetty

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 05:28:32
问题 I cannot redirect my non www domain version to www with MovedContextHandler , it does not have host to redirect to. Both www.example.com and example.com point to my web server IP. When someone tries to open example.com he is still able to access my site that way. I want for his browser to receive HTTP 301 redirection to www.example.com instead. It is important for search rankings, as search engines must know example.com and www.example.com are one and the same. As a bonus, when someone tries

Solr issue: ClusterState says we are the leader, but locally we don't think so

*爱你&永不变心* 提交于 2019-12-07 03:02:42
问题 So today we run into a disturbing solr issue. After a restart of the whole cluster one of the shard stop being able to index/store documents. We had no hint about the issue until we started indexing (querying the server looks fine). The error is: 2014-05-19 18:36:20,707 ERROR o.a.s.u.p.DistributedUpdateProcessor [qtp406017988-19] ClusterState says we are the leader, but locally we don't think so 2014-05-19 18:36:20,709 ERROR o.a.s.c.SolrException [qtp406017988-19] org.apache.solr.common

What's the difference between a ServletHandler and a ServletContextHandler in Jetty?

末鹿安然 提交于 2019-12-07 02:21:46
问题 I'm trying to get started with an embedded Jetty server. I just want to map requests to different servlets based on the request path. What's the difference between creating a ServletHandler and adding servlets to it as opposed to creating a ServletContextHandler and adding servlets to that? For example: //how is this different... ServletHandler handler = new ServletHandler(); handler.addServletWithMapping(MyServlet.class, "/path"); //from this? ServletContextHandler contextHandler = new

Jetty: Detect if Webapp failed to start

梦想的初衷 提交于 2019-12-07 01:38:29
问题 I am launching an embedded Jetty instance containing a single webapp. The webapp launches on start-up. I'd like to know how to detect if the Webapp's contextInitialized throws an exception. When the webapp throws an exception, Server.start() doesn't and server.isRunning() returns true. Is there a way for me to listen for webapp exceptions from outside the container? 回答1: Answering my own question. Setting WebAppContext.setThrowUnavailableOnStartupException(true) causes the server to propagate

Can stand-alone Jetty be used as a reverse proxy (without Apache mod-proxy)

眉间皱痕 提交于 2019-12-07 01:02:55
问题 I have an application which includes a Jetty web server that we distribute to multiple user to deploy on their servers. Based on some new requirements, we need to include reverse proxy capabilities. The Jetty documentation talks about using Apache as the reverse proxy in front of Jetty. While this works, it would be much easier to just use Jetty and not have to carry around Apache. Is there any way to configure standalone Jetty as a reverse proxy? 回答1: Sure you should be able to use the