ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frédéric RIVIERE (JIRA) <j...@apache.org>
Subject [jira] [Created] (IVY-1452) NullPointerException when accessing charset to invalid URL
Date Wed, 04 Dec 2013 11:40:38 GMT
Frédéric RIVIERE created IVY-1452:
-------------------------------------

             Summary: NullPointerException when accessing charset to invalid URL
                 Key: IVY-1452
                 URL: https://issues.apache.org/jira/browse/IVY-1452
             Project: Ivy
          Issue Type: Bug
    Affects Versions: 2.4.0
         Environment: windows 7
            Reporter: Frédéric RIVIERE
            Priority: Blocker


Trace is:
java.lang.NullPointerException: charsetName
  at java.io.InputStreamReader.<init>(Unknown Source)
  at org.apache.ivy.util.url.ApacheURLLister.retrieveListing(ApacheURLLister.java:113)
  at org.apache.ivy.util.url.ApacheURLLister.listAll(ApacheURLLister.java:57)
  at org.apache.ivy.plugins.repository.url.URLRepository.list(URLRepository.java:100)
  at org.apache.ivy.plugins.resolver.util.ResolverHelper.listAll(ResolverHelper.java:105)
  at org.apache.ivy.plugins.resolver.util.ResolverHelper.listTokenValues(ResolverHelper.java:57)
  at org.apache.ivy.plugins.resolver.util.ResolverHelper.findAll(ResolverHelper.java:139)
  at org.apache.ivy.plugins.resolver.RepositoryResolver.listResources(RepositoryResolver.java:185)
  at org.apache.ivy.plugins.resolver.RepositoryResolver.findDynamicResourceUsingPattern(RepositoryResolver.java:149)
  at org.apache.ivy.plugins.resolver.RepositoryResolver.findResourceUsingPattern(RepositoryResolver.java:132)
  at org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver.findResourceUsingPatterns(AbstractPatternsBasedResolver.java:96)
  at org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver.findArtifactRef(AbstractPatternsBasedResolver.java:75)
  at org.apache.ivy.plugins.resolver.BasicResolver.getArtifactRef(BasicResolver.java:1034)
  at org.apache.ivy.plugins.resolver.BasicResolver.findFirstArtifactRef(BasicResolver.java:971)
  at org.apache.ivy.plugins.resolver.BasicResolver.getDependency(BasicResolver.java:243)
  at org.apache.ivy.plugins.resolver.ChainResolver.getDependency(ChainResolver.java:104)
  at org.apache.ivy.plugins.resolver.ChainResolver.getDependency(ChainResolver.java:104)
  at org.apache.ivy.core.resolve.IvyNode.loadData(IvyNode.java:169)
  at org.apache.ivy.core.resolve.VisitNode.loadData(VisitNode.java:292)
  at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:717)
  at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:802)
  at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:725)
  at org.apache.ivy.core.resolve.ResolveEngine.getDependencies(ResolveEngine.java:597)
  at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:234)
  at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:195)
  at org.apache.ivy.Ivy.resolve(Ivy.java:507)
  at org.apache.ivy.ant.IvyResolve.doExecute(IvyResolve.java:337)
  at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:273)
  at org.apache.ivy.ant.IvyPostResolveTask.ensureResolved(IvyPostResolveTask.java:241)
  at org.apache.ivy.ant.IvyPostResolveTask.prepareAndCheck(IvyPostResolveTask.java:188)
  at org.apache.ivy.ant.IvyRetrieve.doExecute(IvyRetrieve.java:89)
  at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:273)
  at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
  at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  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:392)
  at org.apache.tools.ant.Target.performTasks(Target.java:413)
  at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
  at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
  at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
  at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
  at org.apache.tools.ant.Main.runBuild(Main.java:811)
  at org.apache.tools.ant.Main.startAnt(Main.java:217)
  at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
  at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

After investigations, a check is missing in in class org.apache.ivy.util.url.ApacheURLLister,
in method 
List retrieveListing(URL,boolean,boolean) :

[...]
String charset = urlHandler.getURLInfo(url).getBodyCharset();
[...]
According to spec of urlHandler.getURLInfo(url), it may return URLHandler.UNAVAILABLE.

I have replace the above line by the following and it works fine:
[...]
URLInfo urlInfo = urlHandler.getURLInfo(url);
if(urlInfo == URLHandler.UNAVAILABLE)
      	return urlList; // not found => return empty list
// here, urlInfo is valid
String charset = urlInfo.getBodyCharset();
[...]

This is blocking for us. Is there a chance to integrate it soon ?
Otherwise, I will need to build my own patched jar.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message