Hi there,
As a clojure newbie I tried to run a nailgun example from Phil
Hagelburg which I found here in the archive.
I created a directory example. In example I put a file project.clj
<------------------------------------snip---------------------------------->
(defproject example "0.1"
:description "Example application via nailgun"
:dependencies [[org.clojure/clojure
"1.1.0"]
[org.clojure/clojure-contrib
"1.0-SNAPSHOT"]]
:main example)
<------------------------------------snap---------------------------------->
and a Makefile which does the standard calls to lein.
In directory src/nailgun/ I put example.clj which looks like this:
<------------------------------------snip---------------------------------->
(ns nailgun.example
(:use [clojure.contrib.duck-streams])
(:import [com.martiansoftware.nailgun NGServer NGContext]
[java.io BufferedReader InputStreamReader
OutputStreamWriter PrintWriter])
(:gen-class))
(gen-class :name nailgun.Example
:prefix "Example-"
:methods [#^{:static true}
[nailMain [com.martiansoftware.nailgun.NGContext] void]]
:main false)
(defn Example-nailMain
[#^NGContext context]
(let [out (writer (-> context .out))]
(copy (-> context .in) out)
(.flush out)))
(defn -main []
(.start (Thread. (NGServer.))))
<------------------------------------snap---------------------------------->
Now make UBERJAR creates example-standalone.jar.
When now I try: java -server -jar example-standalone.jar
I get:
Exception in thread "main" java.lang.NoClassDefFoundError: example
Caused by: java.lang.ClassNotFoundException: example
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: example. Program will exit.
Is it just a missing parameter in my invocation? or did I do anything
completely wrong due to not really understanding what's going on?
--
Thanks,
Manfred
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
To unsubscribe, reply using "remove me" as the subject.