cancel
Showing results for 
Search instead for 
Did you mean: 

5.0.rc1, DeployBarTask throws java.lang.NullPointerException

limcheekin
Champ on-the-rise
Champ on-the-rise
Hi there,

Given activiti.cfg.xml file:
<activiti-cfg process-engine-name='activiti-engine-dev'>
  <database type='h2' schema-strategy='check-version'>
    <jdbc url='jdbc:h2:tcp://localhost/activiti' driver='org.h2.Driver' username='sa' password='' />
  </database>
  <job-executor activate='false' />
  <mail server='smtp.yourserver.com' port='25' default-from='username@yourserver.com' />
</activiti-cfg>

And Business Archive (BAR) file (rename to .zip, as upload .bar is not allowed):
[attachment=0]activiti-test-rc1-0.1.zip[/attachment]

The DeployBarTask throws java.lang.NullPointerException, complete stack trace here:

Caused by: java.lang.NullPointerException
        at org.activiti.engine.impl.ant.DeployBarTask.execute(DeployBarTask.java:80)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor83.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        … 192 more

The same code working in beta2. Is this a bug or did I missed out something?

Please advice.

Thanks,
Chee Kin
5 REPLIES 5

frederikherema1
Star Contributor
Star Contributor
Hi,

Looks like an error slipped into our barTask, which presumes when no ProcessEngine is found for the given name, but a ProcessEngineInfo exists, that an error occured while initializing. In this code, no null-check is performed to see if the exception string is empty. I'll create an issue for this.

Since there is no exception stacktrace available in the ProcessEngineInfo I suspect something else is wrong. Did  you set the "processEngineName" property on the <deploy-bar tag to (in your case) "activiti-engine-dev"? If not set, it used default process engine name.

limcheekin
Champ on-the-rise
Champ on-the-rise
Did  you set the "processEngineName" property on the <deploy-bar tag to (in your case) "activiti-engine-dev"? If not set, it used default process engine name.

No, I didn't set anything. Please let's me know if you create a jira issue, so that I can track it too.

Thanks,
Chee Kin

frederikherema1
Star Contributor
Star Contributor
You should set the property "processEngineName" in <barTask to "activiti-engine-dev", since that is the name of your engine (as configured in activiti.cfg.xml), otherwise the BAR deploys to the default engine (which isn't present). This way, it will work for you, regardless of the issue about the nullpointer.

The issue about the NullPointer (instead of a better error-message) is here http://jira.codehaus.org/browse/ACT-308.

limcheekin
Champ on-the-rise
Champ on-the-rise
Ok, I will try it out and revert to you later.

Thanks.

Regards,
Chee Kin

limcheekin
Champ on-the-rise
Champ on-the-rise
Yes. It works! Thank you very much.

Regards,
Chee Kin