3 Replies Latest reply on May 11, 2010 6:56 AM by mstruk

    Gatein-Maven-Build-Tests fail

    leolo
      Hi,
      when I try to build gatein from svn on a windows XP-System and execeute maven with tests I get the following exceptions:

       

      -------------------------------------------------------
      T E S T S
      -------------------------------------------------------
      Running org.exoplatform.component.test.BootstrapTestCase
      Can't load log handler "java.util.logging.FileHandler"
      java.io.IOException: Couldn't get lock for C:javagateincomponenttestcore/target/gateintest-%u.log
      java.io.IOException: Couldn't get lock for C:javagateincomponenttestcore/target/gateintest-%u.log

          at java.util.logging.FileHandler.openFiles(FileHandler.java:372)
          at java.util.logging.FileHandler.<init>(FileHandler.java:208)

      [...]

      (Full maven-log appended)

       

      Looks like a path-separator-issue to me (slash vs. backslash).

       

      Any idea, how to fix this?

       

      Regards,

       

      LeoLo

       

       

      [INFO] Scanning for projects...
      [INFO] Reactor build order:
      [INFO]   GateIn - Portal
      [INFO]   GateIn Portal Component
      [INFO]   GateIn Portal Test Component
      [INFO]   GateIn Portal Component Core Test
      [INFO]   GateIn Portal Component Core Test JCR
      [INFO]   GateIn Portal Component JBoss IDM integration
      [INFO]   GateIn Portal Component Core Test Organization
      [INFO]   GateIn Portal Component Common
      [INFO]   GateIn Portal Component Resources
      [INFO]   GateIn Portal Component PC integration
      [INFO]   GateIn Portal Component XML Parser
      [INFO]   GateIn Portal Component WSRP integration
      [INFO]   GateIn Portal Component Scripting
      [INFO]   GateIn Portal Component Web
      [INFO]   GateIn Portal Component Portal Data
      [INFO]   GateIn Portal Component Application Registry
      [INFO]   GateIn Portal Component Management
      [INFO]   GateIn Portal WebUI
      [INFO]   GateIn Portal WebUI Core
      [INFO]   GateIn Portal WebUI eXo
      [INFO]   GateIn Portal eXo Gadgets
      [INFO]   GateIn Portal eXo Gadgets Core
      [INFO]   GateIn Portal WebUI Portal
      [INFO]   GateIn Portal Component Dashboard Portlet
      [INFO]   GateIn Portal eXo Gadgets Server
      [INFO]   GateIn Portal eXo Gadgets Application
      [INFO]   GateIn Portal Portlet
      [INFO]   GateIn Portal Portlet Dashboard
      [INFO]   GateIn Portal Portlet eXoAdmin
      [INFO]   GateIn Portal Portlet Web
      [INFO]   GateIn Portal Portlet
      [INFO]   GateIn Portal Web Resources
      [INFO]   GateIn Portal Web Module
      [INFO]   GateIn Portal Web REST application
      [INFO]   GateIn Portal Server
      [INFO]   GateIn Portal Server Tomcat
      [INFO]   GateIn Portal Server Tomcat Patch
      [INFO]   GateIn Portal Server Tomcat Plugin
      [INFO]   GateIn Portal Server JBoss
      [INFO]   GateIn Portal Server JBoss EAR Patch
      [INFO]   GateIn Portal Server JBoss Plugin
      [INFO]   GateIn Portal Sample Extension Configuration
      [INFO]   GateIn Portal Sample Extension Java Classes
      [INFO]   GateIn Portal Sample Extension War
      [INFO]   GateIn Portal Sample Extension Ear
      [INFO]   GateIn Portal Sample Extension
      [INFO]   GateIn Portal Sample Portal Configuration
      [INFO]   GateIn Portal Sample Portal Java Classes
      [INFO]   GateIn Portal Sample Portal War
      [INFO]   GateIn Portal Sample Portal Rest War
      [INFO]   GateIn Portal Sample Portal Ear
      [INFO]   GateIn Portal Sample Portal
      [INFO]   GateIn Portal Examples - Portlets
      [INFO]   GateIn Portal Examples - JSF Hello User Portlet
      [INFO]   GateIn Portal Examples - JSP Hello User Portlet
      [INFO]   GateIn Portal Examples - Simplest Hello World Portlet
      [INFO]   GateIn Portlet Examples - Struts JPetstore
      [INFO]   GateIn Skins
      [INFO]   GateIn Simple Deployable Skin
      [INFO]   GateIn Portal Sample
      [INFO]   GateIn Portal Starter War
      [INFO]   GateIn Portal Starter Ear
      [INFO]   GateIn Portal Starter
      [INFO]   GateIn Portal Packaging
      [INFO]   GateIn Portal Packaging Module
      [INFO]   GateIn Portal Packaging Product
      [INFO]   GateIn Portal Packaging Assemblies
      [INFO]   GateIn Portal Tattletale reports
      [INFO]   TestSuite for GateIn
      [INFO]   Selenium Sniff Test for GateIn
      [INFO]   GateIn Portal Examples - WebUI based samples
      [INFO] ------------------------------------------------------------------------
      [INFO] Building GateIn - Portal
      [INFO]    task-segment: [install]
      [INFO] ------------------------------------------------------------------------
      [INFO] [enforcer:enforce {execution: enforce-plugin-versions}]
      [INFO] [enforcer:enforce {execution: enforce-java-version}]
      [INFO] [enforcer:enforce {execution: enforce-maven-version}]
      [INFO] [antrun:run {execution: compile}]
      [INFO] Executing tasks
      [INFO] Executed tasks
      [INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
      [INFO] [source:jar-no-fork {execution: attach-sources}]
      [INFO] [install:install {execution: default-install}]
      [INFO] Installing C:\java\gatein\pom.xml to C:\HOME\.m2\repository\org\exoplatform\portal\exo.portal.parent\3.0.1-GA-SNAPSHOT\exo.portal.parent-3.0.1-GA-SNAPSHOT.pom
      [INFO] ------------------------------------------------------------------------
      [INFO] Building GateIn Portal Component
      [INFO]    task-segment: [install]
      [INFO] ------------------------------------------------------------------------
      [INFO] [enforcer:enforce {execution: enforce-plugin-versions}]
      [INFO] [enforcer:enforce {execution: enforce-java-version}]
      [INFO] [enforcer:enforce {execution: enforce-maven-version}]
      [INFO] [antrun:run {execution: compile}]
      [INFO] Executing tasks
      [INFO] Executed tasks
      [INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
      [INFO] [source:jar-no-fork {execution: attach-sources}]
      [INFO] [install:install {execution: default-install}]
      [INFO] Installing C:\java\gatein\component\pom.xml to C:\HOME\.m2\repository\org\exoplatform\portal\exo.portal.component\3.0.1-GA-SNAPSHOT\exo.portal.component-3.0.1-GA-SNAPSHOT.pom
      [INFO] ------------------------------------------------------------------------
      [INFO] Building GateIn Portal Test Component
      [INFO]    task-segment: [install]
      [INFO] ------------------------------------------------------------------------
      [INFO] [enforcer:enforce {execution: enforce-plugin-versions}]
      [INFO] [enforcer:enforce {execution: enforce-java-version}]
      [INFO] [enforcer:enforce {execution: enforce-maven-version}]
      [INFO] [antrun:run {execution: compile}]
      [INFO] Executing tasks
      [INFO] Executed tasks
      [INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
      [INFO] [source:jar-no-fork {execution: attach-sources}]
      [INFO] [install:install {execution: default-install}]
      [INFO] Installing C:\java\gatein\component\test\pom.xml to C:\HOME\.m2\repository\org\exoplatform\portal\exo.portal.component.test\3.0.1-GA-SNAPSHOT\exo.portal.component.test-3.0.1-GA-SNAPSHOT.pom
      [INFO] ------------------------------------------------------------------------
      [INFO] Building GateIn Portal Component Core Test
      [INFO]    task-segment: [install]
      [INFO] ------------------------------------------------------------------------
      [INFO] [enforcer:enforce {execution: enforce-plugin-versions}]
      [INFO] [enforcer:enforce {execution: enforce-java-version}]
      [INFO] [enforcer:enforce {execution: enforce-maven-version}]
      [INFO] [resources:resources {execution: default-resources}]
      [INFO] Using 'UTF-8' encoding to copy filtered resources.
      [INFO] Copying 3 resources
      [INFO] [compiler:compile {execution: default-compile}]
      [INFO] Compiling 1 source file to C:\java\gatein\component\test\core\target\classes
      [INFO] [antrun:run {execution: compile}]
      [INFO] Executing tasks
      [INFO] Executed tasks
      [INFO] [resources:testResources {execution: default-testResources}]
      [INFO] Using 'UTF-8' encoding to copy filtered resources.
      [INFO] Copying 0 resource
      [INFO] Copying 1 resource
      [INFO] [compiler:testCompile {execution: default-testCompile}]
      [INFO] Nothing to compile - all classes are up to date
      [INFO] [surefire:test {execution: default-test}]
      [INFO] Surefire report directory: C:\java\gatein\component\test\core\target\surefire-reports

       

      -------------------------------------------------------
      T E S T S
      -------------------------------------------------------
      Running org.exoplatform.component.test.BootstrapTestCase
      Can't load log handler "java.util.logging.FileHandler"
      java.io.IOException: Couldn't get lock for C:javagateincomponenttestcore/target/gateintest-%u.log
      java.io.IOException: Couldn't get lock for C:javagateincomponenttestcore/target/gateintest-%u.log
          at java.util.logging.FileHandler.openFiles(FileHandler.java:372)
          at java.util.logging.FileHandler.<init>(FileHandler.java:208)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
          at java.lang.Class.newInstance0(Class.java:355)
          at java.lang.Class.newInstance(Class.java:308)
          at java.util.logging.LogManager$7.run(LogManager.java:919)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.util.logging.LogManager.initializeGlobalHandlers(LogManager.java:911)
          at java.util.logging.LogManager.access$900(LogManager.java:129)
          at java.util.logging.LogManager$RootLogger.getHandlers(LogManager.java:1018)
          at java.util.logging.Logger.log(Logger.java:454)
          at org.slf4j.impl.JDK14LoggerAdapter.log(JDK14LoggerAdapter.java:587)
          at org.slf4j.impl.JDK14LoggerAdapter.log(JDK14LoggerAdapter.java:659)
          at org.gatein.common.logging.SLF4JLocationAwareLogger.doLog(SLF4JLocationAwareLogger.java:44)
          at org.gatein.common.logging.Logger.log(Logger.java:51)
          at org.gatein.common.logging.Logger.info(Logger.java:115)
          at org.exoplatform.component.test.AbstractGateInTest.runBare(AbstractGateInTest.java:71)
          at junit.framework.TestResult$1.protect(TestResult.java:106)
          at junit.framework.TestResult.runProtected(TestResult.java:124)
          at junit.framework.TestResult.run(TestResult.java:109)
          at junit.framework.TestCase.run(TestCase.java:118)
          at junit.framework.TestSuite.runTest(TestSuite.java:208)
          at junit.framework.TestSuite.run(TestSuite.java:203)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
          at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
          at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
          at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
          at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
      [13:13:13-931][INFO] BootstrapTestCase Running unit test:testRequestLifeCycle
      [13:13:14-056][INFO] RootContainer Building root container
      [13:13:14-150][INFO] RootContainer Active profiles [standalone]
      [13:13:14-150][INFO] AbstractGateInTest About to load root configuration
      [13:13:14-150][INFO] AbstractGateInTest Want to load for resource named conf/root-configuration.xml the urls [file:/C:/java/gatein/component/test/core/target/classes/conf/root-configuration.xml]
      [13:13:14-259][INFO] RootContainer Root container is built (build time 203ms)
      [13:13:14-259][INFO] ExoContainerContext Set the top container in its context
      [13:13:14-259][INFO] RootContainer Root container booted
      [13:13:14-275][INFO] AbstractGateInTest About to load portal configuration
      [13:13:14-275][INFO] AbstractGateInTest Want to load for resource named conf/portal-configuration.xml the urls [file:/C:/java/gatein/component/test/core/target/classes/conf/portal-configuration.xml]
      [13:13:14-275][INFO] AbstractGateInTest Want to load for resource named conf/test-configuration.xml the urls [file:/C:/java/gatein/component/test/core/target/test-classes/conf/test-configuration.xml]
      [13:13:14-275][INFO] AbstractGateInTest Want to load for resource named conf/jcr/jcr-configuration.xml the urls []
      [13:13:14-322][INFO] BootstrapTestCase Unit test testRequestLifeCycle completed
      [13:13:14-337][INFO] BootstrapTestCase Running unit test:testDataSource
      [13:13:14-337][INFO] InitialContextInitializer Using mandatory system property: java.naming.factory.initial = org.exoplatform.services.naming.SimpleContextFactory
      [13:13:14-353][INFO] InitialContextInitializer Reference bound: jdbcexo
      [13:13:14-540][INFO] BootstrapTestCase Using database HSQL Database Engine 1.8.0.1.8 with driver HSQL Database Engine Driver 1.8.0.1.8
      [13:13:14-540][INFO] BootstrapTestCase Unit test testDataSource completed
      [13:13:14-540][INFO] BootstrapTestCase Running unit test:testTmpDir1
      [13:13:14-540][INFO] BootstrapTestCase Unit test testTmpDir1 completed
      [13:13:14-540][INFO] BootstrapTestCase Running unit test:testTmpDir2
      [13:13:14-556][INFO] BootstrapTestCase Unit test testTmpDir2 completed
      Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.703 sec

       

      Results :

       

      Tests run: 4, Failures: 0, Errors: 0, Skipped: 0

       

      [INFO] [jar:jar {execution: default-jar}]
      [INFO] [source:jar-no-fork {execution: attach-sources}]
      [INFO] [install:install {execution: default-install}]
      [INFO] Installing C:\java\gatein\component\test\core\target\exo.portal.component.test.core-3.0.1-GA-SNAPSHOT.jar to C:\HOME\.m2\repository\org\exoplatform\portal\exo.portal.component.test.core\3.0.1-GA-SNAPSHOT\exo.portal.component.test.core-3.0.1-GA-SNAPSHOT.jar
      [INFO] Installing C:\java\gatein\component\test\core\target\exo.portal.component.test.core-3.0.1-GA-SNAPSHOT-sources.jar to C:\HOME\.m2\repository\org\exoplatform\portal\exo.portal.component.test.core\3.0.1-GA-SNAPSHOT\exo.portal.component.test.core-3.0.1-GA-SNAPSHOT-sources.jar
      [INFO] ------------------------------------------------------------------------
      [INFO] Building GateIn Portal Component Core Test JCR
      [INFO]    task-segment: [install]
      [INFO] ------------------------------------------------------------------------

        • 1. Re: Gatein-Maven-Build-Tests fail
          mwringe

          Can you please describe what steps you are taking to build GateIn?

           

          What you should be doing is running 'mvn install' from the root of the project, then changing into the packaging directory to run 'mvn install -Ppkg-[tomcat|jbossas]'

          • 2. Re: Gatein-Maven-Build-Tests fail
            leolo

            Hi Matt,

             

            I check out the svn-sources into c:\java\gatein,

             

            then I open a windows-dos-box and execute the following commands:

             

            1. cd java

             

            2. cd gatein

             

            3. set MAVEN_OPTS=-Xms256m -Xmx512m

             

            4. mvn clean

             

            5. mvn install

             

            And there the stacktrace appears I posted in my preceding posting.

             

            The error occurs before the step 'mvn install -Ppkg-[tomcat|jbossas]'

             

            Is there anyone using a windows-xp-system who doesn't run into this error? ATM I don't know, if this is a local problem or not.

             

             

            Regards,

             

            LeoLo

            • 3. Re: Gatein-Maven-Build-Tests fail
              mstruk
              I can confirm the problem on windows.

               

              It's a problem with log file path for the tests.
              The project builds fine, the tests run fine, but some test output logs are missing because the path to the log file is wrong because the backslashes get lost.

               

              The file path is determined via this line in gatein-logging.properties

              java.util.logging.FileHandler.pattern = ${basedir}/target/gateintest-%u.log

               

               

              Then there's LogConfigurator.java

               

              Which reads this config and uses regex matching to replace ${basedir} with the actual value.

               

              This is the problematic line with the bug:


              matcher.appendReplacement(builder, repl);

               

              This method treats backslashes and dollar signs in 'repl' in a special way, as per javadoc - backslashes get lost, but it doesn't affect forward slashes.

               

              Created GTNPORTAL-1183

               

              - marko