[ 
https://issues.apache.org/jira/browse/IVY-1499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15739323#comment-15739323
 ] 

ASF GitHub Bot commented on IVY-1499:
-------------------------------------

GitHub user jaikiran opened a pull request:

    https://github.com/apache/ant-ivy/pull/11

    IVY-1499 Prevent potential NPE during retrieve

    The commit here adds a null check to prevent a potential NPE that is 
reported in JIRA https://issues.apache.org/jira/browse/IVY-1499

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jaikiran/ant-ivy ivy-1499

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/ant-ivy/pull/11.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #11
    
----
commit c4dcddee47e560e8c768b5987fd96caffe85c673
Author: Jaikiran Pai <jaikiran....@gmail.com>
Date:   2016-12-11T08:07:32Z

    IVY-1499 Prevent potential NPE during retrieve

----


> NullPointerException while Retrieve
> -----------------------------------
>
>                 Key: IVY-1499
>                 URL: https://issues.apache.org/jira/browse/IVY-1499
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.4.0-RC1
>         Environment: Hard to say:
> Worked on my System: Win 7 64, Java 6u45, Eclipse Luna and Kepler with 
> current Plugins (Ant, Ant Ivy, IvyDE, Ant Ivy Tasker)
> Occured on a very similar system and on my Test System with Lubuntu 14.04 64, 
> OpenJDK 1.7.0_65
>            Reporter: Marc Meier
>            Priority: Minor
>              Labels: NullPointerException
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I encountered a NullPointerException while retrieving an ivy file. 
> Unfortunately I'm not able to recreate it properly. 
> {panel:title=Stacktrace}
> BUILD FAILED
> /var/lib/jenkins/jobs/antivy/workspace/dev/all.xml:12: The following error 
> occurred while executing this line:
> /var/lib/jenkins/jobs/antivy/workspace/dev/common_module_build.xml:74: 
> impossible to ivy retrieve: java.lang.RuntimeException: problem during 
> retrieve of org.example#org.example.converter: java.lang.NullPointerException
>       at 
> org.apache.ivy.core.retrieve.RetrieveEngine.retrieve(RetrieveEngine.java:249)
>       at org.apache.ivy.Ivy.retrieve(Ivy.java:561)
>       at org.apache.ivy.ant.IvyRetrieve.doExecute(IvyRetrieve.java:98)
>       at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:271)
>       at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
>       at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:622)
>       at 
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
>       at org.apache.tools.ant.Task.perform(Task.java:348)
>       at org.apache.tools.ant.Target.execute(Target.java:435)
>       at org.apache.tools.ant.Target.performTasks(Target.java:456)
>       at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
>       at 
> org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
>       at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
>       at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440)
>       at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:306)
>       at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:221)
>       at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:622)
>       at 
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
>       at org.apache.tools.ant.Task.perform(Task.java:348)
>       at org.apache.tools.ant.Target.execute(Target.java:435)
>       at org.apache.tools.ant.Target.performTasks(Target.java:456)
>       at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
>       at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
>       at 
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
>       at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
>       at org.apache.tools.ant.Main.runBuild(Main.java:851)
>       at org.apache.tools.ant.Main.startAnt(Main.java:235)
>       at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
>       at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
> Caused by: java.lang.NullPointerException
>       at 
> org.apache.ivy.core.IvyPatternHelper.substituteTokens(IvyPatternHelper.java:239)
>       at 
> org.apache.ivy.core.IvyPatternHelper.substitute(IvyPatternHelper.java:171)
>       at 
> org.apache.ivy.core.retrieve.RetrieveEngine.determineArtifactsToCopy(RetrieveEngine.java:355)
>       at 
> org.apache.ivy.core.retrieve.RetrieveEngine.retrieve(RetrieveEngine.java:118)
>       ... 34 more
> {panel}
> The converter (which is the project I try to build) depends on the core, 
> which is also one of our projects. Since we only need the core for its 
> dependencies, only the ivy.xml is published in my local repository and needed 
> by the converter. 
> I tried to figure out, what the problem is. It seems, ivy is unable to 
> determine the destPattern (RetrieveEngine.java:355) while retrieving the 
> core. While debugging, I noticed the type of the artifact is ivy, while 
> destIvyPattern is null. This leads to destPattern being null, too.
> This could be a misconfiguration of any (ivy)pattern in the local repository, 
> I'm sorry, I can not give you more information, but my configuration files 
> are already changed, so I can not recreate the bug anymore. *I would suggest 
> to check the destPattern variable for null, so at least a proper Exception 
> (instead of NullPointerException) can be thrown*. 
> I have no clue, why the problem occured on my linux system and the 
> windows/eclipse configuration off my colleague, while it worked properly on 
> mine.
> For debugging I checked out the current master branch 
> (target.ivy.version=2.5.0), so the problem still exists there.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to