Using the DMN Engine

Hi,

i’m trying to use the dmn engine in our project. But anyhow there is always an error occuring when i trying to read the model from the dmn file.

	...
	DefaultDmnEngineConfiguration dmnEngineConfiguration = (DefaultDmnEngineConfiguration) 
			DefaultDmnEngineConfiguration.createDefaultDmnEngineConfiguration();
	
	dmnEngineConfiguration.setDefaultInputExpressionExpressionLanguage("groovy");
	DmnEngine dmnEngine = dmnEngineConfiguration.buildEngine();

	try {
	      InputStream fis = dmnRes.getInputStream();

	      //error in readModelFromStream(fis)
 	      DmnModelInstance dmnModelInstance = Dmn.readModelFromStream(fis);
 	      ...

The Inputstream of the resource isnt null.

I tried some other approaches, but they didn’t work, too.

This is the exception:

> 2016-07-14 15:35:40 ERROR ChooseCandidate:213 - java.lang.NullPointerException > java.lang.NullPointerException > at org.apache.catalina.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1544) > at org.apache.xerces.parsers.SecuritySupport$6.run(Unknown Source) > at java.security.AccessController.doPrivileged(Native Method) > at org.apache.xerces.parsers.SecuritySupport.getResourceAsStream(Unknown Source) > at org.apache.xerces.parsers.ObjectFactory.findJarServiceProvider(Unknown Source) > at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source) > at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source) > at org.apache.xerces.parsers.DOMParser.(Unknown Source) > at org.apache.xerces.parsers.DOMParser.(Unknown Source) > at org.apache.xerces.jaxp.DocumentBuilderImpl.(Unknown Source) > at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source) > at org.camunda.bpm.model.xml.impl.util.DomUtil.parseInputStream(DomUtil.java:234) > at org.camunda.bpm.model.xml.impl.parser.AbstractModelParser.parseModelFromStream(AbstractModelParser.java:65) > at org.camunda.bpm.model.dmn.impl.DmnParser.parseModelFromStream(DmnParser.java:59) > at org.camunda.bpm.model.dmn.Dmn.doReadModelFromInputStream(Dmn.java:234) > at org.camunda.bpm.model.dmn.Dmn.readModelFromStream(Dmn.java:150) > at de.testprojects.common.bpm.mi.process.mapRequest.ChooseCandidate.execute(ChooseCandidate.java:186) >...

Anyone an idea how to fix it?

Hi,

That’s a NullPointerException in a Tomcat class. Could you please debug/read the source code of WebappClassLoader to understand why the exception occurs?

Cheers,
Thorben