Nginx与Windows 10上的Clojure / Java – 无法启动

我正面临着Nginx无法启动的问题。 按照步骤 – 也提到了链接 – >我下载了包含nginxclojure-0.4.4的.zip文件,并将其解压缩到C:\ nginx中。 我的.conf文件如下所示:

daemon off; #master_process off; #user nobody; worker_processes 1; error_log logs/error.log; pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; #jvm_path auto; jvm_path 'C:/Program Files/Java/jdk1.8.0_91/jre/bin/server/jvm.dll'; jvm_var my_other_jars 'C:/nginx-clojure-0.4.4/jars'; jvm_classpath "#{my_other_jars}/*.jar;libs/*"; #jvm_options "-Djava.class.path=jars/nginx-clojure-0.4.0.jar;#{my_other_jars}"; jvm_options "-Xms1024m"; jvm_options "-Xmx1024m"; server { #listen 8080; listen 9091; server_name localhost; location / { root html; index index.html index.htm; } location /java { content_handler_type 'java'; content_handler_name 'mytest.HelloService'; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location /clojure { handler_type 'clojure'; handler_code ' (fn[req] { :status 200, :headers {"content-type" "text/plain"}, :body "Hello Clojure & Nginx!" }) '; } } } 

现在我运行nginx-win64.exe如下:

 Windows PowerShell Copyright (C) 2016 Microsoft Corporation. All rights reserved. PS C:\WINDOWS\system32> cd c:\nginx PS C:\nginx> .\nginx-win64.exe PS C:\nginx> 

当我去localhost:9091,页面不加载意味着nginx没有启动。

这是.log文件的快照:

 java.lang.NoClassDefFoundError: nginx/clojure/MiniConstants Caused by: java.lang.ClassNotFoundException: nginx.clojure.MiniConstants at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) 2016/12/26 20:27:48 [error] 8400#4396: can not initialize jvm memory util 2016/12/26 20:27:48 [error] 8400#4396: jvm start times 1 Exception in thread "main" 2016/12/26 20:27:48 [error] 8408#2548: jvm may be mad for wrong options! See hs_err_pid****.log for detail! restarted 2 2016/12/26 20:27:48 [error] 8408#2548: we try quit master now! 2016/12/26 20:27:48 [crit] 8408#2548: ngx_http_clojure_quit_master, file ("C:\nginx\nginx-win64.exe"), arg (""C:\nginx\nginx-win64.exe" -s stop") 2016/12/26 20:27:48 [error] 8584#8808: jvm may be mad for wrong options! See hs_err_pid****.log for detail! restarted 3 2016/12/26 20:27:48 [error] 8584#8808: we try quit master now! 2016/12/26 20:27:48 [crit] 8584#8808: ngx_http_clojure_quit_master, file ("C:\nginx\nginx-win64.exe"), arg (""C:\nginx\nginx-win64.exe" -s stop") 2016/12/26 20:27:48 [error] 2580#8744: CreateFile() "C:\nginx/logs/nginx.pid" failed (2: The system cannot find the file specified) 

以下是@dscastro注释之后的error.log文件:

 2017/01/03 14:24:58 [error] 2552#5560: invalid java content_handler code : mytest.HelloService Exception in thread "main" 2017/01/03 14:24:59 [error] 3304#4676: jvm may be mad for wrong options! See hs_err_pid****.log for detail! restarted 2 2017/01/03 14:24:59 [error] 3304#4676: we try quit master now! 2017/01/03 14:24:59 [crit] 3304#4676: ngx_http_clojure_quit_master, file ("C:\nginx\nginx-win64.exe"), arg (""C:\nginx\nginx-win64.exe" -s stop") 2017/01/03 14:24:59 [error] 4584#5632: jvm may be mad for wrong options! See hs_err_pid****.log for detail! restarted 3 2017/01/03 14:24:59 [error] 4584#5632: we try quit master now! 2017/01/03 14:24:59 [crit] 4584#5632: ngx_http_clojure_quit_master, file ("C:\nginx\nginx-win64.exe"), arg (""C:\nginx\nginx-win64.exe" -s stop") 2017/01/03 14:24:59 [error] 7172#5508: CreateFile() "C:\nginx/logs/nginx.pid" failed (2: The system cannot find the file specified) 

Solutions Collecting From Web of "Nginx与Windows 10上的Clojure / Java – 无法启动"