Announcement Announcement Module
No announcement yet.
Maven build hangs on simple Roo script Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Maven build hangs on simple Roo script

    I'm trying to run a Maven build on a newly created Roo project.

    But the build hangs, the console display stops at the Test phase.

    [INFO] Nothing to compile - all classes are up to date
    [INFO] [surefire:test {execution: default-test}]
    [INFO] Surefire report directory: /home/stephane/dev/java/projects/spring-roo/ajeter/data/target/surefire-reports

    T E S T S
    This occurs consistently. It occurs both on Maven 2.2.1 and on Maven 3.0.4.

    I run a Linux Mint box.

    I only run the two commands:

    Code: script lms.roo
    mvn clean install

  • #2
    The roo script.

    The roo script.


    • #3
      Running the command:
      mvn -X -e clean test
      does not give a lot more:

      T E S T S
      Forking command line: /bin/sh -c cd /home/stephane/dev/java/projects/spring-roo/ajeter/data && /home/stephane/programs/jdk1.6.0_29/jre/bin/java -jar /home/stephane/dev/java/projects/spring-roo/ajeter/data/target/surefire/surefirebooter515377858181215462.jar /home/stephane/dev/java/projects/spring-roo/ajeter/data/target/surefire/surefire628953390200507817tmp /home/stephane/dev/java/projects/spring-roo/ajeter/data/target/surefire/surefire_05262971527775049412tmp


      • #4
        The cpu is around 100

        The cpu is quite high..

        5315 stephane 20 0 932m 331m 8860 S 102 11.0 0:38.60 java


        • #5
          After a long hanging wait, I've now got more feedback:

          T E S T S
          Exception in thread "ThreadedStreamConsumer" java.lang.OutOfMemoryError: Java heap space
          at java.util.Arrays.copyOfRange(
          at java.lang.String.<init>(
          at java.lang.StringBuilder.toString(StringBuilder.jav a:430)
          at Listener.getAsString(
          at Listener.testError(
          at org.apache.maven.plugin.surefire.booterclient.outp ut.ForkClient.consumeLine(
          at org.apache.maven.plugin.surefire.booterclient.outp ut.ThreadedStreamConsumer$
          Exception in thread "Thread-1" java.lang.OutOfMemoryError: GC overhead limit exceeded
          at java.util.Arrays.copyOf(
          at java.lang.AbstractStringBuilder.expandCapacity(Abs
          at java.lang.AbstractStringBuilder.append(AbstractStr
          at java.lang.StringBuffer.append( 6)
          at a:345)
          at a:362)
          But even after setting the variable:

          export JVM_ARGS="-Xmx1024m -XX:MaxPermSize=1024m"
          the problem remained the same.

          I guess the memory heap space message came up because the process had been hanging for a very long time.
          Last edited by stephaneeybert; Oct 8th, 2012, 08:22 AM.


          • #6
            The build does not hang if running on a much smaller database schema.

            I tried the same script against a database schema that only contains two tables and it did not hang.


            • #7
              I also tried setting the variable:
              export MAVEN_OPTS="-Xmx1024M -XX:MaxPermSize=1024m"
              the problem remained the same.


              • #8
                The schema has 127 tables, it's not so uncommon.

                And I have hand coded in another Spring project (not a Roo one), a Dao with lots of integration tests, against the same database schema, and it works just fine.
                Last edited by stephaneeybert; Oct 9th, 2012, 11:13 AM.


                • #9
                  Here is where it hangs:

                  T E S T S
                  Forking command line: /bin/sh -c cd /home/stephane/dev/java/projects/spring-roo/learnintouch/data && /home/stephane/programs/jdk1.6.0_29/jre/bin/java -jar /home/stephane/dev/java/projects/spring-roo/learnintouch/data/target/surefire/surefirebooter3683447800132461289.jar /home/stephane/dev/java/projects/spring-roo/learnintouch/data/target/surefire/surefire968319973164727757tmp /home/stephane/dev/java/projects/spring-roo/learnintouch/data/target/surefire/surefire_03812166631428931851tmp


                  • #10

                    Has anyone found a solution for this?



                    • #11
                      I removed as many tables as I could to narrow down the issue, until I was left with only one table: admin

                      And the issue still showed up.

                      Only this time, the Maven hang was so brief it didn't really hang.

                      And running Maven with the -e option showed the exception as being:

                      Caused by: org.hibernate.HibernateException: Wrong column type in freeze.admin for column profile. Found: text, expected: varchar(255)
                      at org.hibernate.mapping.Table.validateColumns(Table. java:283)
                      at org.hibernate.cfg.Configuration.validateSchema(Con
                      at org.hibernate.tool.hbm2ddl.SchemaValidator.validat e(
                      at org.hibernate.impl.SessionFactoryImpl.<init>(Sessi
                      at org.hibernate.cfg.Configuration.buildSessionFactor y(
                      at org.hibernate.ejb.Ejb3Configuration.buildEntityMan agerFactory(

                      I then did a search on the subject:
                      Found: text, expected: varchar(255)

                      And ended up on a previous forum thread of mine at:

                      Stuuuuuupid :-)

                      I thus solved the issue by using the attribute --includeNonPortableAttributes


                      • #12
                        Well, I thought I had solved the issue. But no, it's not the case.

                        When running the show this time on all 117 tables, instead of just the one admin table, Maven still hangs.

                        This time it is for another exception:

                        Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityCons traintViolationException: Column 'elearning_question_id' cannot be null

                        Which is another issue I had stumbled upon in the past, namely that Roo generated tests do not handle foreign key constraints in their data on demand helpers, see and

                        The thing that made it not so obvious was the time Maven spent hanging.

                        To sum it up, we cannot run the integration tests on a reversed engineered real world database schema if we don't hand code the integration tests to take care of the foreign key constraints in the data on demand.


                        • #13
                          This just happened to me when running tests that were creating different contexts. When i left just one context, it stopped hanging