We had exactly the same issue in our office today. After much messing around
with wget and telnet, the problem turned out to be our transparent squid
proxy caching gzipped versions of the resources and returning them even
though there was no Accept-Encoding: gzip header in the HTTP request.
Apparently this is how squid is supposed to work - there should have been
another header in the response from the server in the original request that
caused the resource to be cached (which did want it gzipped) to make squid
re-obtain the resource if the gzip header isn't in the request (I wonder if
I can make that sentence any less clear). 

I worked around this by patching ivy to add a pragma: no-cache header to its
HTTP requests so they are retrieved from the maven repo rather than the
cache (our transparent proxy cache also gets updated with the non-gzipped
version as well).

Mark.


Tomek Kaczanowski-3 wrote:
> 
> Hi all,
> 
> I found a "solution". Inspired by this forum discussion:
> http://www.coderanch.com/t/434462/Ant-Maven-Other-Build-Tools/Ant-Ivy-Add-rd-party
> I added my Nexus repo to repositories section of build.gradle (and
> also credentials for this repo) before "mavenCentral". And guess what
> ? - it worked.
> 
> This whole stuff makes no sense to me, but I'm glad I can build Gradle now
> :)
> 
> I'm afraid this is not the end of "Content is not allowed in prolog"
> story, as I also got this error in other builds, where our Nexus is
> used.
> 
> --
> Tomek
> 
> 2009/12/4 Tomek Kaczanowski <[email protected]>:
>> Hi Shaun,
>>
>> thanks, but unfortunately removing of ./gradle/cache/org.apache etc.
>> doesn't help. :( It downloads the garbled files once again. I even
>> tried to remove the whole .gradle dir - without any effect. Well, not
>> exactly, the effect is shown below :)
>> :::: WARNINGS
>>                ::::::::::::::::::::::::::::::::::::::::::::::
>>
>>                ::          UNRESOLVED DEPENDENCIES         ::
>>
>>                ::::::::::::::::::::::::::::::::::::::::::::::
>>
>>                :: commons-cli#commons-cli;1.2:
>> java.text.ParseException: Content is not allowed in prolog.
>>
>>                :: commons-codec#commons-codec;1.2:
>> java.text.ParseException: Content is not allowed in prolog.
>>
>>                :: commons-io#commons-io;1.4:
>> java.text.ParseException: Content is not allowed in prolog.
>>
>>                :: commons-collections#commons-collections;3.2.1:
>> java.text.ParseException: Content is not allowed in prolog.
>>
>>                :: org.apache.maven#maven-ant-tasks;2.0.10:
>> java.text.ParseException: Content is not allowed in prolog.
>>
>>                ::::::::::::::::::::::::::::::::::::::::::::::
>>
>>
>> :::: ERRORS
>>        Content is not allowed in prolog.
>>
>>        Content is not allowed in prolog.
>>
>>        Content is not allowed in prolog.
>>
>>        Content is not allowed in prolog.
>>
>>        Content is not allowed in prolog.
>>
>>
>> FAILURE: Build failed with an exception.
>>
>> * What went wrong:
>> Could not resolve all dependencies for configuration 'compile':
>>    - unresolved dependency: commons-cli#commons-cli;1.2:
>> java.text.ParseException: Content is not allowed in prolog.
>>    - unresolved dependency: commons-codec#commons-codec;1.2:
>> java.text.ParseException: Content is not allowed in prolog.
>>    - unresolved dependency: commons-io#commons-io;1.4:
>> java.text.ParseException: Content is not allowed in prolog.
>>    - unresolved dependency:
>> commons-collections#commons-collections;3.2.1:
>> java.text.ParseException: Content is not allowed in prolog.
>>    - unresolved dependency: org.apache.maven#maven-ant-tasks;2.0.10:
>> java.text.ParseException: Content is not allowed in prolog.
>>
>>
>>
>> I have googled a lot about Ivy bugs related to this - some hints
>> there, but no solution. My inner voice tells me, that there is
>> something wrong with our Nexus server, ...or maybe not. Uh, I'm stuck.
>>
>> --
>> Tomek
>>
>> 2009/12/4 Shaun Mangelsdorf <[email protected]>:
>>> Hi Tomek,
>>>
>>> I've just tried this locally and my build succeeded. Checking my
>>> ~/.gradle/cache/org.apache/apache yields a somewhat different result
>>> though..
>>>
>>> -rw-r--r-- 1 shaun shaun  3289 2009-04-21 12:46 ivy-6.xml
>>> -rw-r--r-- 1 shaun shaun 12796 2009-04-21 12:46 ivy-6.xml.original
>>>
>>> Perhaps if you removed that folder and let ivy resolve and download it
>>> again, it would correct itself. For reference, the sha1sums are:
>>>
>>> 2a64dbc8ca20030f846eb51626f9f49d8eabd78f
>>> /home/shaun/.gradle/cache/org.apache/apache/ivy-6.xml
>>> 70e78921afc16d914e65611d18ab1b2d6cb20e57
>>> /home/shaun/.gradle/cache/org.apache/apache/ivy-6.xml.original
>>>
>>> It's likely that the content in there is garbled.. perhaps an error
>>> message? It could be a similar problem with the earlier email you sent
>>> - removing the org.mortbay.jetty directory from the ivy cache might
>>> let it self-correct. Hopefully that helps.
>>>
>>>
>>> Cheers,
>>> Shaun
>>>
>>> 2009/12/4 Tomek Kaczanowski <[email protected]>:
>>>> Hi again,
>>>>
>>>> there is something fishy about this. Today I did "git pull" and tried
>>>> to build gradle again. This time I got the same error but with another
>>>> artifact:
>>>>
>>>> ./gradlew clean assemble
>>>> :codeQuality:clean
>>>> :core:clean
>>>> :docs:clean
>>>> :jetty:clean
>>>> :launcher:clean
>>>> :openApi:clean
>>>> :plugins:clean
>>>> :ui:clean
>>>> :wrapper:clean
>>>> :clean
>>>> downloading (9 KB)
>>>> http://repo1.maven.org/maven2/org/apache/maven/maven-ant-tasks/2.0.10/maven-ant-tasks-2.0.10.pom
>>>> ..
>>>> downloading (21 KB)
>>>> http://repo1.maven.org/maven2/org/apache/maven/maven-parent/12/maven-parent-12.pom
>>>> ..............
>>>> downloading (unknown size)
>>>> http://repo1.maven.org/maven2/org/apache/apache/6/apache-6.pom
>>>> ..
>>>> [Fatal Error] ivy-6.xml.original:2:1: Content is not allowed in
>>>> prolog.
>>>> org.xml.sax.SAXParseException: Content is not allowed in prolog.
>>>>        at
>>>> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239)
>>>>        at
>>>> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
>>>>        at
>>>> javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:153)
>>>>        at org.apache.ivy.util.XMLHelper.parseToDom(XMLHelper.java:198)
>>>>        at
>>>> org.apache.ivy.plugins.parser.m2.PomReader.<init>(PomReader.java:94)
>>>>        at
>>>> org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser.parseDescriptor(PomModuleDescriptorParser.java:115)
>>>>        at
>>>> org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser.parseDescriptor(PomModuleDescriptorParser.java:105)
>>>>        at
>>>> org.apache.ivy.core.cache.DefaultRepositoryCacheManager$MyModuleDescriptorProvider.provideModule(DefaultRepositoryCacheManager.java:638)
>>>>        at
>>>> org.apache.ivy.core.cache.ModuleDescriptorMemoryCache.getStale(ModuleDescriptorMemoryCache.java:68)
>>>>        at
>>>> org.apache.ivy.core.cache.DefaultRepositoryCacheManager.getStaledMd(DefaultRepositoryCacheManager.java:655)
>>>>        at
>>>> org.apache.ivy.core.cache.DefaultRepositoryCacheManager.cacheModuleDescriptor(DefaultRepositoryCacheManager.java:942)
>>>>        at
>>>> org.apache.ivy.plugins.resolver.BasicResolver.parse(BasicResolver.java:542)
>>>>        at
>>>> org.apache.ivy.plugins.resolver.BasicResolver.getDependency(BasicResolver.java:263)
>>>>        at
>>>> org.apache.ivy.plugins.resolver.IBiblioResolver.getDependency(IBiblioResolver.java:501)
>>>>        at
>>>> org.apache.ivy.plugins.resolver.ChainResolver.getDependency(ChainResolver.java:130)
>>>>        at
>>>> org.apache.ivy.plugins.resolver.ChainResolver.getDependency(ChainResolver.java:130)
>>>>        at
>>>> org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser.parseOtherPom(PomModuleDescriptorParser.java:316)
>>>>        at
>>>> org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser.parseDescriptor(PomModuleDescriptorParser.java:134)
>>>>        at
>>>> org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser.parseDescriptor(PomModuleDescriptorParser.java:105)
>>>>        at
>>>> org.apache.ivy.core.cache.DefaultRepositoryCacheManager$MyModuleDescriptorProvider.provideModule(DefaultRepositoryCacheManager.java:638)
>>>>        at
>>>> org.apache.ivy.core.cache.ModuleDescriptorMemoryCache.getStale(ModuleDescriptorMemoryCache.java:68)
>>>>        at
>>>> org.apache.ivy.core.cache.DefaultRepositoryCacheManager.getStaledMd(DefaultRepositoryCacheManager.java:655)
>>>>        at
>>>> org.apache.ivy.core.cache.DefaultRepositoryCacheManager.cacheModuleDescriptor(DefaultRepositoryCacheManager.java:942)
>>>>        at
>>>> org.apache.ivy.plugins.resolver.BasicResolver.parse(BasicResolver.java:542)
>>>>        at
>>>> org.apache.ivy.plugins.resolver.BasicResolver.getDependency(BasicResolver.java:263)
>>>>        at
>>>> org.apache.ivy.plugins.resolver.IBiblioResolver.getDependency(IBiblioResolver.java:501)
>>>>        at
>>>> org.apache.ivy.plugins.resolver.ChainResolver.getDependency(ChainResolver.java:130)
>>>>        at
>>>> org.apache.ivy.plugins.resolver.ChainResolver.getDependency(ChainResolver.java:130)
>>>>        at
>>>> org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser.parseOtherPom(PomModuleDescriptorParser.java:316)
>>>>        at
>>>> org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser.parseDescriptor(PomModuleDescriptorParser.java:134)
>>>>        at
>>>> org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser.parseDescriptor(PomModuleDescriptorParser.java:105)
>>>>        at
>>>> org.apache.ivy.core.cache.DefaultRepositoryCacheManager$MyModuleDescriptorProvider.provideModule(DefaultRepositoryCacheManager.java:638)
>>>>        at
>>>> org.apache.ivy.core.cache.ModuleDescriptorMemoryCache.getStale(ModuleDescriptorMemoryCache.java:68)
>>>>        at
>>>> org.apache.ivy.core.cache.DefaultRepositoryCacheManager.getStaledMd(DefaultRepositoryCacheManager.java:655)
>>>>        at
>>>> org.apache.ivy.core.cache.DefaultRepositoryCacheManager.cacheModuleDescriptor(DefaultRepositoryCacheManager.java:942)
>>>>        at
>>>> org.apache.ivy.plugins.resolver.BasicResolver.parse(BasicResolver.java:542)
>>>>        at
>>>> org.apache.ivy.plugins.resolver.BasicResolver.getDependency(BasicResolver.java:263)
>>>>        at
>>>> org.apache.ivy.plugins.resolver.IBiblioResolver.getDependency(IBiblioResolver.java:501)
>>>>        at
>>>> org.apache.ivy.plugins.resolver.ChainResolver.getDependency(ChainResolver.java:130)
>>>>        at
>>>> org.apache.ivy.plugins.resolver.ChainResolver.getDependency(ChainResolver.java:130)
>>>>        at
>>>> org.apache.ivy.core.resolve.IvyNode.loadData(IvyNode.java:170)
>>>>        at
>>>> org.apache.ivy.core.resolve.VisitNode.loadData(VisitNode.java:274)
>>>>        at
>>>> org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:671)
>>>>        at
>>>> org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:757)
>>>>        at
>>>> org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:679)
>>>>        at
>>>> org.apache.ivy.core.resolve.ResolveEngine.getDependencies(ResolveEngine.java:551)
>>>>        at
>>>> org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:235)
>>>>        at org.apache.ivy.Ivy.resolve(Ivy.java:512)
>>>>        at
>>>> org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyResolver.resolve(DefaultIvyDependencyResolver.java:52)
>>>>        at
>>>> org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver.resolve(SelfResolvingDependencyResolver.java:41)
>>>>        at
>>>> org.gradle.api.internal.artifacts.ivyservice.DefaultIvyService.resolve(DefaultIvyService.java:136)
>>>>        at
>>>> org.gradle.api.internal.artifacts.ivyservice.ShortcircuitEmptyConfigsIvyService.resolve(ShortcircuitEmptyConfigsIvyService.java:68)
>>>>        at
>>>> org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingIvyService.resolve(ErrorHandlingIvyService.java:52)
>>>>        at
>>>> org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:183)
>>>>        at
>>>> org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:509)
>>>>        at
>>>> org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getFiles(DefaultConfiguration.java:154)
>>>>        at
>>>> org.gradle.api.internal.file.CompositeFileCollection.getFiles(CompositeFileCollection.java:37)
>>>>        at
>>>> org.gradle.api.internal.file.AbstractFileCollection.iterator(AbstractFileCollection.java:61)
>>>>        at
>>>> org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository$TaskInfo.<init>(DefaultTaskArtifactStateRepository.java:228)
>>>>        at
>>>> org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository.getThisExecution(DefaultTaskArtifactStateRepository.java:91)
>>>>        at
>>>> org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository.getStateFor(DefaultTaskArtifactStateRepository.java:48)
>>>>        at
>>>> org.gradle.api.internal.project.ExecutionShortCircuitTaskExecuter.execute(ExecutionShortCircuitTaskExecuter.java:55)
>>>>        at
>>>> org.gradle.api.internal.tasks.SkipTaskExecuter.doExecute(SkipTaskExecuter.java:63)
>>>>        at
>>>> org.gradle.api.internal.tasks.SkipTaskExecuter.execute(SkipTaskExecuter.java:36)
>>>>        at
>>>> org.gradle.api.internal.AbstractTask.execute(AbstractTask.java:204)
>>>>        at
>>>> org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:167)
>>>>        at
>>>> org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:160)
>>>>        at
>>>> org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:78)
>>>>        at
>>>> org.gradle.execution.TaskNameResolvingBuildExecuter.execute(TaskNameResolvingBuildExecuter.java:174)
>>>>        at
>>>> org.gradle.execution.DelegatingBuildExecuter.execute(DelegatingBuildExecuter.java:54)
>>>>        at
>>>> org.gradle.GradleLauncher.doBuildStages(GradleLauncher.java:193)
>>>>        at org.gradle.GradleLauncher.doBuild(GradleLauncher.java:128)
>>>>        at org.gradle.GradleLauncher.run(GradleLauncher.java:98)
>>>>        at org.gradle.launcher.Main.execute(Main.java:93)
>>>>        at org.gradle.launcher.Main.main(Main.java:42)
>>>>        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.gradle.launcher.GradleMain.main(GradleMain.java:50)
>>>>        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.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:38)
>>>>        at org.gradle.wrapper.Wrapper.execute(Wrapper.java:58)
>>>>        at
>>>> org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:39)
>>>> :: problems summary ::
>>>> :::: WARNINGS
>>>>                ::::::::::::::::::::::::::::::::::::::::::::::
>>>>
>>>>                ::          UNRESOLVED DEPENDENCIES         ::
>>>>
>>>>                ::::::::::::::::::::::::::::::::::::::::::::::
>>>>
>>>>                :: org.apache.maven#maven-ant-tasks;2.0.10:
>>>> java.text.ParseException: Content is not allowed in prolog.
>>>>
>>>>                ::::::::::::::::::::::::::::::::::::::::::::::
>>>>
>>>>
>>>> :::: ERRORS
>>>>        Content is not allowed in prolog.
>>>>
>>>>
>>>> FAILURE: Build failed with an exception.
>>>>
>>>> * What went wrong:
>>>> Could not resolve all dependencies for configuration 'compile':
>>>>    - unresolved dependency: org.apache.maven#maven-ant-tasks;2.0.10:
>>>> java.text.ParseException: Content is not allowed in prolog.
>>>>
>>>> * Try:
>>>> Run with -s or -d option to get more details. Run with -S option to
>>>> get the full (very verbose) stacktrace.
>>>>
>>>> BUILD FAILED
>>>>
>>>>
>>>>
>>>> I took a look in .gradle/cache and this is what I found:
>>>>
>>>> ll ~/.gradle/cache/org.apache/apache
>>>> total 52
>>>> -rw-r--r-- 1 tomek tomek 2725 2006-07-18 11:48 ivy-3.xml
>>>> -rw-r--r-- 1 tomek tomek 3430 2006-07-18 11:48 ivy-3.xml.original
>>>> -rw-r--r-- 1 tomek tomek 2841 2007-03-05 23:05 ivy-4.xml
>>>> -rw-r--r-- 1 tomek tomek 4495 2007-03-05 23:05 ivy-4.xml.original
>>>> -rw-r--r-- 1 tomek tomek 3093 2009-02-21 02:09 ivy-5.xml
>>>> -rw-r--r-- 1 tomek tomek 4097 2009-02-21 02:09 ivy-5.xml.original
>>>> -rw-r--r-- 1 tomek tomek 2799 2009-04-21 04:46 ivy-6.xml.original
>>>> -rw-r--r-- 1 tomek tomek  476 2009-09-16 14:54 ivydata-3.properties
>>>> -rw-r--r-- 1 tomek tomek  476 2009-09-16 14:54 ivydata-4.properties
>>>> -rw-r--r-- 1 tomek tomek  570 2009-09-16 14:54 ivydata-5.properties
>>>> -rw-r--r-- 1 tomek tomek  258 2009-12-04 10:48 ivydata-6.properties
>>>>
>>>>
>>>> ll ~/.gradle/cache/org.apache.maven/maven-ant-tasks
>>>> total 40
>>>> -rw-r--r-- 1 tomek tomek 9325 2009-05-19 17:56 ivy-2.0.10.xml.original
>>>> -rw-r--r-- 1 tomek tomek 5094 2008-04-17 23:30 ivy-2.0.9.xml
>>>> -rw-r--r-- 1 tomek tomek 7433 2008-04-17 23:30 ivy-2.0.9.xml.original
>>>> -rw-r--r-- 1 tomek tomek  332 2009-12-04 10:48
>>>> ivydata-2.0.10.properties
>>>> -rw-r--r-- 1 tomek tomek  786 2009-12-03 11:21 ivydata-2.0.9.properties
>>>> drwxr-xr-x 2 tomek tomek 4096 2009-09-08 09:51 jars
>>>>
>>>> I know nothing about Ivy, but maybe it tells you something ? Please,
>>>> help.
>>>>
>>>> The same bugs also happens to my colleague.
>>>>
>>>>
>>>> gradle -v
>>>>
>>>> ------------------------------------------------------------
>>>> Gradle 0.8
>>>> ------------------------------------------------------------
>>>>
>>>> Gradle buildtime: Monday, September 28, 2009 2:01:59 PM CEST
>>>> Groovy: 1.6.4
>>>> Ant: Apache Ant version 1.7.0 compiled on December 13 2006
>>>> Ivy: 2.1.0-rc2
>>>> Java: 1.6.0_16
>>>> JVM: 14.2-b01
>>>> JVM Vendor: Sun Microsystems Inc.
>>>> OS Name: Linux
>>>>
>>>> --
>>>> Tomek
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe from this list, please visit:
>>>>
>>>>    http://xircles.codehaus.org/manage_email
>>>>
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>    http://xircles.codehaus.org/manage_email
>>>
>>>
>>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/gradle-from-sources---org.mortbay.jetty-jetty-6.1.21%3A--java.text.ParseException-tp26588512p27699172.html
Sent from the gradle-dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to