Announcement Announcement Module
Collapse
No announcement yet.
ConstraintViolationException appears on Linux only? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ConstraintViolationException appears on Linux only?

    Hi,

    I have a project with 7 entities (all created via the roo entity command) and the auto generated integration tests are throwing a ConstraintViolationException, *but only on our continuous integration server*
    When I run all the tests locally (using mvn install) on my windows 7 laptop, the tests all pass.
    However, when I check the tests in, and they are run again using
    mvn clean install
    all the tests of a particular class fail like this:

    Code:
     testFindClientEntries(com.jarden.lm.domain.ClientIntegrationTest): org.hibernate.exception.ConstraintViolationException: could not insert: [com.jarden.lm.domain.Client]; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not insert: [com.jarden.lm.domain.Client]
    Code:
    Violation of unique constraint SYS_CT_70: duplicate value(s) for column(s) EMAIL
    Client extends ApplicationUser which defines this unique field:

    @Column(unique=true)
    private String email;

    So I assume that the tests for ApplicationUser have already created a user with that email address in the DB.
    I can probably fix this by updating the DOD for client, but have you got any idea why this fails on linux, but passes on windows?

    I've updated the mvn installation, so that it's this on Windows:
    Apache Maven 3.0.3 (r1075438; 2011-02-28 17:31:09+0000)
    Maven home: C:\dev\apache-maven-3.0.3\bin\..
    Java version: 1.7.0_01, vendor: Oracle Corporation
    Java home: C:\Program Files\Java\jdk1.7.0_01\jre
    Default locale: en_US, platform encoding: Cp1252
    OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"

    and this on linux:

    Apache Maven 3.0.4 (r1232337; 2012-01-17 08:44:56+0000)
    Maven home: /usr/share/maven-3.0.4
    Java version: 1.7.0, vendor: Oracle Corporation
    Java home: /usr/java/jdk1.7.0/jre
    Default locale: en_US, platform encoding: UTF-8
    OS name: "linux", version: "2.6.35.4-rscloud", arch: "amd64", family: "unix"

    (POM specifies java 6 as a target)

    <java.version>1.6</java.version>

    .........
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.3.2</version>
    <configuration>
    <source>${java.version}</source>
    <target>${java.version}</target>
    <encoding>${project.build.sourceEncoding}</encoding>
    </configuration>
    </plugin>

    Cheers!
Working...
X