문제

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