unit icon indicating copy to clipboard operation
unit copied to clipboard

If java supported

Open oops-oom opened this issue 9 years ago • 22 comments

Unit will work as tomcat or jetty if java supported? Or what it supposed todo?

oops-oom avatar Sep 12 '17 18:09 oops-oom

It is currently in R&D stage. What would you suggest? We'd like to hear users opinions.

VBart avatar Sep 12 '17 18:09 VBart

@VBart Based on code for golang, it looks like you're starting a server via C code and then using FFI to interact with golang code. Is that right?

Also Do you have latency and throughput comparison to Netty 4 (netty-transport-native-epoll artifact)?

rmohta avatar Oct 10 '17 05:10 rmohta

@rmohta That's right.

As of doing comparison to Netty, currently it doesn't make sense. While the architecture of Unit is designed to show the best performance, but on the current stage of development it's not expected.

VBart avatar Oct 10 '17 17:10 VBart

@vbart Okay. What is an ideal architecture for Unit? Is it to provide ability to expose APIs and provide a bridge to glue your service code? Something like Servless/fn platform or something else?

rmohta avatar Oct 11 '17 00:10 rmohta

Ideally, when it's possible to integrate interpreter or virtual machine and load it as a dynamic module. PHP, Python and Ruby (coming soon) work that way.

VBart avatar Oct 11 '17 18:10 VBart

Any guy looked at GraalVM project? https://www.graalvm.org/ it's embeddable. GraalVM can be embedded in both managed and native applications. There are existing integrations into OpenJDK, Node.js, Oracle Database, and MySQL. If Oracle Database & MySQL can embed GraalVM, and I think Nginx Unit can embed GraalVM for Java.

linux-china avatar May 02 '18 21:05 linux-china

@linux-china Thanks. That looks interesting.

VBart avatar May 03 '18 20:05 VBart

Experimental Java web app support added in https://github.com/mar0x/unit/tree/java . Currently it is able to run basic Spring Boot web applications, packaged as war (see https://github.com/mar0x/gs-spring-boot ).

mar0x avatar Oct 22 '18 17:10 mar0x

is the plan to support any JVM based language in Unit ?

ghost avatar Oct 30 '18 13:10 ghost

We are going to implement a servlet container for web applications based on Java Servlet 3.1 Specification. Currently we focus on Java, but I hope the container will work with applications written in other JVM-based languages if the application follows the requirements like other containers do.

To prioritize, we'd like to know more about your application, the language used, and the ultimate goal you aim to achieve when running your application with Unit.

mar0x avatar Nov 01 '18 11:11 mar0x

@mar0x we use Clojure within a JVM.

ghost avatar Nov 02 '18 16:11 ghost

Steve, I've tried basic Clojure web application. Being packaged as a standalone war, it works well under Unit with experimental Java support (https://github.com/mar0x/unit/tree/java).

mar0x avatar Nov 14 '18 16:11 mar0x

Static files serving introduced in experimental Java support. Looking for early adopters.

mar0x avatar Nov 15 '18 15:11 mar0x

Unit 1.8 may work as Tomcat or Jetty. Please refer to documentation (http://unit.nginx.org/configuration/#configuration-java) for more information.

mar0x avatar Mar 04 '19 12:03 mar0x

No support for user/group settings for Java? Or just lack information in the documentation?

avkarenow avatar Mar 04 '19 23:03 avkarenow

@avkarenow http://unit.nginx.org/configuration/#application-objects

Each application object has a number of common options that can be specified for any application regardless of its type.

VBart avatar Mar 05 '19 00:03 VBart

@VBart which version of Unit works with Java? I am using 1.8.0 but when uploading a JSON config it throws: "The module to run "java" is not found among the available application modules. "

incube8r avatar May 23 '19 13:05 incube8r

@incube8r BETA Java support introduced in Unit 1.8.0. You need to install JSC (Java Servlet Container) module. Please read http://unit.nginx.org/installation/ for you OS or consider installation from sources (http://unit.nginx.org/installation/#source-code).

mar0x avatar May 23 '19 15:05 mar0x

@mar0x that worked! Thanks!

I tried running a web app that works well with Tomcat, Jetty, and Payara (tested) but Unit does not seem to be able to run it, it throws this error:

Caused by: java.lang.SecurityException: Couldn't parse jurisdiction policy files in: unlimited
	at java.base/javax.crypto.JceSecurity.setupJurisdictionPolicies(JceSecurity.java:357)
	at java.base/javax.crypto.JceSecurity$1.run(JceSecurity.java:111)
	at java.base/javax.crypto.JceSecurity$1.run(JceSecurity.java:108)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/javax.crypto.JceSecurity.<clinit>(JceSecurity.java:107)
	... 76 more 

incube8r avatar May 23 '19 15:05 incube8r

@mar0x that worked! Thanks!

I tried running a web app that works well with Tomcat, Jetty, and Payara (tested) but Unit does not seem to be able to run it, it throws this error:

Caused by: java.lang.SecurityException: Couldn't parse jurisdiction policy files in: unlimited
	at java.base/javax.crypto.JceSecurity.setupJurisdictionPolicies(JceSecurity.java:357)
	at java.base/javax.crypto.JceSecurity$1.run(JceSecurity.java:111)
	at java.base/javax.crypto.JceSecurity$1.run(JceSecurity.java:108)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/javax.crypto.JceSecurity.<clinit>(JceSecurity.java:107)
	... 76 more 

I added the issue here https://github.com/nginx/unit/issues/255

incube8r avatar May 23 '19 16:05 incube8r