You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Vitoria <vi...@gmail.com> on 2007/12/19 09:54:42 UTC

ivy:retrieve double call exception

I'm using Ivy 2.0.0-beta1 and I faced such problem: 
I need to run few targets from ant e.g. ant createdb runtests. These two
targets depend on ivy-retrieve target. But when it tries to load settings
file second time exception occurs:

-----------------------------
[ivy:retrieve] :: Ivy 2.0.0-beta1 - 20071206070608 ::
http://ant.apache.org/ivy/ ::
:: loading settings :: file = E:\testprj\res\ivysettings.xml

BUILD FAILED
E:\testprj\build.xml:73: java.lang.ClassCastException:
org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor
-----------------------------

So, I can't call ivy:retrieve task several times. 

Any ideas how to solve this problem?
Thank you.
-- 
View this message in context: http://www.nabble.com/ivy%3Aretrieve-double-call-exception-tp14412973p14412973.html
Sent from the ivy-user mailing list archive at Nabble.com.


RE: retrieve double call exception

Posted by Vitoria <vi...@gmail.com>.
I've put taskdef directly into <project> outside any target and it works.
Thanks a lot! 
-- 
View this message in context: http://www.nabble.com/ivy%3Aretrieve-double-call-exception-tp14412973p14416409.html
Sent from the ivy-user mailing list archive at Nabble.com.


RE: retrieve double call exception

Posted by Gilles Scokart <gs...@gmail.com>.
You should avoid to load twice ivy.  If you don't have multiproject (and subant call), you can simply put your taskdef
outside a task.  You could also make the loading conditional (set a property when you load it the first time and only
reload it if the property is not set).  You can maybe also use a loader (one of the attribute of the taskdef task).

Gilles

> -----Original Message-----
> From: Vitoria [mailto:vitavolkova@gmail.com]
> Sent: mercredi 19 décembre 2007 11:12
> To: ivy-user@incubator.apache.org
> Subject: RE: retrieve double call exception
> 
> 
> This is not a multi project.
> Yes, I load the ivy tasks twice.
> This happens even in the simplest case when you execute "ant ivy-retrieve
> ivy-retrieve"
> 
> I can't raise a jira issue because I don't have access.
> 
> I have attached logs of ant -v and ant -d execution.
> http://www.nabble.com/file/p14414252/ant_v.log ant_v.log
> http://www.nabble.com/file/p14414252/ant_d.log ant_d.log
> 
> --
> View this message in context: http://www.nabble.com/ivy%3Aretrieve-double-call-exception-
> tp14412973p14414252.html
> Sent from the ivy-user mailing list archive at Nabble.com.


RE: retrieve double call exception

Posted by Vitoria <vi...@gmail.com>.
This is not a multi project.
Yes, I load the ivy tasks twice.
This happens even in the simplest case when you execute "ant ivy-retrieve
ivy-retrieve"

I can't raise a jira issue because I don't have access.

I have attached logs of ant -v and ant -d execution.
http://www.nabble.com/file/p14414252/ant_v.log ant_v.log 
http://www.nabble.com/file/p14414252/ant_d.log ant_d.log 

-- 
View this message in context: http://www.nabble.com/ivy%3Aretrieve-double-call-exception-tp14412973p14414252.html
Sent from the ivy-user mailing list archive at Nabble.com.


RE: retrieve double call exception

Posted by Gilles Scokart <gs...@gmail.com>.
Sounds like a bug.
Did you have multi project?  Did you load twice the ivy tasks?

In any case, could you raise a jira issue, and put the result of the ant -v or ant -d execution.



Gilles

> -----Original Message-----
> From: Vitoria [mailto:vitavolkova@gmail.com]
> Sent: mercredi 19 décembre 2007 9:55
> To: ivy-user@incubator.apache.org
> Subject: ivy:retrieve double call exception
> 
> 
> I'm using Ivy 2.0.0-beta1 and I faced such problem:
> I need to run few targets from ant e.g. ant createdb runtests. These two
> targets depend on ivy-retrieve target. But when it tries to load settings
> file second time exception occurs:
> 
> -----------------------------
> [ivy:retrieve] :: Ivy 2.0.0-beta1 - 20071206070608 ::
> http://ant.apache.org/ivy/ ::
> :: loading settings :: file = E:\testprj\res\ivysettings.xml
> 
> BUILD FAILED
> E:\testprj\build.xml:73: java.lang.ClassCastException:
> org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor
> -----------------------------
> 
> So, I can't call ivy:retrieve task several times.
> 
> Any ideas how to solve this problem?
> Thank you.
> --
> View this message in context: http://www.nabble.com/ivy%3Aretrieve-double-call-exception-
> tp14412973p14412973.html
> Sent from the ivy-user mailing list archive at Nabble.com.