Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx won't start successfully #46

Closed
jmmk opened this issue Sep 26, 2014 · 5 comments
Closed

Nginx won't start successfully #46

jmmk opened this issue Sep 26, 2014 · 5 comments

Comments

@jmmk
Copy link

jmmk commented Sep 26, 2014

This is on Amazon Linux. I tried the binaries and compiling from source and I get the same error both times (with nginx-clojure-0.2.5):

Exception in thread "main" java.lang.NoClassDefFoundError: nginx/clojure/MiniConstants
Caused by: java.lang.ClassNotFoundException: nginx.clojure.MiniConstants
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
2014/09/26 14:03:39 [error] 11564#0: can not initialize jvm memory util
2014/09/26 14:03:39 [error] 11564#0: jvm start times 1
2014/09/26 14:03:39 [alert] 11430#0: worker process 11564 exited with fatal code 2 and cannot be respawned
@xfeep
Copy link
Member

xfeep commented Sep 26, 2014

Could you please show us your nginx.conf ?

@jmmk
Copy link
Author

jmmk commented Sep 26, 2014

The jvm variables are set to the following:

    jvm_path "/usr/lib/jvm/java-1.7.0-openjdk.x86_64/jre/lib/amd64/server/libjvm.so";
    jvm_options "-Djava.class.path=/home/ec2-user/jars/nginx-clojure-0.2.6.jar";

Everything else was left to default. This is the compiled version. With the binary, I had jvm_options "-Djava.class.path=/home/ec2-user/nginx-clojure-0.2.5/nginx-1.6.0/jars/nginx-clojure-0.2.5.jar";

@xfeep
Copy link
Member

xfeep commented Sep 26, 2014

What your OS user to run nginx workers? Maybe this user can not access /home/ec2-user/nginx-clojure-0.2.5/nginx-1.6.0/jars/nginx-clojure-0.2.5.jar.

In nginx.conf user can be set which OS user to run nginx workers.

#user  nobody;

If you run nginx with root, the default user is nobody to run nginx workers. Otherwise the default user to run nginx workers is the same with the user who runs nginx master.

@jmmk
Copy link
Author

jmmk commented Sep 26, 2014

That sounds like it could be the case, as I've run into similar issues with nginx before. I won't be able to try it out until later, but I'll come back with the results.

@jmmk
Copy link
Author

jmmk commented Sep 27, 2014

I set user ec2-user; in nginx.conf and it solved the problem. Thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants