AnsweredAssumed Answered

NPE Blueprint initializing BlueprintExpressionManager

Question asked by ronnybr on May 28, 2013
Latest reply on Jun 3, 2013 by ronnybr
Hi everybody,

I am trying to get Activiti running as OSGi-bundle on JBoss AS 7.1.1 and the ExpressionFactoryImpl throws a NPE when trying to access the el.properties.
The server uses OSGi 4.2 and Apache Aries 1.0.0.

Here's the stacktrace:

Caused by: java.lang.NullPointerException
   at org.activiti.engine.impl.juel.ExpressionFactoryImpl.loadProperties(ExpressionFactoryImpl.java:278)
   at org.activiti.engine.impl.juel.ExpressionFactoryImpl.<init>(ExpressionFactoryImpl.java:152)
   at org.activiti.engine.impl.juel.ExpressionFactoryImpl.<init>(ExpressionFactoryImpl.java:137)
   at org.activiti.engine.impl.el.ExpressionManager.<init>(ExpressionManager.java:66)
   at org.activiti.engine.impl.el.ExpressionManager.<init>(ExpressionManager.java:61)
   at org.activiti.osgi.blueprint.ProcessEngineFactoryWithELResolver$BlueprintExpressionManager.<init>(ProcessEngineFactoryWithELResolver.java:43)
   at org.activiti.osgi.blueprint.ProcessEngineFactoryWithELResolver.init(ProcessEngineFactoryWithELResolver.java:29)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_27]
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.6.0_27]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.6.0_27]
   at java.lang.reflect.Method.invoke(Method.java:616) [rt.jar:1.6.0_27]
   at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:238)
   at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:954)
   at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:708)
   … 47 more


I divided my project like Tijs in Activiti in Action. The activiti-engine- and activiti-osgi-bundles are deployed and I use an "engine"-bundle (like book-engine) for the context.xml.
The context.xml looks like this:

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
  xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">

  <ext:property-placeholder />

  <bean id="dataSource" class="org.h2.jdbcx.JdbcDataSource">
    <property name="URL" value="jdbc:h2:mem:test" />
    <property name="user" value="sa" />
    <property name="password" value="sa" />
  </bean>

  <bean id="configurationFactory" class="org.activiti.osgi.blueprint.ConfigurationFactory">
    <property name="dataSource" ref="dataSource" />
    <property name="databaseSchemaUpdate" value="true" />
  </bean>

  <bean id="configuration" factory-ref="configurationFactory" factory-method="getConfiguration" />

  <bean id="processEngineFactory"
      class="org.activiti.osgi.blueprint.ProcessEngineFactoryWithELResolver"
      init-method="init"
      destroy-method="destroy">
     
    <property name="processEngineConfiguration" ref="configuration" />
    <property name="bundle" ref="blueprintBundle" />
    <property name="blueprintELResolver" ref="blueprintELResolver" />
  </bean>

  <bean id="processEngine" factory-ref="processEngineFactory"
    factory-method="getObject" />

  <bean id="runtimeService" factory-ref="processEngine"
    factory-method="getRuntimeService" />
  <bean id="repositoryService" factory-ref="processEngine"
    factory-method="getRepositoryService" />
   
  <reference-list id="activityProviders" availability="optional"
      interface="org.activiti.engine.delegate.JavaDelegate"
      activation="eager">
     
      <reference-listener ref="blueprintELResolver" bind-method="bindService" unbind-method="unbindService"/>
  </reference-list>
 
  <bean id="blueprintELResolver" class="org.activiti.osgi.blueprint.BlueprintELResolver" />
 
  <service ref="processEngine" interface="org.activiti.engine.ProcessEngine" />
  <service ref="runtimeService" interface="org.activiti.engine.RuntimeService" />
  <service ref="repositoryService" interface="org.activiti.engine.RepositoryService" />

</blueprint>


Does anyone have an idea what he tries to do with the el.properties and how I can avoid that NPE?

Outcomes