Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Finding reason for IParser.NullImpl usage
Finding reason for IParser.NullImpl usage [message #716190] Tue, 16 August 2011 16:18 Go to next message
Christian Pelster is currently offline Christian PelsterFriend
Messages: 23
Registered: January 2010
Junior Member
Hi all,

currently I'm struggeling with a failing mwe2 workflow, the output looks like this:

0    [main] INFO         org.eclipse.xpand2.Generator  - No meta models configured, using JavaBeans as default.
327265 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher  - Problems running workflow workflow.MyAdminDslClientGenerator: null
java.lang.RuntimeException: Problems running workflow workflow.MyAdminDslClientGenerator: null
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:99)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:73)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:64)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:55)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
Caused by: java.lang.NullPointerException
	at org.eclipse.xtext.resource.XtextResource.updateInternalState(XtextResource.java:212)
	at org.eclipse.xtext.resource.XtextResource.doLoad(XtextResource.java:152)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doLoad(LazyLinkingResource.java:69)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1511)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1290)
	at org.eclipse.xtext.mwe.Validator.validate(Validator.java:65)
	at org.eclipse.xtext.mwe.Reader.invokeInternal(Reader.java:165)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
	at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
	at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
	at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:97)
	... 5 more


with debugging I found out that the problem is that for some reason a Parser.NullImpl is used (after a series of successfull Mwe2Parser calls) in XTextResource.doLoad().
I have no idea why suddenly the NullParserImpl is used and where to start to look for the problem, any hints?


Regards,

Pelle

[Updated on: Tue, 16 August 2011 16:20]

Report message to a moderator

Re: Finding Reason for IParser.NullImpl usage [message #716191 is a reply to message #716190] Tue, 16 August 2011 16:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13887
Registered: July 2009
Senior Member
Hi,

can you share your workflow?

~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Finding Reason for IParser.NullImpl usage [message #716195 is a reply to message #716191] Tue, 16 August 2011 16:26 Go to previous messageGo to next message
Christian Pelster is currently offline Christian PelsterFriend
Messages: 23
Registered: January 2010
Junior Member
Sure,

here it is:

module workflow.MyAdminDslClientGenerator

var targetDir = "src-gen"
var fileEncoding = "UTF-8"
var modelPath = "$path_to_the_model"

Workflow {

	component = org.eclipse.xtext.mwe.Reader {
		// lookup all resources on the classpath
		// useJavaClassPath = true
	
		path = modelPath
	
		// this class will be generated by the xtext generator 
		register = de.pellepelster.myadmin.MyAdminDslStandaloneSetup {}
			load = {
				slot = "model"
				type = "MyAdminDsl"
			}
		}
	
		component = org.eclipse.xpand2.Generator {
			expand = "templates::client::ClientMain::main FOR model"
			outlet = {
				path = targetDir
		}
		
		fileEncoding = fileEncoding
	}
}


Thanks,

Pelle
Re: Finding Reason for IParser.NullImpl usage [message #716196 is a reply to message #716195] Tue, 16 August 2011 16:27 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13887
Registered: July 2009
Senior Member
Hi,

is the resource the problem occurs with a MyAdminDsl Resource?

~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Finding Reason for IParser.NullImpl usage [message #716207 is a reply to message #716196] Tue, 16 August 2011 16:39 Go to previous messageGo to next message
Christian Pelster is currently offline Christian PelsterFriend
Messages: 23
Registered: January 2010
Junior Member
Hi,

as far as I can tell yes, at least inside the call stack in Reader.invokeInternal() the uri refers to my model file inside the model path.

Regards,

Pelle
Re: Finding Reason for IParser.NullImpl usage [message #716211 is a reply to message #716207] Tue, 16 August 2011 17:05 Go to previous messageGo to next message
Christian Pelster is currently offline Christian PelsterFriend
Messages: 23
Registered: January 2010
Junior Member
Hi,

one additional hint, maybe it helps, this is the callstack when the NullParserImpl gets injected:

LazyLinkingResource(XtextResource).setInjectedParser(IParser) line: 133	
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
Method.invoke(Object, Object...) line: 597	
SingleMethodInjector$2.invoke(Object, Object...) line: 72	
SingleMethodInjector.inject(Errors, InternalContext, Object) line: 91	
MembersInjectorImpl<T>.injectMembers(T, Errors, InternalContext) line: 99	
ConstructorInjector<T>.construct(Errors, InternalContext, Class<?>) line: 94	
ConstructorBindingImpl$Factory<T>.get(Errors, InternalContext, Dependency<?>) line: 111	
FactoryProxy<T>.get(Errors, InternalContext, Dependency<?>) line: 56	
InjectorImpl$4$1.call(InternalContext) line: 758	
InjectorImpl.callInContext(ContextualCallable<T>) line: 804	
InjectorImpl$4.get() line: 754	
XtextResourceFactory.createResource(URI) line: 19


and the URI at XtextResourceFactory.createResource(URI) line: 19 points to my model file.

Regards,

Pelle
Re: Finding Reason for IParser.NullImpl usage [message #716218 is a reply to message #716211] Tue, 16 August 2011 17:18 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13887
Registered: July 2009
Senior Member
Hi,

isn't another impl bound in your runtime module (respectively in its abstract parent)?

public Class<? extends org.eclipse.xtext.parser.IParser> bindIParser() {
return .....parser.antlr.MydslParser.class;
}

~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Finding Reason for IParser.NullImpl usage [message #716222 is a reply to message #716218] Tue, 16 August 2011 17:26 Go to previous messageGo to next message
Christian Pelster is currently offline Christian PelsterFriend
Messages: 23
Registered: January 2010
Junior Member
Hi,

the only thing I did is adding a IValueConverterService which has no effect to the perser when removed, here the bastract parent for the runtime:

/**
 * Manual modifications go to {de.pellepelster.myadmin.MyAdminDslRuntimeModule}
 */
 @SuppressWarnings("all")
public abstract class AbstractMyAdminDslRuntimeModule extends DefaultRuntimeModule {

	protected Properties properties = null;

	@Override
	public void configure(Binder binder) {
		properties = tryBindProperties(binder, "de/pellepelster/myadmin/MyAdminDsl.properties");
		super.configure(binder);
	}
	
	public void configureLanguageName(Binder binder) {
		binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("de.pellepelster.myadmin.MyAdminDsl");
	}
	
	public void configureFileExtensions(Binder binder) {
		if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
			binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("msl");
	}
	
	// contributed by org.eclipse.xtext.generator.grammarAccess.GrammarAccessFragment
	public Class<? extends org.eclipse.xtext.IGrammarAccess> bindIGrammarAccess() {
		return de.pellepelster.myadmin.services.MyAdminDslGrammarAccess.class;
	}

	// contributed by org.eclipse.xtext.generator.parseTreeConstructor.ParseTreeConstructorFragment
	public Class<? extends org.eclipse.xtext.parsetree.reconstr.IParseTreeConstructor> bindIParseTreeConstructor() {
		return de.pellepelster.myadmin.parseTreeConstruction.MyAdminDslParsetreeConstructor.class;
	}

	// contributed by org.eclipse.xtext.generator.validation.JavaValidatorFragment
	@org.eclipse.xtext.service.SingletonBinding(eager=true)	public Class<? extends de.pellepelster.myadmin.validation.MyAdminDslJavaValidator> bindMyAdminDslJavaValidator() {
		return de.pellepelster.myadmin.validation.MyAdminDslJavaValidator.class;
	}

	// contributed by org.eclipse.xtext.generator.formatting.FormatterFragment
	public Class<? extends org.eclipse.xtext.formatting.IFormatter> bindIFormatter() {
		return de.pellepelster.myadmin.formatting.MyAdminDslFormatter.class;
	}

}



Regards,

Pelle
Re: Finding Reason for IParser.NullImpl usage [message #716224 is a reply to message #716222] Tue, 16 August 2011 17:30 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13887
Registered: July 2009
Senior Member
Hi,

there must be something stange in yourdsls lanmguage workflow:
// contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment

Maybe thisone is missing at your workflow

~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Finding Reason for IParser.NullImpl usage [message #716384 is a reply to message #716224] Wed, 17 August 2011 09:06 Go to previous message
Christian Pelster is currently offline Christian PelsterFriend
Messages: 23
Registered: January 2010
Junior Member
Hi,

thanks for the hint, for some reason the XtextAntlrGeneratorFragment got lost on the way to MWE2, thanks a lot!

Pelle
Previous Topic:java.lang.OutOfMemoryError: PermGen space
Next Topic:Cross-referencing only if object exists
Goto Forum:
  


Current Time: Wed Apr 21 05:19:05 GMT 2021

Powered by FUDForum. Page generated in 0.02710 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top