質問

My Xtext Editor throws com.google.inject.CreationException: Guice creation errors: 1) Error injecting method, java.lang.ExceptionInInitializerError .... during opening.

It's...

Caused by: java.lang.RuntimeException: Missing serialized package: MyDsl.ecore
at com.sample.impl.MyDslPackageImpl.loadPackage(MyDslPackageImpl.java:5989)
at com.sample.impl.MyDslPackageImpl.init(MyDslPackageImpl.java:1098)
at com.sample.MyDslPackage.<clinit>(MyDslPackage.java:58)
... 75 more

The MyDsl.ecore file resides in the model/generated and also in the src-gen folders com.sample.impl package. So it's physically at the right place. But anyway the loadPackage method of MyDslPackageImpl.java can't load it.

Does anyone have an idea what may be the reason and how to solve that?

役に立ちましたか?

解決

Problem solved. The reason was the *.ecores file size.

Solution: split the grammar into seperate projects and import one into the other.

Nice tutorial how to do so at: http://christiandietrich.wordpress.com/2012/08/07/xtext-referencing-elements-of-one-dsl-from-another-dsl/

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top