Maven hangs after compiling

600 views
Skip to first unread message

Tony Garcia

unread,
May 7, 2013, 6:49:27 AM5/7/13
to clojure-ma...@googlegroups.com
Hi,

I'm compiling a small project using the maven plugin v. 1.13.15.

Everything seems to work fine at the beginning, the dependencies are found and the compilation of my 3 namespaces works without errors, the problem is that just after the compilation the mvn process seems to hang indefinitely, it never ends and it doesn't print any errors.

This is my plugin configuration:


 <plugin>
        <groupId>com.theoryinpractise</groupId>
        <artifactId>clojure-maven-plugin</artifactId>
        <version>1.3.15</version>
        <extensions>true</extensions>
        <configuration>
          <temporaryOutputDirectory>true</temporaryOutputDirectory>
          <warnOnReflection>false</warnOnReflection>
          <clojureOptions>-Xmx512m -Xms512m -server -XX:PermSize=64M -XX:MaxPermSize=256M -Dfile.encoding=UTF8</clojureOptions>
          <sourceDirectories>
            <sourceDirectory>src/clj</sourceDirectory>
          </sourceDirectories>
          <testSourceDirectories>
            <testSourceDirectory>src/test/clj</testSourceDirectory>
          </testSourceDirectories>
        </configuration>

        <executions>
          <execution>
            <id>compile</id>
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>


And this is the plugin output:

[INFO] [clojure:add-source {execution: default-add-source}]
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/garciaj/projects/TWC/2.x/twc/cats-eye/src/main/resources
[INFO] skip non existing resourceDirectory /home/garciaj/projects/TWC/2.x/twc/cats-eye/src/main/resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [clojure:compile {execution: default-compile}]
Compiling web-harness.core to /tmp/classes4374911852364252924.dir
Compiling web-harness.twc to /tmp/classes4374911852364252924.dir
Compiling web-harness.remotes to /tmp/classes4374911852364252924.dir

It never goes any further than that, what am I doing wrong?

Thanks for your help and best regards,
Tony Garcia.

Mark Derricutt

unread,
May 7, 2013, 4:01:45 PM5/7/13
to clojure-ma...@googlegroups.com
Hi there,

You don't possibly have any code in your.clj files that are running code, as opposed to just defining functions etc. do you?

One of the annoying quirks of Clojure's "compiler" is that it is essentially just a REPL that writes .class files to disk rather than memory, so if you have any loose code like say (print "hello") you'll see that executed when compiling.

I see the last file being compiled was "web-harness.remotes" - I don't suppose you have any code defined in there that's maybe being run and not just defined - trying to talk to a remote service, and hanging?

Also, if you run maven with -X you'll see a lot more debug information as well, which may be useful ( to me anyway )

Mark


Tony Garcia wrote:
--

---
You received this message because you are subscribed to the Google
Groups "Clojure Maven Plugin" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to clojure-maven-pl...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Samuel Judith

unread,
Jul 2, 2013, 6:15:18 PM7/2/13
to clojure-ma...@googlegroups.com
Hi,

I had the same experience today on linux environment with the clojure maven plugin v.1.13.15 :-(

The java process for clojure compilation hangs indefinitely; it just display being compiled a clj file but never ends. The process takes more than 90% of my CPU...
I tried clojureOptions with -Xmx512m: the compilation goes further but then hangs again.

It's quite strange because on a windows environment, I do not have the same behaviour: clojure code is compiled without problems.

I had a try with the clojure maven plugin v1.13.1 to embed the clojure compilation in the same process than maven: no better behaviour.

Any idea ?

Thanks in advance,
Samuel

Mark Derricutt

unread,
Jul 2, 2013, 8:00:16 PM7/2/13
to clojure-ma...@googlegroups.com
Can you provide a thread-dump from the JVM running the compilation process?

That'll help in seeing where things might be hanging.

Samuel Judith

unread,
Jul 3, 2013, 9:54:26 AM7/3/13
to clojure-ma...@googlegroups.com
Here is a thread dump before the process stops to answer to any thread dump request:

Full thread dump Java HotSpot(TM) Server VM (23.25-b01 mixed mode):

"Service Thread" daemon prio=10 tid=0x8e2b9800 nid=0x9d1 runnable [0x00000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" daemon prio=10 tid=0x8e2b7c00 nid=0x9d0 waiting on condition [0x00000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" daemon prio=10 tid=0x8e2b5c00 nid=0x9cf waiting on condition [0x00000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" daemon prio=10 tid=0x8e2b4000 nid=0x9ce waiting on condition [0x00000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" daemon prio=10 tid=0x8e278000 nid=0x9cd in Object.wait() [0x9026c000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x9494a048> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135)
    - locked <0x9494a048> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151)
    at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:189)

"Reference Handler" daemon prio=10 tid=0x8e276400 nid=0x9cc in Object.wait() [0x8e17d000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x94949d58> (a java.lang.ref.Reference$Lock)
    at java.lang.Object.wait(Object.java:503)
    at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:133)
    - locked <0x94949d58> (a java.lang.ref.Reference$Lock)

"main" prio=10 tid=0xb750d800 nid=0x9c7 runnable [0xb76fc000]
   java.lang.Thread.State: RUNNABLE
    at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
    at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:242)
    at java.io.File.exists(File.java:772)
    at sun.misc.URLClassPath$FileLoader.getResource(URLClassPath.java:1072)
    at sun.misc.URLClassPath.getResource(URLClassPath.java:199)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:358)
    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:424)
    - locked <0xa9fffe10> (a java.lang.Object)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at com.swi.tm.core.internal.parser.dispatcher__init.load(Unknown Source)
    at com.swi.tm.core.internal.parser.dispatcher__init.<clinit>(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:270)
    at clojure.lang.RT.loadClassForName(RT.java:2056)
    at clojure.lang.RT.load(RT.java:419)
    at clojure.lang.RT.load(RT.java:400)
    at clojure.core$load$fn__4890.invoke(core.clj:5415)
    at clojure.core$load.doInvoke(core.clj:5414)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5227)
    at clojure.core$compile$fn__4895.invoke(core.clj:5426)
    at clojure.core$compile.invoke(core.clj:5425)
    at clojure.lang.Var.invoke(Var.java:415)
    at clojure.lang.Compile.main(Compile.java:81)

"VM Thread" prio=10 tid=0x8e270c00 nid=0x9cb runnable

"GC task thread#0 (ParallelGC)" prio=10 tid=0xb7517400 nid=0x9c8 runnable

"GC task thread#1 (ParallelGC)" prio=10 tid=0xb7518c00 nid=0x9c9 runnable

"GC task thread#2 (ParallelGC)" prio=10 tid=0xb751a400 nid=0x9ca runnable

"VM Periodic Task Thread" prio=10 tid=0x8e2bb400 nid=0x9d2 waiting on condition

JNI global references: 191

Heap
 PSYoungGen      total 9856K, used 7037K [0xa9990000, 0xaa590000, 0xb4430000)
  eden space 8064K, 83% used [0xa9990000,0xaa01f6e0,0xaa170000)
  from space 1792K, 17% used [0xaa3d0000,0xaa420010,0xaa590000)
  to   space 2112K, 0% used [0xaa170000,0xaa170000,0xaa380000)
 ParOldGen       total 21504K, used 15210K [0x94430000, 0x95930000, 0xa9990000)
  object space 21504K, 70% used [0x94430000,0x9530aa80,0x95930000)
 PSPermGen       total 16384K, used 14830K [0x90430000, 0x91430000, 0x94430000)
  object space 16384K, 90% used [0x90430000,0x912aba88,0x91430000)


Reply all
Reply to author
Forward
0 new messages