org.xml.sax.SAXParseException: Content is not allowed in prolog / Custom ResourceImpl / case sensiti [message #463055] |
Sun, 02 August 2009 15:33 |
Jeff S. Messages: 29 Registered: July 2009 |
Junior Member |
|
|
So I'm posting this question mostly to document my issue (in case anyone
runs into the same problem, and is searching the newsgroup). My
question is about file extension case-sensitivity, and may be better
suited for a more "general" newsgroup (not EMF specific). Explanation to
follow.
Yesterday I wasted a few hours tracking down an issue because of an
oversight (and I was looking in all the wrong places). I've been
working on an RCP app (based on EMF) that registers it's own Resource
Type by implementing doLoad() / doSave() in xxxxResourceImpl and by
using the extension point org.eclipse.emf.ecore.extension_parser to
register the extension .esx with my app.
I had been doing some initial testing w/ some of my .esx files, and
things seemed to be going okay until I loaded one, and kept getting the
following error "org.xml.sax.SAXParseException: Content is not allowed
in prolog.":
(Part of my stack trace):
org.xml.sax.SAXParseException: Content is not allowed in prolog.
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper. createSAXParseException(Unknown
Source)
...
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1494)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1282)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at
com.example.plugins.model.esx.presentation.EsxEditor.createM odel(EsxEditor.java:848)
at
com.example.plugins.model.esx.presentation.EsxEditor.createP ages(EsxEditor.java:905)
...
I could not figure out why demandLoad()/load() was always returning an
XMLResourceImpl for this specific file. I laced the code with
breakpoints, and was convinced it was due to a character in the file
(like a 0x00 or a BOM sequence). Eventually I realized it was due to
the capitalization of the file in question (which was test.ESX rather
than test.esx), that caused the program to ignore my EsxResourceImpl,
and use a "default" XMLResourceImpl.
Is there a way to register a case insensitive extension with
org.eclipse.emf.ecore.extension_parser, or do I have to register 8
versions of my 3 character extension (ie. esx, esX,eSx, eSX, etc...)?
|
|
|
Re: org.xml.sax.SAXParseException: Content is not allowed in prolog / Custom ResourceImpl / case sen [message #463807 is a reply to message #463055] |
Sun, 02 August 2009 17:48 |
Ed Merks Messages: 33217 Registered: July 2009 |
Senior Member |
|
|
Jeff,
Keep in mind that only Windows is case insensitive so yes, you'd have to
register explicitly all the combinations you'd want to support.
Jeff S. wrote:
> So I'm posting this question mostly to document my issue (in case
> anyone runs into the same problem, and is searching the newsgroup).
> My question is about file extension case-sensitivity, and may be
> better suited for a more "general" newsgroup (not EMF specific).
> Explanation to follow.
>
> Yesterday I wasted a few hours tracking down an issue because of an
> oversight (and I was looking in all the wrong places). I've been
> working on an RCP app (based on EMF) that registers it's own Resource
> Type by implementing doLoad() / doSave() in xxxxResourceImpl and by
> using the extension point org.eclipse.emf.ecore.extension_parser to
> register the extension .esx with my app.
>
> I had been doing some initial testing w/ some of my .esx files, and
> things seemed to be going okay until I loaded one, and kept getting
> the following error "org.xml.sax.SAXParseException: Content is not
> allowed in prolog.":
> (Part of my stack trace):
> org.xml.sax.SAXParseException: Content is not allowed in prolog.
> at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper. createSAXParseException(Unknown
> Source)
> ...
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1494)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1282)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
>
> at
> com.example.plugins.model.esx.presentation.EsxEditor.createM odel(EsxEditor.java:848)
>
> at
> com.example.plugins.model.esx.presentation.EsxEditor.createP ages(EsxEditor.java:905)
>
> ...
>
>
> I could not figure out why demandLoad()/load() was always returning an
> XMLResourceImpl for this specific file. I laced the code with
> breakpoints, and was convinced it was due to a character in the file
> (like a 0x00 or a BOM sequence). Eventually I realized it was due to
> the capitalization of the file in question (which was test.ESX rather
> than test.esx), that caused the program to ignore my EsxResourceImpl,
> and use a "default" XMLResourceImpl.
>
> Is there a way to register a case insensitive extension with
> org.eclipse.emf.ecore.extension_parser, or do I have to register 8
> versions of my 3 character extension (ie. esx, esX,eSx, eSX, etc...)?
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: org.xml.sax.SAXParseException: Content is not allowed in prolog / Custom ResourceImpl / case sen [message #465821 is a reply to message #463807] |
Sun, 02 August 2009 22:47 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
It's even worse because when doing Eclipse Development on win32 and
running e.g. under PDE then everthing works fine until you export it as
a .jar because then everything is case-sensistive :-)
Tom
Ed Merks schrieb:
> Jeff,
>
> Keep in mind that only Windows is case insensitive so yes, you'd have to
> register explicitly all the combinations you'd want to support.
>
>
> Jeff S. wrote:
>> So I'm posting this question mostly to document my issue (in case
>> anyone runs into the same problem, and is searching the newsgroup).
>> My question is about file extension case-sensitivity, and may be
>> better suited for a more "general" newsgroup (not EMF specific).
>> Explanation to follow.
>>
>> Yesterday I wasted a few hours tracking down an issue because of an
>> oversight (and I was looking in all the wrong places). I've been
>> working on an RCP app (based on EMF) that registers it's own Resource
>> Type by implementing doLoad() / doSave() in xxxxResourceImpl and by
>> using the extension point org.eclipse.emf.ecore.extension_parser to
>> register the extension .esx with my app.
>>
>> I had been doing some initial testing w/ some of my .esx files, and
>> things seemed to be going okay until I loaded one, and kept getting
>> the following error "org.xml.sax.SAXParseException: Content is not
>> allowed in prolog.":
>> (Part of my stack trace):
>> org.xml.sax.SAXParseException: Content is not allowed in prolog.
>> at
>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper. createSAXParseException(Unknown
>> Source)
>> ...
>> at javax.xml.parsers.SAXParser.parse(Unknown Source)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>>
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1494)
>>
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1282)
>>
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
>>
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
>>
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
>>
>> at
>> com.example.plugins.model.esx.presentation.EsxEditor.createM odel(EsxEditor.java:848)
>>
>> at
>> com.example.plugins.model.esx.presentation.EsxEditor.createP ages(EsxEditor.java:905)
>>
>> ...
>>
>>
>> I could not figure out why demandLoad()/load() was always returning an
>> XMLResourceImpl for this specific file. I laced the code with
>> breakpoints, and was convinced it was due to a character in the file
>> (like a 0x00 or a BOM sequence). Eventually I realized it was due to
>> the capitalization of the file in question (which was test.ESX rather
>> than test.esx), that caused the program to ignore my EsxResourceImpl,
>> and use a "default" XMLResourceImpl.
>>
>> Is there a way to register a case insensitive extension with
>> org.eclipse.emf.ecore.extension_parser, or do I have to register 8
>> versions of my 3 character extension (ie. esx, esX,eSx, eSX, etc...)?
>>
|
|
|
Powered by
FUDForum. Page generated in 0.04489 seconds