Home » Modeling » TMF (Xtext) » error "Could not serialize EObject via backtracking"
error "Could not serialize EObject via backtracking" [message #754950] |
Sat, 05 November 2011 19:00 |
|
Hi
after updating to Xtext 2.1, I find that my unit tests all fail when
they parse my model with such an error:
java.lang.RuntimeException: Could not serialize EObject via backtracking.
Constraint: null name=ID? ePackage=[EPackage|STRING] genModel=STRING?
judgmentDescriptions+=JudgmentDescription* rules+=Rule* null
Values: ePackage(1), ePackageURI(1)
Semantic Object: TypeSystemDefinition''
Context: TypeSystemDefinition
I noted that in AbstractXtextTests, after loading the resource there is
this code
if (expectedErrors == 0 && resource.getContents().size() > 0 &&
shouldTestSerializer(resource)) {
SerializerTester tester = get(SerializerTester.class);
EObject obj = resource.getContents().get(0);
tester.assertSerializeWithNodeModel(obj);
tester.assertSerializeWithoutNodeModel(obj);
}
and this line fails:
tester.assertSerializeWithNodeModel(obj);
of course I could disable this (by redefining shouldTestSerializer, but
I'd like to understand why I get this error and how could I fix it
by the way, ePackageURI attribute above is not part of the grammar (it
is added in the ecore by postprocessing); can this be the source of the
problem?
thanks in advance
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
| |
Re: error "Could not serialize EObject via backtracking" [message #755434 is a reply to message #755013] |
Tue, 08 November 2011 13:54 |
|
On 11/06/2011 09:53 PM, Sebastian Zarnekow wrote:
> Hi Lorenzo,
>
> yes that is the reason for the failing test. Please implement a
> transient value service or mark the attribute as transient in your ecore
> model.
Hi Sebastian
I did that, and that solves one problem (the one with ePackageURI);
however, I still have another problem now:
java.lang.RuntimeException: No EObjectDescription could be found in
Scope TypeSystemDefinition.ePackage for EPackage'fj'
Semantic Object: TypeSystemDefinition''
I think that is due to
ePackage=[ecore::EPackage|STRING]
in my DSL I specify the epackage reference through a URI; during the
serialization though the ePackage gives problems since when it tries to
serialize the ePackage it gets its 'name'... at least, this is what I
figured...
these problem take place only during unit testing (plain junit tests)...
again I can turn off serialization tests...
cheers
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
| |
Goto Forum:
Current Time: Fri Apr 19 01:31:18 GMT 2024
Powered by FUDForum. Page generated in 0.23452 seconds
|