ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kent Rosenkoetter <krosenkoet...@cequint.com>
Subject RE: Error parsing ivy.xml files using Jenkins
Date Tue, 22 Feb 2011 18:41:38 GMT
The answer to your question about "source repository" is that I pulled the ivy.xml file from
subversion.  We have Jenkins (Hudson) poll SVN, check out the source, build it, run tests,
and then run our Ant target to publish to our local "artifact repository" (we use Nexus).
 This publish is done via an Ant target that generates a build number such as "427.231" and
publishes as that revision.  The revision is generated, not checked into SVN.

When we build our projects, we build them individually.  We do not have any build script that
builds all the projects at once, there is no need.  That is why we do not use ivy:buildlist.

Individual projects build just fine.  The only time I see problems is when I go into Jenkins
and create a new project, select "Build an Ivy project", and ask it to build.  For what it's
worth, I see this exception even if I only ask Jenkins to build a single project.  (See below.)

I guess my question can be summed up as, "How is it possible to get a NullPointerException
at org.apache.ivy.core.sort.CollectionOfModulesToSort.addModulesByModuleId(CollectionOfModulesToSort.java:71)?"

At revision 935
Parsing Ivy Descriptor Files Parsing error while reading the ivy file /home/thudson/.hudson/workspace/EcidCommon-Ivy-platform/ivy.xml
ERROR: Failed to parse ivy.xml files java.io.IOException: Unable to parse ivy descriptors
at hudson.ivy.IvyModuleSetBuild$RunnerImpl.parseIvyDescriptorFiles(IvyModuleSetBuild.java:530)
at hudson.ivy.IvyModuleSetBuild$RunnerImpl.doRun(IvyModuleSetBuild.java:366) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:420)
at hudson.model.Run.run(Run.java:1362) at hudson.ivy.IvyModuleSetBuild.run(IvyModuleSetBuild.java:282)
at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:145)
Caused by: java.lang.NullPointerException at org.apache.ivy.core.sort.CollectionOfModulesToSort.addToModulesByModuleId(CollectionOfModulesToSort.java:71)
at org.apache.ivy.core.sort.CollectionOfModulesToSort.<init>(CollectionOfModulesToSort.java:66)
at org.apache.ivy.core.sort.ModuleDescriptorSorter.<init>(ModuleDescriptorSorter.java:51)
at org.apache.ivy.core.sort.SortEngine.sortModuleDescriptors(SortEngine.java:99) at org.apache.ivy.Ivy.sortModuleDescriptors(Ivy.java:639)
at hudson.ivy.IvyModuleSetBuild$IvyXmlParser.call(IvyModuleSetBuild.java:803) at hudson.ivy.IvyModuleSetBuild$IvyXmlParser.call(IvyModuleSetBuild.java:742)
at hudson.remoting.UserRequest.perform(UserRequest.java:114) at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:270) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269) at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676) at java.lang.Thread.run(Thread.java:595)
Finished: FAILURE

-----Original Message-----
From: Mitch Gitman [mailto:mgitman@gmail.com]
Sent: Monday, February 21, 2011 10:13 PM
To: ivy-user@ant.apache.org
Subject: Re: Error parsing ivy.xml files using Jenkins

First a little devil's advocacy that I'm going to contradict soon enough. If
all you have is six projects, you might find it easier to manually configure
the build order using Jenkins's own triggering configuration. You're
introducing some moving parts--and demanding some extra expertise on your
end--for not much appreciable gain at this point. It's a call you can always
revisit as your project count expands.

When it comes to using Ivy to establish build order, I've found the more
necessary practice is to use the ivy:buildlist task to do a multimodule
build. So if you have six projects, you could kick off a single build and
all six projects would be built (certain targets would be run) starting with
the least dependent project. Once you know this works, you can leverage it
for using Ivy to establish your CI build order.

Having offered these caveats, it's still probably worth your while to track
down this problem, if not necessarily as a blocking issue. In this sense the
Jenkins Ivy plugin's biggest value to you is in helping you dredge up some
problems in your Ivy integration you haven't otherwise noticed yet.

As if it's not bad enough that I'm tiptoeing around answering your question,
I've got some questions of my own. You write: "This is straight out of our
source repository, which is why the revision is not specified." What do you
mean by "source repository"? In commonplace Ivy usage, that's a bit of an
oxymoron. You have your project source and then you publish the generated
artifacts to an Ivy repository.

When you publish to an Ivy repo, are you publishing with a revision or
leaving it blank and reverting to Ivy's default revision behavior? The
latter is atypical. In fact, I couldn't recall offhand what happens when you
publish without a revision. (The docs suggest a timestamp is used.) If the
revision is indeed absent, I can't vouch for whether its absence is what's
causing the problem. There's always the plugin source, and I'm sure one of
the plugin committers will chime in soon enough.

On Mon, Feb 21, 2011 at 12:52 PM, Kent Rosenkoetter <
krosenkoetter@cequint.com> wrote:

> Hello,
>
> We have Jenkins (formerly Hudson) set up for our continuous build system,
> and I would like to use the Ivy plugin for it. Right now we have half a
> dozen modules, each in their own directory with their own Ivy-managed
> dependencies. We have freestyle projects set up that build fine with our Ant
> build.xml files, but when I try to use the Jenkins Ivy plugin, I get an
> exception.
>
>
> Parsing Ivy Descriptor Files
>
> Parsing error while reading the ivy file
> /home/thudson/.hudson/workspace/Sandbox-HTTPConversion/AuthServer/ivy.xml
>
> Parsing error while reading the ivy file
> /home/thudson/.hudson/workspace/Sandbox-HTTPConversion/CASRegistrationServer/ivy.xml
>
> Parsing error while reading the ivy file
> /home/thudson/.hudson/workspace/Sandbox-HTTPConversion/CarrierInterfaceServer/ivy.xml
>
> Parsing error while reading the ivy file
> /home/thudson/.hudson/workspace/Sandbox-HTTPConversion/ContentProxy/ivy.xml
>
> Parsing error while reading the ivy file
> /home/thudson/.hudson/workspace/Sandbox-HTTPConversion/DataLayer/ivy.xml
>
> Parsing error while reading the ivy file
> /home/thudson/.hudson/workspace/Sandbox-HTTPConversion/EcidCommon/ivy.xml
>
> ERROR: Failed to parse ivy.xml files
>
> java.io.IOException<
> http://stacktrace.hudson-labs.org/search?query=java.io.IOException>:
> Unable to parse ivy descriptors
>
>        at
> hudson.ivy.IvyModuleSetBuild$RunnerImpl.parseIvyDescriptorFiles(IvyModuleSetBuild.java:530)<
> http://stacktrace.hudson-labs.org/search/?query=hudson.ivy.IvyModuleSetBuild$RunnerImpl.parseIvyDescriptorFiles&entity=method
> >
>
>        at
> hudson.ivy.IvyModuleSetBuild$RunnerImpl.doRun(IvyModuleSetBuild.java:366)<
> http://stacktrace.hudson-labs.org/search/?query=hudson.ivy.IvyModuleSetBuild$RunnerImpl.doRun&entity=method
> >
>
>        at
> hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:420)<
> http://stacktrace.hudson-labs.org/search/?query=hudson.model.AbstractBuild$AbstractRunner.run&entity=method
> >
>
>        at hudson.model.Run.run(Run.java:1362)<
> http://stacktrace.hudson-labs.org/search/?query=hudson.model.Run.run&entity=method
> >
>
>        at hudson.ivy.IvyModuleSetBuild.run(IvyModuleSetBuild.java:282)<
> http://stacktrace.hudson-labs.org/search/?query=hudson.ivy.IvyModuleSetBuild.run&entity=method
> >
>
>        at
> hudson.model.ResourceController.execute(ResourceController.java:88)<
> http://stacktrace.hudson-labs.org/search/?query=hudson.model.ResourceController.execute&entity=method
> >
>
>        at hudson.model.Executor.run(Executor.java:145)<
> http://stacktrace.hudson-labs.org/search/?query=hudson.model.Executor.run&entity=method
> >
>
> Caused by: java.lang.NullPointerException<
> http://stacktrace.hudson-labs.org/search?query=java.lang.NullPointerException
> >
>
>        at
> org.apache.ivy.core.sort.CollectionOfModulesToSort.addToModulesByModuleId(CollectionOfModulesToSort.java:71)<
> http://stacktrace.hudson-labs.org/search/?query=org.apache.ivy.core.sort.CollectionOfModulesToSort.addToModulesByModuleId&entity=method
> >
>
>        at
> org.apache.ivy.core.sort.CollectionOfModulesToSort.<init>(CollectionOfModulesToSort.java:66)<
> http://stacktrace.hudson-labs.org/search/?query=org.apache.ivy.core.sort.CollectionOfModulesToSort.%3Cinit%3E&entity=method
> >
>
>        at
> org.apache.ivy.core.sort.ModuleDescriptorSorter.<init>(ModuleDescriptorSorter.java:51)<
> http://stacktrace.hudson-labs.org/search/?query=org.apache.ivy.core.sort.ModuleDescriptorSorter.%3Cinit%3E&entity=method
> >
>
>        at
> org.apache.ivy.core.sort.SortEngine.sortModuleDescriptors(SortEngine.java:99)<
> http://stacktrace.hudson-labs.org/search/?query=org.apache.ivy.core.sort.SortEngine.sortModuleDescriptors&entity=method
> >
>
>        at org.apache.ivy.Ivy.sortModuleDescriptors(Ivy.java:639)<
> http://stacktrace.hudson-labs.org/search/?query=org.apache.ivy.Ivy.sortModuleDescriptors&entity=method
> >
>
>        at
> hudson.ivy.IvyModuleSetBuild$IvyXmlParser.call(IvyModuleSetBuild.java:803)<
> http://stacktrace.hudson-labs.org/search/?query=hudson.ivy.IvyModuleSetBuild$IvyXmlParser.call&entity=method
> >
>
>        at
> hudson.ivy.IvyModuleSetBuild$IvyXmlParser.call(IvyModuleSetBuild.java:742)<
> http://stacktrace.hudson-labs.org/search/?query=hudson.ivy.IvyModuleSetBuild$IvyXmlParser.call&entity=method
> >
>
>        at hudson.remoting.UserRequest.perform(UserRequest.java:114)<
> http://stacktrace.hudson-labs.org/search/?query=hudson.remoting.UserRequest.perform&entity=method
> >
>
>        at hudson.remoting.UserRequest.perform(UserRequest.java:48)<
> http://stacktrace.hudson-labs.org/search/?query=hudson.remoting.UserRequest.perform&entity=method
> >
>
>        at hudson.remoting.Request$2.run(Request.java:270)<
> http://stacktrace.hudson-labs.org/search/?query=hudson.remoting.Request$2.run&entity=method
> >
>
>        at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)<
> http://stacktrace.hudson-labs.org/search/?query=java.util.concurrent.Executors$RunnableAdapter.call&entity=method
> >
>
>        at
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)<
> http://stacktrace.hudson-labs.org/search/?query=java.util.concurrent.FutureTask$Sync.innerRun&entity=method
> >
>
>        at java.util.concurrent.FutureTask.run(FutureTask.java:123)<
> http://stacktrace.hudson-labs.org/search/?query=java.util.concurrent.FutureTask.run&entity=method
> >
>
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)<
> http://stacktrace.hudson-labs.org/search/?query=java.util.concurrent.ThreadPoolExecutor$Worker.runTask&entity=method
> >
>
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)<
> http://stacktrace.hudson-labs.org/search/?query=java.util.concurrent.ThreadPoolExecutor$Worker.run&entity=method
> >
>
>        at java.lang.Thread.run(Thread.java:595)<
> http://stacktrace.hudson-labs.org/search/?query=java.lang.Thread.run&entity=method
> >
>
> Finished: FAILURE
>
> Is this a bug in Jenkins/Hudson, a bug in Ivy, or simply a matter of our
> ivy.xml files not having required information in them? For reference, our
> ivy.xml files look like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ivy-module version="2.2"
>            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>            xsi:noNamespaceSchemaLocation="
> http://ant.apache.org/ivy/schemas/ivy.xsd"
>            xmlns:e="http://ant.apache.org/ivy/extra">
>      <info organisation="com.cequint" module="Foo" branch="platform"
> status="integration">
>            <ivyauthor name="Cequint" url="http://www.cequint.com/"/>
>      </info>
>      <configurations>
>            <conf name="compile" transitive="false" visibility="private"
> description="Compiles the source into class files."/>
>            <conf name="runtime" extends="compile" transitive="true"
> description="For running systems that depend on this library."/>
>            <conf name="build" extends="runtime" description="For use in an
> IDE, includes source and JavaDoc."/>
>            <conf name="test" extends="runtime" visibility="private"
> description="Build the unit tests."/>
>      </configurations>
>      <publications>
>            <artifact type="jar" ext="jar">
>                  <conf name="compile"/>
>            </artifact>
>            <artifact type="javadoc" ext="jar" e:classifier="javadoc">
>                  <conf name="build"/>
>            </artifact>
>            <artifact type="source" ext="jar" e:classifier="sources">
>                  <conf name="build"/>
>            </artifact>
>      </publications>
>      <dependencies>
>            <dependency org="log4j" name="log4j" rev="1.2.16"/>
>            <dependency org="org.apache.httpcomponents" name="httpcore"
> rev="4.1" />
>            <dependency org="org.apache.httpcomponents" name="httpclient"
> rev="4.1" />
>            <dependency org="javax.servlet" name="servlet-api" rev="2.5"/>
>            <dependency org="junit" name="junit" rev="4.8.2"
> conf="test->default"/>
>      </dependencies>
> </ivy-module>
>
> This is straight out of our source repository, which is why the revision is
> not specified. All the Ivy files look like this, only some of them specify
> internal dependencies such as:
>            <dependency name="Foo" rev="latest.integration"
> conf="build->build; *->runtime"/>
>
> I appreciate any insight that anybody can offer. It seems likely I simply
> have not configured everything properly, but so far nothing I have found
> online has given me a clue what could be the problem.
>
> -thank you,
> Kent Rosenkoetter | SW Engineering – Server
>
> Cequint Incorporated
> 1011 Western Avenue | Suite 800
> Seattle | WA | 98104
>
> p:  206.576.7258
> f:   206.299.9127
>
> www.cequint.com<http://www.cequint.com/>
>
> Confidential Information – this email and any and all attachments to it are
> Cequint's confidential information and intended solely for the use of the
> individual or entity to whom they are addressed. Any unauthorized disclosure
> or forwarding of this email or any files transmitted with it constitutes a
> breach of your confidentiality obligations to Cequint. If you have received
> this email in error, please notify the sender, delete this email from your
> system and do not disseminate, distribute or copy this email or the files
> attached to it.  Please treat all documents shared from Cequint as
> confidential.
>
>
Mime
View raw message