embedded-jetty

Maven Jetty plugin : packaging type [jar] is unsupported

北城以北 提交于 2020-01-23 19:38:29
问题 I have a created a project with SpringBoot and project packaging type is jar and also i added the jetty dependency into the project and when i am trying to build the project with mvn jetty:run ,build is successful but i am getting a message like this [INFO] Skipping keycloak-springboot-demo : packaging type [jar] is unsupported and below is my pom.xml file <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema

Receive non Http messages using jetty

一曲冷凌霜 提交于 2020-01-17 05:42:05
问题 I am using embedded jetty and spring for java to java communication over http. My problem is that my server application must handle plain TCP messages also on the same port. Is there a way to detect if a TCP message arrived which cannot be handled by the servlet? Thanks for the answers I add some more details: I cannot modify the client. The reason for this is that the old version of the client uses pure java tcp socket and it turned out that the new server must be backward compatible with

Jetty 9: Setting up handlers and connectors

孤人 提交于 2020-01-13 04:37:09
问题 I've looked at the documentation for Jetty 9 on the architecture (http://www.eclipse.org/jetty/documentation/current/architecture.html) but I am still confused about the relationship between handlers and connectors. Can you link a handler to a specific connector (if so, how? The connector doesn't seem to have a setHandler method)? Or does everything go to a main handler and then you distribute things from there? (i.e. You figure out form what connector it came from so then you forward it to a

Embedded Jetty - IllegalStateException: No SessionManager

淺唱寂寞╮ 提交于 2020-01-12 14:08:33
问题 I've found plenty of references to this issue on google but no answers. I'm using the latest version of jetty (8.1.2.v20120308) and I can't seem to get an embedded servlet to be able to use sessions. The example is in scala of course, but it should be readable to any java programmer. val server = new Server(); val connector = new SelectChannelConnector() connector.setPort(Integer.getInteger("jetty.port", 8080).intValue()) server.setConnectors(Array(connector)) val webapp = new

Embedded Jetty - IllegalStateException: No SessionManager

限于喜欢 提交于 2020-01-12 14:07:15
问题 I've found plenty of references to this issue on google but no answers. I'm using the latest version of jetty (8.1.2.v20120308) and I can't seem to get an embedded servlet to be able to use sessions. The example is in scala of course, but it should be readable to any java programmer. val server = new Server(); val connector = new SelectChannelConnector() connector.setPort(Integer.getInteger("jetty.port", 8080).intValue()) server.setConnectors(Array(connector)) val webapp = new

Embedded Jetty - IllegalStateException: No SessionManager

余生长醉 提交于 2020-01-12 14:07:06
问题 I've found plenty of references to this issue on google but no answers. I'm using the latest version of jetty (8.1.2.v20120308) and I can't seem to get an embedded servlet to be able to use sessions. The example is in scala of course, but it should be readable to any java programmer. val server = new Server(); val connector = new SelectChannelConnector() connector.setPort(Integer.getInteger("jetty.port", 8080).intValue()) server.setConnectors(Array(connector)) val webapp = new

Embedding Jetty as a Servlet Container

爷,独闯天下 提交于 2020-01-09 09:24:05
问题 I'm using Tomcat to serve my Java Servlets and it's kinda more for me. I just need to serve, Servlet Requests alone, no static content, neither JSP, etc. So I was looking for a Servlet container that can be embedded in my Application. I felt it if stripped Jetty and use it as a Servlet Container alone, it can be more scalable and occupying small memory footprint, [I don't need Jetty's 'Web Server' and other Parts]. So I've a few questions though, How do I embed Jetty in my Application Code to

Jersey: How to Add Jackson to Servlet Holder

三世轮回 提交于 2020-01-09 05:23:25
问题 I am creating an embedded Jetty webapp with Jersey. I do not know how to add Jackson for automatic JSON serde here: ServletHolder jerseyServlet = context.addServlet( org.glassfish.jersey.servlet.ServletContainer.class, "/*"); jerseyServlet.setInitOrder(0); jerseyServlet.setInitParameter( ServerProperties.PROVIDER_CLASSNAMES, StringUtils.join( Arrays.asList( HealthCheck.class.getCanonicalName(), Rest.class.getCanonicalName()), ";")); // Create JAX-RS application. final Application application

Jetty configuration: problems with MySQL JNDI

喜夏-厌秋 提交于 2020-01-06 20:02:44
问题 The Jetty embedded has a jetty.xml for the configuration. This configuration has a mysql jndi-connection. When I run jetty with gradle, it throws an exception: Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource at org.eclipse.jetty.util.Loader.loadClass(Loader.java:86) at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.nodeClass(XmlConfiguration.java:364) at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.newObj

RESTEasy support for JAX-RS @RolesAllowed

时光总嘲笑我的痴心妄想 提交于 2020-01-06 04:24:46
问题 I've spend hours installing a custom login service in embedded Jetty 9.1.0.v20131115 and RESTEasy 3.0.5.Final. My login service will look users up in a database and assign them roles. It looks something like this: final Constraint restConstraint = new Constraint(); restConstraint.setName(Constraint.__BASIC_AUTH); restConstraint.setRoles(new String[]{"user", "admin"); restConstraint.setAuthenticate(true); final ConstraintMapping restConstraintMapping = new ConstraintMapping();