{"action":"created","issue":{"url":"https://api.github.com/repos/nginx-clojure/nginx-clojure/issues/94","repository_url":"https://api.github.com/repos/nginx-clojure/nginx-clojure","labels_url":"https://api.github.com/repos/nginx-clojure/nginx-clojure/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/nginx-clojure/nginx-clojure/issues/94/comments","events_url":"https://api.github.com/repos/nginx-clojure/nginx-clojure/issues/94/events","html_url":"https://github.com/nginx-clojure/nginx-clojure/issues/94","id":106072316,"number":94,"title":"how to make unbelievably long classpaths work reliably","user":{"login":"kjniemi","id":4488024,"avatar_url":"https://avatars.githubusercontent.com/u/4488024?v=3","gravatar_id":"","url":"https://api.github.com/users/kjniemi","html_url":"https://github.com/kjniemi","followers_url":"https://api.github.com/users/kjniemi/followers","following_url":"https://api.github.com/users/kjniemi/following{/other_user}","gists_url":"https://api.github.com/users/kjniemi/gists{/gist_id}","starred_url":"https://api.github.com/users/kjniemi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjniemi/subscriptions","organizations_url":"https://api.github.com/users/kjniemi/orgs","repos_url":"https://api.github.com/users/kjniemi/repos","events_url":"https://api.github.com/users/kjniemi/events{/privacy}","received_events_url":"https://api.github.com/users/kjniemi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2015-09-11T19:01:49Z","updated_at":"2016-12-16T23:18:30Z","closed_at":"2015-10-25T17:26:26Z","body":"While this is an issue it's also a document on how to get it done if one really has to.\n\nI have a \"project\" which has in excess of 150 jars (don't ask) that have to be in its classpath for it to run. Originally written as a standalone application for the command line it works well using `-cp lib/*` however that cannot be used with nginx-clojure.\n\nAs a workaround I tried using jvm_var and jvm_options as follows:\n\n```\njvm_var lib \"/path/to/library\";\njvm_var jar0 \"#{lib}xstream-1.4.4.jar:#{lib}activemq-stomp.jar:#{lib}activemq-broker.jar:#{lib}jms.jar\";\n...\njvm_var jar17 \"#{lib}gson.jar:#{lib}diffutils.jar:#{lib}jdom.jar:#{lib}batik-svggen.jar:#{lib}batik-dom.jar:#{lib}batik-script.jar:#{lib}batik-parser.jar:#{lib}batik-swing.jar\";\n\njvm_options \"-Djava.class.path=#{jar0}:#{jar1}:#{jar2}:#{jar3}:#{jar4}:#{jar5}:#{jar6}:#{jar7}:#{jar8}:#{jar9}:#{jar10}:#{jar11}:#{jar12}:#{jar13}:#{jar14}:#{jar15}:#{jar16}:#{jar17}:#{jar18}\";\n```\n\nThe reason for having to split jvm_var on several lines and using variable expansion is nginx's builtin parser which has a maximum line length which got exceeded quickly. It also turns out that `-cp` and `-Djava.class.path` are not the same thing at all. Magically some of the jars will silently not load for one or another reason and the errors were always related to missing classes.\n\nThe only way I could figure to get the whole thing to work was to create a jar which contains a `META-INF/MANIFEST.MF` with the following contents:\n\n```\nPremain-Class: nginx.clojure.wave.JavaAgent\nMain-Class: clojure.main\n /path/to/1st.jar\n /path/to/2nd.jar\n /path/to/150th.jar\n\n```\n"},"comment":{"url":"https://api.github.com/repos/nginx-clojure/nginx-clojure/issues/comments/267719590","html_url":"https://github.com/nginx-clojure/nginx-clojure/issues/94#issuecomment-267719590","issue_url":"https://api.github.com/repos/nginx-clojure/nginx-clojure/issues/94","id":267719590,"user":{"login":"knasim","id":11066836,"avatar_url":"https://avatars.githubusercontent.com/u/11066836?v=3","gravatar_id":"","url":"https://api.github.com/users/knasim","html_url":"https://github.com/knasim","followers_url":"https://api.github.com/users/knasim/followers","following_url":"https://api.github.com/users/knasim/following{/other_user}","gists_url":"https://api.github.com/users/knasim/gists{/gist_id}","starred_url":"https://api.github.com/users/knasim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knasim/subscriptions","organizations_url":"https://api.github.com/users/knasim/orgs","repos_url":"https://api.github.com/users/knasim/repos","events_url":"https://api.github.com/users/knasim/events{/privacy}","received_events_url":"https://api.github.com/users/knasim/received_events","type":"User","site_admin":false},"created_at":"2016-12-16T23:18:30Z","updated_at":"2016-12-16T23:18:30Z","body":"Never mind !  \r\nit's supposed be the location to libjvm.so file\r\n`i.e /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.x86_64/jre/lib/amd64/server/libjvm.so`"}}
{"actor":{"display_login":"knasim"}}