ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maarten Coene <maarten_co...@yahoo.com>
Subject Re: Ivy 2.2.0 NullPointerException.
Date Mon, 08 Nov 2010 10:30:36 GMT
Seems like a bug in Java: 
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6520665
Could you try with a more recent version of Java: 5.0u14(b01) or higher?

Maarten




----- Original Message ----
From: groovenarula <gnarula1@la-z-boy.com>
To: ivy-user@ant.apache.org
Sent: Sat, November 6, 2010 5:27:06 PM
Subject: Ivy 2.2.0 NullPointerException.


I have a very simple ivy.xml :

<ivy-module version="2.0">
        <info organisation="myorg" module="daos" />
        <dependencies>
                <dependency org="org.antlr" name="stringtemplate" rev="3.0"
/>
                <dependency org="org.apache.ant" name="ant" rev="1.7.0" />
                <dependency org="commons-lang" name="commons-lang" rev="2.3"
/>
                <dependency org="junit" name="junit" rev="4.1" />
                <dependency org="log4j" name="log4j" rev="1.2.14" />
                <dependency org="net.sf.opencsv" name="opencsv" rev="1.7" />
                <dependency org="net.sf.flexjson" name="flexjson" rev="2.0"
/>
                <dependency org="poi" name="poi" rev="3.0-FINAL" />
                <dependency org="javax.mail" name="mail" rev="1.4" />
        </dependencies>
</ivy-module>

that I'm trying to have ivy 'retrieve' using this ant build.xml :

<?xml version="1.0"?>
<project name="library" xmlns:ivy="antlib:org.apache.ivy.ant" >

        <!-- Ivy properties -->
        <property name="ivy.install.version" value="2.2.0" />
        <property name="ant.dir" value="ant" />
        <property name="ant.jar.dir" value="${ant.dir}/lib" />
        <property name="ivy.jar.file" value="${ant.jar.dir}/ivy.jar" />

        <target name="init" description="Set timestamp property">
                <tstamp/>
        </target>

        <target name="download-ivy" unless="offline">
                <mkdir dir="${ant.jar.dir}"/>
                <!-- download Ivy from web site so that it can be used even
without any special installation -->
                <get
src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"

                        dest="${ivy.jar.file}" usetimestamp="true"/>
        </target>

        <target name="init-ivy" depends="download-ivy,init">
                <!-- try to load ivy here from ivy home, in case the user
has not already dropped
                     it into ant's lib dir (note that the latter copy will
always take precedence).
                     We will not fail as long as local lib dir exists (it
may be empty) and
                     ivy is in at least one of ant's lib dir or the local
lib dir. -->
            <path id="misc.lib.path">
                <fileset dir="${ant.jar.dir}" includes="*.jar"/>
            </path>
                <taskdef resource="org/apache/ivy/ant/antlib.xml"
                 uri="antlib:org.apache.ivy.ant"
classpathref="misc.lib.path"/>
        </target>

        <target name="resolve" depends="init-ivy" description="Resolve
dependencies with Ivy">
                <ivy:retrieve file="ivy.xml"/>
        </target>
</project>


The retrieve works fine when I'm not going through a proxy. 

However, when I have to go through a proxy server, I get the following
errors :

[ivy:retrieve] :: Ivy 2.2.0 - 20100923230623 :: http://ant.apache.org/ivy/
::
[ivy:retrieve] :: loading settings :: url =
jar:file:/root/testIvy/ant/lib/ivy.jar!/org/apache/ivy/core/settings/ivysettings.xml

[ivy:retrieve] :: resolving dependencies ::
myorg#daos;working@retv6000.na.lzb.hq
[ivy:retrieve]  confs: [default]
[ivy:retrieve] :: resolution report :: resolve 190ms :: artifacts dl 0ms
      
---------------------------------------------------------------------
        |                  |            modules            ||   artifacts  
|
        |       conf       | number| search|dwnlded|evicted||
number|dwnlded|
      
---------------------------------------------------------------------
        |      default     |   9   |   0   |   0   |   0   ||   0   |   0  
|
      
---------------------------------------------------------------------

[ivy:retrieve] :: problems summary ::
[ivy:retrieve] :::: WARNINGS
[ivy:retrieve]          ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]          ::          UNRESOLVED DEPENDENCIES         ::
[ivy:retrieve]          ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]          :: org.antlr#stringtemplate;3.0:
java.lang.NullPointerException
[ivy:retrieve]          :: org.apache.ant#ant;1.7.0:
java.lang.NullPointerException
[ivy:retrieve]          :: commons-lang#commons-lang;2.3:
java.lang.NullPointerException
[ivy:retrieve]          :: junit#junit;4.1: java.lang.NullPointerException
[ivy:retrieve]          :: log4j#log4j;1.2.14:
java.lang.NullPointerException
[ivy:retrieve]          :: net.sf.opencsv#opencsv;1.7:
java.lang.NullPointerException
[ivy:retrieve]          :: net.sf.flexjson#flexjson;2.0:
java.lang.NullPointerException
[ivy:retrieve]          :: poi#poi;3.0-FINAL: java.lang.NullPointerException
[ivy:retrieve]          :: javax.mail#mail;1.4:
java.lang.NullPointerException
[ivy:retrieve]          ::::::::::::::::::::::::::::::::::::::::::::::

My environment (when behind the proxy) is :

[root@server testIvy]# java -version
java version "1.5.0_10"

[root@server testIvy]# ant  -version
Apache Ant version 1.6.2 compiled on November 12 2004

I have defined  a proxy for ant using 'ANT_OPTS :

'export ANT_OPTS='-Dhttp.proxyHost=192.168.1.1 -Dhttp.proxyPort=8080' 

and ant is using it to install ivy.jar :

download-ivy:
      [get] Getting:
http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.2.0/ivy-2.2.0.jar
      [get] To: /root/testIvy/ant/lib/ivy.jar
      [get] Not modified - so not downloaded

When I run ant in 'verbose' mode, I get this output :

[ivy:retrieve] resolving dependencies for configuration 'default'
[ivy:retrieve] == resolving dependencies for
myorg#daos;working@retv6000.na.lzb.hq [default]
[ivy:retrieve] == resolving dependencies
myorg#daos;working@retv6000.na.lzb.hq->org.antlr#stringtemplate;3.0
[default->*]
[ivy:retrieve] default: Checking cache for: dependency:
org.antlr#stringtemplate;3.0 {*=[*]}
[ivy:retrieve] don't use cache for org.antlr#stringtemplate;3.0:
checkModified=true
[ivy:retrieve]          tried
/root/.ivy2/local/org.antlr/stringtemplate/3.0/ivys/ivy.xml
[ivy:retrieve]          tried
/root/.ivy2/local/org.antlr/stringtemplate/3.0/jars/stringtemplate.jar
[ivy:retrieve]  local: no ivy file nor artifact found for
org.antlr#stringtemplate;3.0
[ivy:retrieve] main: Checking cache for: dependency:
org.antlr#stringtemplate;3.0 {*=[*]}
[ivy:retrieve]          tried
/root/.ivy2/shared/org.antlr/stringtemplate/3.0/ivys/ivy.xml
[ivy:retrieve]          tried
/root/.ivy2/shared/org.antlr/stringtemplate/3.0/jars/stringtemplate.jar
[ivy:retrieve]  shared: no ivy file nor artifact found for
org.antlr#stringtemplate;3.0
[ivy:retrieve]          tried
http://repo1.maven.org/maven2/org/antlr/stringtemplate/3.0/stringtemplate-3.0.pom

[ivy:retrieve] problem occurred while resolving dependency:
org.antlr#stringtemplate;3.0 {*=[*]} with public:
java.lang.RuntimeException: java.lang.NullPointerException
[ivy:retrieve]  at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:908)

[ivy:retrieve]  at
sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:1937)

[ivy:retrieve]  at
java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:376)
[ivy:retrieve]  at
org.apache.ivy.util.url.BasicURLHandler.checkStatusCode(BasicURLHandler.java:97)
[ivy:retrieve]  at
org.apache.ivy.util.url.BasicURLHandler.getURLInfo(BasicURLHandler.java:73)
[ivy:retrieve]  at
org.apache.ivy.util.url.BasicURLHandler.getURLInfo(BasicURLHandler.java:54)
[ivy:retrieve]  at
org.apache.ivy.util.url.URLHandlerDispatcher.getURLInfo(URLHandlerDispatcher.java:66)

[ivy:retrieve]  at
org.apache.ivy.plugins.repository.url.URLResource.init(URLResource.java:65)
[ivy:retrieve]  at
org.apache.ivy.plugins.repository.url.URLResource.exists(URLResource.java:81)
[ivy:retrieve]  at
org.apache.ivy.plugins.resolver.RepositoryResolver.findResourceUsingPattern(RepositoryResolver.java:97)

[ivy:retrieve]  at
org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver.findResourceUsingPatterns(AbstractPatternsBasedResolver.java:93)

[ivy:retrieve]  at
org.apache.ivy.plugins.resolver.IBiblioResolver.findIvyFileRef(IBiblioResolver.java:102)

[ivy:retrieve]  at
org.apache.ivy.plugins.resolver.BasicResolver.getDependency(BasicResolver.java:223)

[ivy:retrieve]  at
org.apache.ivy.plugins.resolver.IBiblioResolver.getDependency(IBiblioResolver.java:503)

[ivy:retrieve]  at
org.apache.ivy.plugins.resolver.ChainResolver.getDependency(ChainResolver.java:104)

[ivy:retrieve]  at
org.apache.ivy.plugins.resolver.ChainResolver.getDependency(ChainResolver.java:104)

[ivy:retrieve]  at
org.apache.ivy.core.resolve.IvyNode.loadData(IvyNode.java:169)

(Only partial output posted here for brevity) ! 

Can someone please tell me what I'm doing wrong here or how to fix this ?

Thanks
Groove
-- 
View this message in context: 
http://old.nabble.com/Ivy-2.2.0-NullPointerException.-tp30149448p30149448.html
Sent from the ivy-user mailing list archive at Nabble.com.


      

Mime
View raw message