Announcement Announcement Module

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions ( project, this forum has been decommissioned in favour of Spring Extensions one at:

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Costin Leau
SpringSource - Spring Training, Consulting, and Support - "From the Source"
See more
See less
build.xml seems to be broken Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

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


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

    [javac] symbol  : variable Status
    [javac] location: class
    [javac]         status = Status.STATUS_MARKED_ROLLBACK;
    [javac] symbol  : class SystemException
    [javac] location: class
    [javac]             throw new SystemException("Unable to rollback transaction: " + "XA_ERR=" + e.errorCode);
    [javac] symbol  : class RollbackException
    [javac] location: class
    [javac]     public void commit() throws IllegalStateException, RollbackException, SecurityException, SystemException {
    [javac] symbol  : class NotSupportedException
    [javac] location: class
    [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:

    <dependency org="apache" name="geronimo-spec" rev="1.0.1B-rc4" conf="buildtime->default">
        <artifact name="geronimo-spec-jta" type="jar"/>
    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
      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.


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


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

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


            • #7
              I've just added a small file on the Cvs (since it's not available on JackRabbit repository). Let me know how it goes.


              • #8
                my failure message

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

                :: resolving dependencies :: [ springmodules | jcr | [email protected] ]
                        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 | ] 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
                        WARN:           ivyrep: tried artifact [ apache | jackrabbit-jca | 1.0-snapshot ]/jackrabbit-jca.jar[jar]:
                        WARN:           ibiblio-maven2: tried
                        WARN:           ibiblio-maven2: tried artifact [ apache | jackrabbit-jca | 1.0-snapshot ]/jackrabbit-jca.jar[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:           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:           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:           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:   ::::::::::::::::::::::::::::::::::::::::::::::
                        WARN:   ::          UNRESOLVED DEPENDENCIES         ::
                        WARN:   ::::::::::::::::::::::::::::::::::::::::::::::
                        WARN:   :: [ apache | jackrabbit-jca | 1.0-snapshot ]: not found
                        WARN:   ::::::::::::::::::::::::::::::::::::::::::::::
                BUILD FAILED
                <snip>/springmodules/projects/common-build/common-targets.xml:340: impossible to resolve dependencies: resolve failed - see output for details


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


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



                    • #11
                      Nevermind. I checked out a clean copy of SpringModules and everything worked fine. I must have deleted something somewhere and CVS didn't re-download it when I ran CVS update... or something. Bottom line is, it seems happy for the moment. Thanks!


                      • #12
                        Mark, I just checkout out the project on a linux machine and everything works fine. Please check your project and synchronize all your folders - I think you are not synchronized properly.

                        For the record I've done a:
                        #cvs -d server:[email protected]:/cvs checkout springmodules/projects
                        # ant


                        • #13
                          Okay - I'm glad things turned out alright

                          P.S. I have seen your reply only after posting my reply. The build took a while.


                          • #14
                            Building the docs...

                            I am having trouble building the Docs though (not the Javadocs, that target worked fine). It seems the "ant doc-html" target still expects to be invoked from the springmodules root. If its run from a brand new jcr directory (as I just tried), it complains about not having the required libraries. If you put those in, it complains about not having the images. If you copy the images directory (from springmodules/docs/reference/images), it tells you that "html" isn't a valid directory (referring to the output directory). And this is where I give up .

                            This isn't a big deal for me since I have the docs I built from last week, but it might be important to others so I thought I'd mention it.

                            Thanks for your help.


                            • #15
                              Thanks for reminding me. I'll work on it once I have some free time. I've raised an issue on jira: