ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Riccardo Foschia <riccardo.fosc...@meta-level.de>
Subject Re: Fixed(?) problem in Ivy's OSGi-Support on Windows
Date Mon, 21 Oct 2013 13:16:35 GMT

Am 21.10.2013 14:35, schrieb Martin Gainty:
> 
> last time I used URI there was a specification of protocol://path so you would need to
change
> 
>  
> 
> file:/C:/java/workspace/de.metalevel.eclipse.mlbuild/ivy.xml
> 
> to
> 
> file:///C:/java/workspace/de.metalevel.eclipse.mlbuild/ivy.xml


file:/C:/java/workspace/de.metalevel.eclipse.mlbuild/ivy.xml is just the
output of Ivy in the console of the "URI" to my ivy.xml. But that's not
the problem. The problem is that Ivy internally converts the value of
the location attribute in my ivy.xml (in my case ...
location="META-INF/MANIFEST.mf" ) to an absolute path to the manifest
file and then tries to create an URI for this windows path, see the
following stack trace:

$ ant ivy:resolve
Buildfile: C:\java\workspace\de.metalevel.eclipse.mlbuild\build.xml

ivy:configure:
[ivy:configure] :: Apache Ivy 2.3.0 - 20130110142753 ::
http://ant.apache.org/ivy/ ::
[ivy:configure] :: loading settings :: file =
C:\java\workspace\ivysettings.xml

ivy:resolve:
[ivy:resolve] Problem occurred while parsing ivy file: Unsupported
repository, resources names are not uris in
file:/C:/java/workspace/de.metalevel.eclipse.mlbuild/ivy.xml

BUILD FAILED
C:\java\workspace\de.metalevel.eclipse.mlbuild\build.xml:55: syntax
errors in ivy file: java.text.ParseException: Problem occurred while
parsing ivy file: Unsupported repository, resources names are not uris
in file:/C:/java/workspace/de.metalevel.eclipse.mlbuild/ivy.xml
        at
org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser$Parser.parse(XmlModuleDescriptorParser.java:278)
        at
org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser.parseDescriptor(XmlModuleDescriptorParser.java:117)
        at
org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser.parseDescriptor(AbstractModuleDescriptorParser.java:48)
        at
org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:185)
        at org.apache.ivy.Ivy.resolve(Ivy.java:507)
        at org.apache.ivy.ant.IvyResolve.doExecute(IvyResolve.java:326)
        at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277)
        at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        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)
Caused by: java.lang.RuntimeException: Unsupported repository, resources
names are not uris
        at
org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser$Parser.startElement(XmlModuleDescriptorParser.java:363)
        at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
        at
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)
        at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.emptyElement(XMLSchemaValidator.java:739)
        at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:377)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
        at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
        at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
        at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
        at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
        at org.apache.ivy.util.XMLHelper.parse(XMLHelper.java:146)
        at org.apache.ivy.util.XMLHelper.parse(XMLHelper.java:109)
        at org.apache.ivy.util.XMLHelper.parse(XMLHelper.java:99)
        at
org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser$Parser.parse(XmlModuleDescriptorParser.java:253)
        ... 23 more
Caused by: java.lang.RuntimeException: Unsupported repository, resources
names are not uris
        at
org.apache.ivy.osgi.core.OSGiManifestParser.parseDescriptor(OSGiManifestParser.java:69)
        at
org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser$Parser.parseParentModuleOnFilesystem(XmlModuleDescriptorParser.java:631)
        at
org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser$Parser.extendsStarted(XmlModuleDescriptorParser.java:408)
        at
org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser$Parser.startElement(XmlModuleDescriptorParser.java:304)
        ... 41 more
Caused by: java.net.URISyntaxException: Illegal character in opaque part
at index 2:
C:\java\workspace\de.metalevel.eclipse.mlbuild\META-INF\MANIFEST.MF
        at java.net.URI$Parser.fail(URI.java:2809)
        at java.net.URI$Parser.checkChars(URI.java:2982)
        at java.net.URI$Parser.parse(URI.java:3019)
        at java.net.URI.<init>(URI.java:578)
        at
org.apache.ivy.osgi.core.OSGiManifestParser.parseDescriptor(OSGiManifestParser.java:67)
        ... 44 more





> 
> Date: Mon, 21 Oct 2013 12:35:07 +0200
> From: riccardo.foschia@meta-level.de
> To: dev@ant.apache.org
> Subject: Fixed(?) problem in Ivy's OSGi-Support on Windows
> 
> Hello Ivy developers,
>  
> FYI:
>  
> I'm trying to use Ivy 2.3.0 OSGi support on Windows to develop an
> Eclipse plugin and followed exactly the instructions of the sample
> "Building an Eclipse plugin" from the Ivy docs. I only changed the value
> of the module attribute in the ivy.xml from the sample (see attached
> ivy.xml).
>  
> After calling ant task ivy:resolve for this ivy.xml on a Windows machine
> with JRE 6 the resolve failed with the following output:
>  
> "Problem occurred while parsing ivy file: Unsupported repository,
> resources names are not uris in
> file:/C:/java/workspace/de.metalevel.eclipse.mlbuild/ivy.xml"
>  
> The problem was that in method parseDescriptor of class
> OSGiManifestParser an URISyntaxException occured when constructing the
> URI to set for bundleInfo (line 67) because res.getName() returned
> C:\java\workspace\de.metalevel.eclipse.mlbuild\META-INF\MANIFEST.MF .
>  
> I attached the output of svn diff for the changes I did in class
> OSGiManifestParser (SVN base revision was 1532780), see attachment
> OSGiManifestParser.diff.
>  
> I also added a "quick and dirty" test to reproduce the problem to test
> class OSGiManifestParserTest, see attachment
> OSGiManifestParserTest.diff. After I did the change this test is successful.
>  
> I also ran the whole test suite of unit tests for Ivy (ant task "test")
> and it was successful, so it seems my dirty fix did not break anything.
> This was my first contact with Ivy source code and I'm sure that there
> are more elegant ways to fix the problem, so I leave it to the experts
> to fix it right :-) Thanks to all Ivy developers for such a great tool!
>  
> Greetings,
> Riccardo
>  
> 

-- 

META-LEVEL Software AG
Saarbrücker Str. 51
66130 Saarbrücken
Deutschland
Tel: +49 - 681 / 99687-0
Fax: +49 - 681 / 99687-99
Mail: info@meta-level.de
Web: www.meta-level.de

Rechtsform: Aktiengesellschaft
Sitz: Saarbrücken
HR B Nr. 13 380 Amtsgericht Saarbrücken
USt-IdNr. DE 1 38 166667
Vorstände: Dipl.-Inform. Peter Badt und Dipl.-Inform. Peter Raber
Vorsitzender des Aufsichtsrats:  Reinhard Kuhn


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message