Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
problem with parser?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jim  
View profile  
 More options Oct 8, 1:46 am
From: Jim <jimst...@gmail.com>
Date: Wed, 7 Oct 2009 22:46:30 -0700 (PDT)
Local: Thurs, Oct 8 2009 1:46 am
Subject: problem with parser?
Hi,

I'm just picking up tefkat for the first time in a very, very long
time, and I found a problem that looks like its in the parser
somewhere. I can comment all the rules/patterns etc in my
transformation and still get the same result, so I think its something
basic about the parser, or resource loading.

Error is as follows...

java.io.IOException: Could not load 'platform:/resource/qut.ifc/model/
express2ecore.qvt': org.xml.sax.SAXParseException: Content is not
allowed in prolog.
        at tefkat.plugin.TefkatPlugin.getResource(Unknown Source)
        at tefkat.plugin.TefkatPlugin.execute(Unknown Source)
        at tefkat.plugin.TefkatPlugin.run(Unknown Source)
        at tefkat.plugin.TefkatBuilder.doBuild(Unknown Source)
        at tefkat.plugin.TefkatBuilder.build(Unknown Source)
        at org.eclipse.core.internal.events.BuildManager$2.run
(BuildManager.java:627)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.core.internal.events.BuildManager.basicBuild
(BuildManager.java:170)
        at org.eclipse.core.internal.events.BuildManager.basicBuild
(BuildManager.java:201)
        at org.eclipse.core.internal.events.BuildManager$1.run
(BuildManager.java:253)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.core.internal.events.BuildManager.basicBuild
(BuildManager.java:256)
        at org.eclipse.core.internal.events.BuildManager.basicBuildLoop
(BuildManager.java:309)
        at org.eclipse.core.internal.events.BuildManager.build
(BuildManager.java:341)
        at org.eclipse.core.internal.events.AutoBuildJob.doBuild
(AutoBuildJob.java:140)
        at org.eclipse.core.internal.events.AutoBuildJob.run
(AutoBuildJob.java:238)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
$1DiagnosticWrappedException: org.xml.sax.SAXParseException: Content
is not allowed in prolog.
        at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadExcepti on
(ResourceSetImpl.java:315)
        at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper
(ResourceSetImpl.java:274)
        at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource
(ResourceSetImpl.java:397)
        ... 17 more
Caused by: org.xml.sax.SAXParseException: Content is not allowed in
prolog.
        at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseE xception
(Unknown Source)
        at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError
(Unknown Source)
        at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError
(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl
$PrologDriver.next(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next
(Unknown Source)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scan Document
(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse
(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl
$JAXPSAXParser.parse(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
(XMLResourceImpl.java:180)
        at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load
(ResourceImpl.java:1494)
        at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load
(ResourceImpl.java:1282)
        at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad
(ResourceSetImpl.java:255)
        at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper
(ResourceSetImpl.java:270)
        ... 18 more

Any suggestions?

Jim.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ed Willink  
View profile  
 More options Oct 8, 5:45 am
From: Ed Willink <e...@willink.me.uk>
Date: Thu, 08 Oct 2009 10:45:49 +0100
Local: Thurs, Oct 8 2009 5:45 am
Subject: Re: problem with parser?
Hi Jim

That looks like what happens when you pass a non-XML file to an XML loader.

    Regards

       Ed Willink


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Steel  
View profile  
 More options Oct 8, 9:46 am
From: Jim Steel <jimst...@gmail.com>
Date: Thu, 8 Oct 2009 23:46:42 +1000
Local: Thurs, Oct 8 2009 9:46 am
Subject: Re: problem with parser?
Yeah, its kinda strange. We're implementing extension_parser with the
file extension, but for some reason its trying to use the xml parser
anyway.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim  
View profile  
 More options Nov 19, 10:40 pm
From: Jim <jimst...@gmail.com>
Date: Thu, 19 Nov 2009 19:40:20 -0800 (PST)
Local: Thurs, Nov 19 2009 10:40 pm
Subject: Re: problem with parser?

Hi Ed (on the offchance you're still reading this forum)

I am working on a different project (based on using Tefkat to write
some transformations), implementing another metamodel (actually 2)
with a non-XML file serialization. I have copied the approach to
resource implementations used by Tefkat, and (unsurprisingly) I am
seeing the above problem again. What Tefkat (and what I'm doing with
these other metamodels/resourceImpls) does is:
1) create TefkatResourceFactoryImpl to implement
org.eclipse.emf.ecore.resource.Resource.Factory and its createResource
(uri) method
2) create TefkatResourceImpl as a subclass of XMIResourceImpl and
overriding doLoad(inputstream, map), and doSave(outputstream, map)
3) implement the extension_parser extension point to associate
the .qvt extension with the TefkatResourceFactoryImpl

So this used to work, but doesn't any more. I assume this is because
we are taking the shortcut of subclassing XMIResourceImpl, and
something has changed in the way that resource sets load resource
impls. I tried subclassing ResourceImpl instead of XMIResourceImpl
(which just by the names would seem to be a good idea), but it didn't
change that error at all.

Cheers,

Jim.

On Oct 8, 11:46 pm, Jim Steel <jimst...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ed Willink  
View profile  
 More options Nov 20, 1:36 am
From: Ed Willink <e...@willink.me.uk>
Date: Fri, 20 Nov 2009 06:36:56 +0000
Local: Fri, Nov 20 2009 1:36 am
Subject: Re: problem with parser?
Hi Jim
> Hi Ed (on the offchance you're still reading this forum)

With low traffic, this newsgroup is often good value.

Yes things are much improved. There are now content types.

The appropriate ResourceFactory to load a file used to be chosen

a) URI-based
b) extension based

Now a content-based choice, if available, precedes the extension-based.

At the platform level these are registered and can be browsed in
Windows->Proferences->General->Content Types.

Content types are defined by the
org.eclipse.core.contenttype.contentTypes extension point with an
associated content describer. See org.eclipse.ocl/plugin.xml for a
non-trivial example.

EMF enables these via the Model.Content Type Identifier genmodel field,
leading to an eCONTENT_TYPE in the Package class. NB genmodel doesn't
update plugin.xml at all, so you might want to experiment creating from
your Ecore model from scratch to see what a virgin plugin.xml copuld
look like.

The ResourceSet load on finding an XML file offers the file to each of
the registered content describers. These can prioritise their
appropriateness allowing the best to be chosen. It is the the backstop
XML handler that crashes on non-XML. Prior to the backstop EMF supports
a namespace-based dispatch of XML to a model-specific loader. You can
therefore have 100 different meta-models all sharing the .xml extension.

The code is not trivial to understand with the platform performing a
useful job in not quite the way that suits EMF, so EMF fights it a bit.

If you put in your own describer, you can probably do interesting things.

There might be a tutorial now. 'content type' and 'content describer'
are the important keywords.

    Regards

       Ed Willink


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
michael lawley  
View profile  
 More options Nov 23, 1:17 am
From: michael lawley <mjlaw...@gmail.com>
Date: Mon, 23 Nov 2009 16:17:34 +1000
Local: Mon, Nov 23 2009 1:17 am
Subject: Re: problem with parser?
Thanks Ed, this is really useful info.

It's somewhat frustrating the way that upgrades to EMF cause bit-rot
based on non-regeneration of files like plugin.xml, etc  But it's
handy to be reminded that this is an issue that needs to be monitored
as new versions come out.

Cheers,

michael

2009/11/20 Ed Willink <e...@willink.me.uk>:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google