You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by atcach <at...@gmail.com> on 2011/05/26 16:20:16 UTC

T5 Locale problem

Hi,
I'm struggling reading a Pentaho Report.
The report is mainly a jar file with xml's inside.
If I compile it from outside tapestry it works ok.
But in my T5 project, I'm getting:
org.pentaho.reporting.libraries.resourceloader.ResourceCreationException:
Unable to parse the document:
ResourceKey{schema=org.pentaho.reporting.libraries.docbundle.bundleloader.ZipResourceBundleLoader,
identifier=mimetype,
factoryParameters={org.pentaho.reporting.libraries.resourceloader.FactoryParameterKey{name=repository}=org.pentaho.reporting.libraries.repository.zipreader.ZipReadRepository@2ef36617,
org.pentaho.reporting.libraries.resourceloader.FactoryParameterKey{name=repository-loader}=org.pentaho.reporting.libraries.docbundle.bundleloader.ZipResourceBundleLoader@6db38815},
parent=ResourceKey{schema=org.pentaho.reporting.libraries.resourceloader.loader.URLResourceLoader,
identifier=file:/home/ale/ale/laburo/NetBeansProjects/servir/reportes/reporte2.prpt,
factoryParameters={}, parent=null}}
        at
org.pentaho.reporting.libraries.xmlns.parser.AbstractXmlResourceFactory.create(AbstractXmlResourceFactory.java:249)
        at
org.pentaho.reporting.libraries.resourceloader.DefaultResourceManagerBackend.create(DefaultResourceManagerBackend.java:272)
        at
org.pentaho.reporting.libraries.resourceloader.ResourceManager.create(ResourceManager.java:408)
        at
org.pentaho.reporting.libraries.resourceloader.ResourceManager.create(ResourceManager.java:367)
        at
org.pentaho.reporting.libraries.resourceloader.ResourceManager.createDirectly(ResourceManager.java:203)
        at pentaho.PentahoTest.getReportDefinition(PentahoTest.java:89)
        at pentaho.PentahoTest$2.produceMydata(PentahoTest.java:181)
        at pentaho.PentahoTest$2.produce(PentahoTest.java:175)
        at pentaho.PentahoTest$2.produce(PentahoTest.java:165)
        at
com.gc.iotools.stream.is.InputStreamFromOutputStream$DataProducer.call(InputStreamFromOutputStream.java:109)
        at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231)
        at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
        at
org.pentaho.reporting.libraries.xmlns.parser.AbstractXmlResourceFactory.create(AbstractXmlResourceFactory.java:236)
        ... 14 more

I think it's because de locales, I'm using UTF-8 and saw that the reports
are utf-8 ok.
My guess of a locale problem is that Caused by:
org.xml.sax.SAXParseException: Content is not allowed in prolog. is usually
because the "<?xml " part is in a wrong locale.
I have set UTF-8 in the POM.xml in:

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
       
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
...

Any ideas ?
Regards 

--
View this message in context: http://tapestry.1045711.n5.nabble.com/T5-Locale-problem-tp4428763p4428763.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5 Locale problem

Posted by atcach <at...@gmail.com>.
Yes, If I run it from outside Tapestry/Jetty/etc, it runs ok.
I mean, It comes with some sample .java to show how to load a report. I used
them to load my reports and it worked ok. 
The order of the pentaho's method calls is the same in my app.
Regards !

--
View this message in context: http://tapestry.1045711.n5.nabble.com/T5-Locale-problem-tp4428763p4439485.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5 Locale problem

Posted by Josh Canfield <jo...@gmail.com>.
Are you sure tapestry/jetty has anything to do with it? Can you write
a straight java (no webapp/jetty) unit test that loads the file?

On Thu, May 26, 2011 at 1:32 PM, atcach <at...@gmail.com> wrote:
> Furthermore, if I open the .xml from an hex editor, I only see the < sign,
> not the BOM for any encoding.
> 00000000:  3c 3f 78 6d 6c 20 76 65  72 73 69 6f 6e 3d 22 31  <?xml
> version="1
>  00000010:  2e 30 22 20 65 6e 63 6f  64 69 6e 67 3d 22 55 54  .0"
> encoding="UT
>  00000020:  46 2d 38 22 3f 3e 0a 3c  63 6f 6e 74 65 6e 74 20
> F-8"?>.<content
>
> Which is quite right, isn't it ?
> As:
>  UTF-8 BOM: ef bb bf
>  UTF-16BE BOM: fe ff
>  UTF-16LE BOM: ff fe
>  UTF-32BE BOM: 00 00 fe ff
>  UTF-32LE BOM: ff fe 00 00
>
> Regards
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/T5-Locale-problem-tp4428763p4429973.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5 Locale problem

Posted by atcach <at...@gmail.com>.
Furthermore, if I open the .xml from an hex editor, I only see the < sign,
not the BOM for any encoding.
00000000:  3c 3f 78 6d 6c 20 76 65  72 73 69 6f 6e 3d 22 31  <?xml
version="1
 00000010:  2e 30 22 20 65 6e 63 6f  64 69 6e 67 3d 22 55 54  .0"
encoding="UT
 00000020:  46 2d 38 22 3f 3e 0a 3c  63 6f 6e 74 65 6e 74 20 
F-8"?>.<content 

Which is quite right, isn't it ?
As:
 UTF-8 BOM: ef bb bf 
  UTF-16BE BOM: fe ff 
  UTF-16LE BOM: ff fe 
  UTF-32BE BOM: 00 00 fe ff 
  UTF-32LE BOM: ff fe 00 00

Regards

--
View this message in context: http://tapestry.1045711.n5.nabble.com/T5-Locale-problem-tp4428763p4429973.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5 Locale problem

Posted by atcach <at...@gmail.com>.
The problem is that it is unpacked (a pentaho report is a zip file with many
xml's inside)  by the system (running in jetty in linux with utf-8), because
if I unzip it and get the encoding of the xml's I see them ok. But I think
is reencoding them in the middle or something like that. Could it be that
the configuration of the tapestry/jetty is wrong ?
How could I configure it ?
Regards

--
View this message in context: http://tapestry.1045711.n5.nabble.com/T5-Locale-problem-tp4428763p4429959.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5 Locale problem

Posted by Josh Canfield <jo...@gmail.com>.
> The prolog is everything that comes before the <?xml part.
Actually, that's wrong. The prolog is everything before the root
element in the document... either way it's probably a BOM that's
causing the problem.

On Thu, May 26, 2011 at 9:48 AM, Josh Canfield <jo...@gmail.com> wrote:
>> My guess of a locale problem is that Caused by:
>> org.xml.sax.SAXParseException: Content is not allowed in prolog. is usually
>> because the "<?xml " part is in a wrong locale.
>
> The prolog is everything that comes before the <?xml part. If you look
> at the xml and you can't see anything before the <?xml then it's
> probably a BOM being inserted by whatever is creating the file, and no
> BOM support in whatever is reading it.
>
> Josh
>
> On Thu, May 26, 2011 at 7:20 AM, atcach <at...@gmail.com> wrote:
>> Hi,
>> I'm struggling reading a Pentaho Report.
>> The report is mainly a jar file with xml's inside.
>> If I compile it from outside tapestry it works ok.
>> But in my T5 project, I'm getting:
>> org.pentaho.reporting.libraries.resourceloader.ResourceCreationException:
>> Unable to parse the document:
>> ResourceKey{schema=org.pentaho.reporting.libraries.docbundle.bundleloader.ZipResourceBundleLoader,
>> identifier=mimetype,
>> factoryParameters={org.pentaho.reporting.libraries.resourceloader.FactoryParameterKey{name=repository}=org.pentaho.reporting.libraries.repository.zipreader.ZipReadRepository@2ef36617,
>> org.pentaho.reporting.libraries.resourceloader.FactoryParameterKey{name=repository-loader}=org.pentaho.reporting.libraries.docbundle.bundleloader.ZipResourceBundleLoader@6db38815},
>> parent=ResourceKey{schema=org.pentaho.reporting.libraries.resourceloader.loader.URLResourceLoader,
>> identifier=file:/home/ale/ale/laburo/NetBeansProjects/servir/reportes/reporte2.prpt,
>> factoryParameters={}, parent=null}}
>>        at
>> org.pentaho.reporting.libraries.xmlns.parser.AbstractXmlResourceFactory.create(AbstractXmlResourceFactory.java:249)
>>        at
>> org.pentaho.reporting.libraries.resourceloader.DefaultResourceManagerBackend.create(DefaultResourceManagerBackend.java:272)
>>        at
>> org.pentaho.reporting.libraries.resourceloader.ResourceManager.create(ResourceManager.java:408)
>>        at
>> org.pentaho.reporting.libraries.resourceloader.ResourceManager.create(ResourceManager.java:367)
>>        at
>> org.pentaho.reporting.libraries.resourceloader.ResourceManager.createDirectly(ResourceManager.java:203)
>>        at pentaho.PentahoTest.getReportDefinition(PentahoTest.java:89)
>>        at pentaho.PentahoTest$2.produceMydata(PentahoTest.java:181)
>>        at pentaho.PentahoTest$2.produce(PentahoTest.java:175)
>>        at pentaho.PentahoTest$2.produce(PentahoTest.java:165)
>>        at
>> com.gc.iotools.stream.is.InputStreamFromOutputStream$DataProducer.call(InputStreamFromOutputStream.java:109)
>>        at
>> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>>        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>>        at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>        at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>        at java.lang.Thread.run(Thread.java:662)
>> Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
>>        at
>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231)
>>        at
>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
>>        at
>> org.pentaho.reporting.libraries.xmlns.parser.AbstractXmlResourceFactory.create(AbstractXmlResourceFactory.java:236)
>>        ... 14 more
>>
>> I think it's because de locales, I'm using UTF-8 and saw that the reports
>> are utf-8 ok.
>> My guess of a locale problem is that Caused by:
>> org.xml.sax.SAXParseException: Content is not allowed in prolog. is usually
>> because the "<?xml " part is in a wrong locale.
>> I have set UTF-8 in the POM.xml in:
>>
>>    <properties>
>>        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>>
>> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
>> ...
>>
>> Any ideas ?
>> Regards
>>
>> --
>> View this message in context: http://tapestry.1045711.n5.nabble.com/T5-Locale-problem-tp4428763p4428763.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5 Locale problem

Posted by Josh Canfield <jo...@gmail.com>.
> My guess of a locale problem is that Caused by:
> org.xml.sax.SAXParseException: Content is not allowed in prolog. is usually
> because the "<?xml " part is in a wrong locale.

The prolog is everything that comes before the <?xml part. If you look
at the xml and you can't see anything before the <?xml then it's
probably a BOM being inserted by whatever is creating the file, and no
BOM support in whatever is reading it.

Josh

On Thu, May 26, 2011 at 7:20 AM, atcach <at...@gmail.com> wrote:
> Hi,
> I'm struggling reading a Pentaho Report.
> The report is mainly a jar file with xml's inside.
> If I compile it from outside tapestry it works ok.
> But in my T5 project, I'm getting:
> org.pentaho.reporting.libraries.resourceloader.ResourceCreationException:
> Unable to parse the document:
> ResourceKey{schema=org.pentaho.reporting.libraries.docbundle.bundleloader.ZipResourceBundleLoader,
> identifier=mimetype,
> factoryParameters={org.pentaho.reporting.libraries.resourceloader.FactoryParameterKey{name=repository}=org.pentaho.reporting.libraries.repository.zipreader.ZipReadRepository@2ef36617,
> org.pentaho.reporting.libraries.resourceloader.FactoryParameterKey{name=repository-loader}=org.pentaho.reporting.libraries.docbundle.bundleloader.ZipResourceBundleLoader@6db38815},
> parent=ResourceKey{schema=org.pentaho.reporting.libraries.resourceloader.loader.URLResourceLoader,
> identifier=file:/home/ale/ale/laburo/NetBeansProjects/servir/reportes/reporte2.prpt,
> factoryParameters={}, parent=null}}
>        at
> org.pentaho.reporting.libraries.xmlns.parser.AbstractXmlResourceFactory.create(AbstractXmlResourceFactory.java:249)
>        at
> org.pentaho.reporting.libraries.resourceloader.DefaultResourceManagerBackend.create(DefaultResourceManagerBackend.java:272)
>        at
> org.pentaho.reporting.libraries.resourceloader.ResourceManager.create(ResourceManager.java:408)
>        at
> org.pentaho.reporting.libraries.resourceloader.ResourceManager.create(ResourceManager.java:367)
>        at
> org.pentaho.reporting.libraries.resourceloader.ResourceManager.createDirectly(ResourceManager.java:203)
>        at pentaho.PentahoTest.getReportDefinition(PentahoTest.java:89)
>        at pentaho.PentahoTest$2.produceMydata(PentahoTest.java:181)
>        at pentaho.PentahoTest$2.produce(PentahoTest.java:175)
>        at pentaho.PentahoTest$2.produce(PentahoTest.java:165)
>        at
> com.gc.iotools.stream.is.InputStreamFromOutputStream$DataProducer.call(InputStreamFromOutputStream.java:109)
>        at
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>        at java.lang.Thread.run(Thread.java:662)
> Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
>        at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231)
>        at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
>        at
> org.pentaho.reporting.libraries.xmlns.parser.AbstractXmlResourceFactory.create(AbstractXmlResourceFactory.java:236)
>        ... 14 more
>
> I think it's because de locales, I'm using UTF-8 and saw that the reports
> are utf-8 ok.
> My guess of a locale problem is that Caused by:
> org.xml.sax.SAXParseException: Content is not allowed in prolog. is usually
> because the "<?xml " part is in a wrong locale.
> I have set UTF-8 in the POM.xml in:
>
>    <properties>
>        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>
> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
> ...
>
> Any ideas ?
> Regards
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/T5-Locale-problem-tp4428763p4428763.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org