Announcement Announcement Module
Collapse
No announcement yet.
Maven build hangs on simple Roo script Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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:
    roo.sh script lms.roo
    mvn clean install

  • #2
    The roo script.

    The roo script.

    Comment


    • #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

      Comment


      • #4
        The cpu is around 100

        The cpu is quite high..

        PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
        5315 stephane 20 0 932m 331m 8860 S 102 11.0 0:38.60 java

        Comment


        • #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(Arrays.java:3209)
          at java.lang.String.<init>(String.java:215)
          at java.lang.StringBuilder.toString(StringBuilder.jav a:430)
          at org.apache.maven.plugin.surefire.report.TestSetRun Listener.getAsString(TestSetRunListener.java:213)
          at org.apache.maven.plugin.surefire.report.TestSetRun Listener.testError(TestSetRunListener.java:150)
          at org.apache.maven.plugin.surefire.booterclient.outp ut.ForkClient.consumeLine(ForkClient.java:115)
          at org.apache.maven.plugin.surefire.booterclient.outp ut.ThreadedStreamConsumer$Pumper.run(ThreadedStrea mConsumer.java:67)
          at java.lang.Thread.run(Thread.java:662)
          Exception in thread "Thread-1" java.lang.OutOfMemoryError: GC overhead limit exceeded
          at java.util.Arrays.copyOf(Arrays.java:2882)
          at java.lang.AbstractStringBuilder.expandCapacity(Abs tractStringBuilder.java:100)
          at java.lang.AbstractStringBuilder.append(AbstractStr ingBuilder.java:515)
          at java.lang.StringBuffer.append(StringBuffer.java:30 6)
          at java.io.BufferedReader.readLine(BufferedReader.jav a:345)
          at java.io.BufferedReader.readLine(BufferedReader.jav a:362)
          at org.codehaus.plexus.util.cli.StreamPumper.run(Stre amPumper.java:129)
          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.

          Comment


          • #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.

            Comment


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

              Comment


              • #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.

                Comment


                • #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

                  Comment


                  • #10
                    Hi,

                    Has anyone found a solution for this?

                    Thanks,
                    Rosh

                    Comment


                    • #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 figuration.java:1343)
                      at org.hibernate.tool.hbm2ddl.SchemaValidator.validat e(SchemaValidator.java:139)
                      at org.hibernate.impl.SessionFactoryImpl.<init>(Sessi onFactoryImpl.java:378)
                      at org.hibernate.cfg.Configuration.buildSessionFactor y(Configuration.java:1872)
                      at org.hibernate.ejb.Ejb3Configuration.buildEntityMan agerFactory(Ejb3Configuration.java:906)

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

                      And ended up on a previous forum thread of mine at:
                      http://forum.springsource.org/showth...ith-text-field

                      Stuuuuuupid :-)

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

                      Comment


                      • #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 http://forum.springsource.org/showth...-tables-schema and http://forum.springsource.org/showth...ts-(Cascading)

                        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.

                        Comment


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

                          Comment

                          Working...
                          X