Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: build.xml seems to be broken

  1. #1
    Join Date
    Jul 2005
    Location
    Santa Cruz, CA
    Posts
    41

    Default build.xml seems to be broken

    For whatever reason, I can't seem to get the JCR package to build. When I run "ant build", I only get classes for the aop, commons, jsr94, and util packages.

    The "build" target looks in src/java for classes to build, but only the packages I mentioned above actually have source files in that directory tree... everything else is in projects/*/src/java.

    I don't know enough about ant to fix this, and it could be that I've caught the repository in transition from one build mechanism to another, but this is still really annoying.

    --- warning, rant ahead ---
    I have this pet peeve with Spring Modules: their choice to use Ant instead of Maven. Partly this is because early on in my own project, I decided Maven was the easier way to go so I have spent very little time learning the ins and outs of Ant. But I think it would have been good to choose Maven since the SpringFramework itself uses Maven. I also think that for projects with many sub-projects that might come and go, Maven will serve better than ant. I think the "site" target Maven provides is one of its best features and would have been very handy for exploring the code and javadocs of the projects within SpringModules.
    --- rant is over ---

    Mark

  2. #2
    Join Date
    Jul 2005
    Location
    Santa Cruz, CA
    Posts
    41

    Default not broken, but not right either

    So I just found the older thread (from last month) where Costin explained that there is, indeed, a transition going on in the build process. My only suggestion is that someone should put a BUILD_README.txt in the main directory that explicitly points users to the projects/build-common directory for details on the process. Given that the transition seems to be taking a while, it would be good for it to be documented in the CVS that most people will be using right now. Since other build files at that level work (at least builddocs.xml does), there's nothing to indicate that people should be going elsewhere to build the actual JAR files.

    In my case, I did try to build jcr from its own directory, and I got compilation errors because of a missing dependency (more on this in a sec). I took the missing dependencies to mean my environment wasn't configured for invoking ant directly in the projects/jcr/ directory, and that the environment must be auto configured by the build.xml in the root springmodules directory.

    Now, about the errors I'm getting in my build process:

    Code:
    [javac] symbol  : variable Status
    [javac] location: class org.springmodules.jcr.jackrabbit.support.JackRabbitUserTransaction
    [javac]         status = Status.STATUS_MARKED_ROLLBACK;
    
    [javac] symbol  : class SystemException
    [javac] location: class org.springmodules.jcr.jackrabbit.support.JackRabbitUserTransaction
    [javac]             throw new SystemException("Unable to rollback transaction: " + "XA_ERR=" + e.errorCode);
    
    [javac] symbol  : class RollbackException
    [javac] location: class org.springmodules.jcr.jackrabbit.support.JackRabbitUserTransaction
    [javac]     public void commit() throws IllegalStateException, RollbackException, SecurityException, SystemException {
    
    [javac] symbol  : class NotSupportedException
    [javac] location: class org.springmodules.jcr.jackrabbit.support.JackRabbitUserTransaction
    [javac]     public void begin() throws NotSupportedException, SystemException {
    
    [javac] symbol  : class UserTransaction
    [javac] location: package javax.transaction
    [javac] import javax.transaction.UserTransaction;
    So it seems the javax.transaction package isn't to be found, except that its included in Geronimo - a registered JCR dependency. But, its only registered at test time, not at build time. Since whatever app server the code is deployed to should have the J2EE packages, I ended up fixing it by creating a second dependency in the projects/jcr/ivy.xml file:

    Code:
    <dependency org="apache" name="geronimo-spec" rev="1.0.1B-rc4" conf="buildtime->default">
        <artifact name="geronimo-spec-jta" type="jar"/>
    </dependency>
    I put it right next to the existing geronimo dependency and everything built and tested just fine. I'll submit a report and patch to JIRA.

  3. #3
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Hei Mark.

    Thanks for the feedback; I have added a README_BUILD.TXT file, I've modified the ivy file and I've also deleted the old build files to avoid confusion. Indeed the situation can be cleaner and since the transition hasn't been completed yet, there are still some quirks that need to be worked on as you can see.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  4. #4
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    But I think it would have been good to choose Maven since the SpringFramework itself uses Maven.
    Spring uses both maven and ant. For the future spring common build is choosed since the ivy/ant combination provides a very flexible and fast way to solve transitive dependencies.

    P.S. I don't want to start an ant vs maven war/post - I'm just presenting the situation.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  5. #5
    Join Date
    Jul 2005
    Location
    Santa Cruz, CA
    Posts
    41

    Default

    Thanks for updating those things Costin. I just did a CVS update and tried building JCR after doing "ant clean", and it failed because of this dependency:

    Code:
    <dependency org="apache" name="jackrabbit-jca" rev="1.0-snapshot"/>
    It looks like you moved from jackrabbit-1.0-SNAPSHOT to jackrabbit-0.9 also. Could this be related to that change?

  6. #6
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    I flushed my ivy cache, did an ant clean and jr 0.9 was retrieved and the build went fine. Post the stacktrace - I'm not sure what's the cause of your problem.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  7. #7
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    I've just added a small file on the Cvs (since it's not available on JackRabbit repository). Let me know how it goes.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  8. #8
    Join Date
    Jul 2005
    Location
    Santa Cruz, CA
    Posts
    41

    Default my failure message

    Hey Costin, I ran CVS update and it didn't seem to help. Here's the messages I'm getting.

    Code:
    resolve.main:
    :: resolving dependencies :: [ springmodules | jcr | working@Terra.local ]
            confs: [global, buildtime, test]
            found [ apache | commons-logging | 1.0.4 ] in libs
            found [ apache | log4j | 1.2.12 ] in libs
            found [ springframework | springframework | 1.2.6 ] in libs
            found [ jsr170 | jsr170 | 1.0 ] in libs
            found [ apache | geronimo-spec | 1.0.1B-rc4 ] in libs
            found [ sun | javax.servlet | 2.3 ] in libs
            found [ apache | jackrabbit | 0.9 ] in libs
    [resolve.conf] Feb 26, 2006 12:32:47 PM org.apache.commons.httpclient.HttpMethodDirector isAuthenticationNeeded
    [resolve.conf] INFO: Authentication requested but doAuthentication is disabled
            found [ apache | xerces | 2.6.2 ] in libs
            found [ jeceira | jeceira | 0.1.3 ] in libs
            found [ apache | commons-lang | 2.1 ] in libs
            found [ apache | commons-collections | 3.1 ] in libs
            found [ concurrent | concurrent | 1.3.4 ] in libs
            found [ apache | lucene | 1.4.3 ] in libs
            found [ aparzev | doka | 0.1 ] in libs
            found [ aparzev | commons | 0.2 ] in libs
            found [ safehaus | jug | 2.0.0 ] in libs
            found [ hsqldb | hsqldb | 1.8.0.1 ] in libs
            found [ clover | clover | 1.3.9 ] in libs
            found [ easymock | easymock | 1.1 ] in libs
            found [ cglib | cglib | 2.1_3 ] in libs
            found [ junit | junit | 3.8.1 ] in libs
    :: resolution report ::
            ---------------------------------------------------------------------
            |                  |            modules            ||   artifacts   |
            |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
            ---------------------------------------------------------------------
            |      global      |   10  |   0   |   0   |   0   ||   11  |   0   |
            |     buildtime    |   0   |   0   |   0   |   0   ||   0   |   0   |
            |       test       |   13  |   0   |   0   |   0   ||   14  |   0   |
            ---------------------------------------------------------------------
    
    :: problems summary ::
            WARN:   module not found: [ apache | jackrabbit-jca | 1.0-snapshot ]
            WARN:           integration-repo: tried <snip>/springmodules/projects/common-build/../integration-repo/artifacts/apache/jackrabbit-jca/ivy-1.0-snapshot.xml
            WARN:           integration-repo: tried artifact [ apache | jackrabbit-jca | 1.0-snapshot ]/jackrabbit-jca.jar[jar]:
            WARN:                   <snip>/springmodules/projects/common-build/../integration-repo/artifacts/apache/jackrabbit-jca/jars/jackrabbit-jca-1.0-snapshot.jar
            WARN:           filesystem-repo: tried <snip>/springmodules/projects/common-build/../repository/apache/jackrabbit-jca/ivy-1.0-snapshot.xml
            WARN:           filesystem-repo: tried artifact [ apache | jackrabbit-jca | 1.0-snapshot ]/jackrabbit-jca.jar[jar]:
            WARN:                   <snip>/springmodules/projects/common-build/../repository/apache/jackrabbit-jca/jars/jackrabbit-jca-1.0-snapshot.jar
            WARN:           ivyrep: tried http://ivyrep.jayasoft.org/apache/jackrabbit-jca/ivy-1.0-snapshot.xml
            WARN:           ivyrep: tried artifact [ apache | jackrabbit-jca | 1.0-snapshot ]/jackrabbit-jca.jar[jar]:
            WARN:                   http://www.ibiblio.org/maven/jackrabbit-jca/jars/jackrabbit-jca-1.0-snapshot.jar
            WARN:           ibiblio-maven2: tried http://www.ibiblio.org/maven2/apache/jackrabbit-jca/1.0-snapshot/ivy-1.0-snapshot.xml
            WARN:           ibiblio-maven2: tried artifact [ apache | jackrabbit-jca | 1.0-snapshot ]/jackrabbit-jca.jar[jar]:
            WARN:                   http://www.ibiblio.org/maven2/apache/jackrabbit-jca/1.0-snapshot/jackrabbit-jca-1.0-snapshot.jar
            WARN:           day: tried no ivy pattern => no attempt to find ivy file for [ apache | jackrabbit-jca | 1.0-snapshot ]
            WARN:           day: tried artifact [ apache | jackrabbit-jca | 1.0-snapshot ]/jackrabbit-jca.jar[jar]:
            WARN:                   http://www.day.com/maven/jackrabbit-jca/jars/jackrabbit-jca-1.0-snapshot.jar
            WARN:           apache-incubator: tried no ivy pattern => no attempt to find ivy file for [ apache | jackrabbit-jca | 1.0-snapshot ]
            WARN:           apache-incubator: tried artifact [ apache | jackrabbit-jca | 1.0-snapshot ]/jackrabbit-jca.jar[jar]:
            WARN:                   http://cvs.apache.org/repository/org.apache.jackrabbit/jars/jackrabbit-jca-1.0-snapshot-incubating.jar
            WARN:           jeceira: tried no ivy pattern => no attempt to find ivy file for [ apache | jackrabbit-jca | 1.0-snapshot ]
            WARN:           jeceira: tried artifact [ apache | jackrabbit-jca | 1.0-snapshot ]/jackrabbit-jca.jar[jar]:
            WARN:                   http://www.jeceira.com/confluence/download/attachments/3200/jackrabbit-jca-1.0-snapshot.jar?version=1
            WARN:           jug: tried no ivy pattern => no attempt to find ivy file for [ apache | jackrabbit-jca | 1.0-snapshot ]
            WARN:           jug: tried artifact [ apache | jackrabbit-jca | 1.0-snapshot ]/jackrabbit-jca.jar[jar]:
            WARN:                   http://jug.safehaus.org/curr/jackrabbit-jca-1.0-snapshot.jar
            WARN:   ::::::::::::::::::::::::::::::::::::::::::::::
            WARN:   ::          UNRESOLVED DEPENDENCIES         ::
            WARN:   ::::::::::::::::::::::::::::::::::::::::::::::
            WARN:   :: [ apache | jackrabbit-jca | 1.0-snapshot ]: not found
            WARN:   ::::::::::::::::::::::::::::::::::::::::::::::
    
            --- USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS ---
    
    BUILD FAILED
    <snip>/springmodules/projects/common-build/common-targets.xml:340: impossible to resolve dependencies: resolve failed - see output for details

  9. #9
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    I've committed a fixed ivy.xml. I think the problem was caused by using lower cases in the ivy files and having upper cases in the jar name. I didn't get the problem on my computer since I'm using windows.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  10. #10
    Join Date
    Jul 2005
    Location
    Santa Cruz, CA
    Posts
    41

    Default

    Hi Costin,

    I just tried it again and got the same results (but with all caps SNAPSHOT ).

    What's the deal with the resolve.conf errors about Authentication being needed? Could that be the problem?

    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •