grizzly

How to enable CDI inject in web service (jaxrs/jersey) on java se running grizzly?

删除回忆录丶 提交于 2019-11-27 14:06:11
How do I allow CDI injection of resources into restful web service resources? I am running on standard java using weld 2 (cdi), jersey (jaxrs), and grizzly (web server). Here is my simple web resource: import training.student.StudentRepository; import javax.inject.Inject; import javax.ws.rs.*; @Path("student") public class StudentWebResource { @Inject private StudentRepository studentRepository; @GET @Path("count") @Produces(MediaType.TEXT_PLAIN) public Integer getCount() { return studentRepository.studentCount(); } } And here is how I've got weld starting my simple web server: public class

Websocket SSL handshake failure

南楼画角 提交于 2019-11-27 07:44:25
问题 I have spring-boot Tomcat server for secure websocket connections. The server accepts Android 4.4, iOS, Firefox, and Chrome clients without failure with an authority-signed certificate. Android 5.0, however, fails the SSL handshake. Caused by: javax.net.ssl.SSLHandshakeException: Handshake failed at com.android.org.conscrypt.OpenSSLEngineImpl.unwrap(OpenSSLEngineImpl.java:436) at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:1006) at org.glassfish.grizzly.ssl.SSLConnectionContext.unwrap

Grizzly and Jersey standalone jar

旧巷老猫 提交于 2019-11-27 03:29:13
问题 I am trying to package Grizzly with Jersey as a single jar using Maven shade plugin. But I always get the message No container provider supports the type class org.glassfish.grizzly.http.server.HttpHandler The code works fine in Eclipse, but not in a packaged jar: public class Main { private static URI getBaseURI() { return UriBuilder.fromUri("http://localhost/").port(9998).build(); } public static final URI BASE_URI = getBaseURI(); protected static HttpServer startServer() throws IOException

Basic HTTP authentication with Jersey / Grizzly

非 Y 不嫁゛ 提交于 2019-11-27 02:19:30
问题 I've written a simple REST server using JAX-RS, Jersey and Grizzly. This is how I start the server: URI baseUri = UriBuilder.fromUri("http://localhost/api") .port(8081) .build(); ResourceConfig rc = new PackagesResourceConfig("se.aioobe.resources"); HttpServer httpServer = GrizzlyServerFactory.createHttpServer(baseUri, rc); Now I need to protect the resources using Basic HTTP authentication, and I can't figure out how to do this. I can switch from Grizzly to for instance Jetty if it is

Can not deserialize instance of java.lang.String out of START_OBJECT token

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 01:44:16
问题 I'm running into an issue where my deployable jar hits an exception that doesn't happen when I run this locally in IntelliJ. Exception: Receiving an event {id=2, socket=0c317829-69bf-43d6-b598-7c0c550635bb, type=getDashboard, data={workstationUuid=ddec1caa-a97f-4922-833f-632da07ffc11}, reply=true} Firing getDashboard event to Socket#0c317829-69bf-43d6-b598-7c0c550635bb Failed invoking AtmosphereFramework.doCometSupport() java.lang.IllegalArgumentException: Can not deserialize instance of java

How to enable CDI inject in web service (jaxrs/jersey) on java se running grizzly?

微笑、不失礼 提交于 2019-11-26 16:36:04
问题 How do I allow CDI injection of resources into restful web service resources? I am running on standard java using weld 2 (cdi), jersey (jaxrs), and grizzly (web server). Here is my simple web resource: import training.student.StudentRepository; import javax.inject.Inject; import javax.ws.rs.*; @Path("student") public class StudentWebResource { @Inject private StudentRepository studentRepository; @GET @Path("count") @Produces(MediaType.TEXT_PLAIN) public Integer getCount() { return