Details
Description
When deploying and running an application with activiti-cdi on Glassfish a "No valid EE environment for injection of ..." message is logged during startup and sometimes when an activiti-cdi component is used.
INFO: Mojarra 2.1.6 (SNAPSHOT 20111206) für Kontext '/jsf2-task-management' wird initialisiert. INFO: WEB0671: Loading application [jsf-task-management] at [/jsf2-task-management] INFO: Initializing activiti-cdi. INFO: initializing process engine for resource file:/data/Projects/JavaLibs/glassfish/glassfish-3.1.2/glassfish/domains/domain1/eclipseApps/jsf-task-management/WEB-INF/classes/activiti.cfg.xml INFO: Loading XML bean definitions from resource loaded through InputStream INFO: ProcessEngine default created INFO: initialised process engine default SCHWERWIEGEND: No valid EE environment for injection of org.activiti.cdi.impl.util.ActivitiServices INFO: Adding 'diagrams/twitterProcess.bpmn20.xml' to deployment. INFO: Processing resource diagrams/twitterProcess.bpmn20.xml INFO: XMLSchema currently not supported as typeLanguage INFO: XPath currently not supported as expressionLanguage WARNUNG: Cannot generate process diagram while running in AWT headless-mode INFO: jsf-task-management was successfully deployed in 4.204 milliseconds.
The jsf-task-management application is only changed with respect to the transaction manager lookup and the datasource:
<!-- lookup the JTA-Transaction manager --> <bean id="transactionManager" class="org.springframework.jndi.JndiObjectFactoryBean"> <!-- property name="jndiName" value="java:jboss/TransactionManager"></property --> <property name="jndiName" value="java:appserver/TransactionManager"/> <property name="resourceRef" value="true" /> </bean> <!-- process engine configuration --> <bean id="processEngineConfiguration" class="org.activiti.cdi.CdiJtaProcessEngineConfiguration"> <!-- Jboss 6: java:/DefaultDS --> <property name="dataSourceJndiName" value="jdbc/Erp" /> <property name="databaseType" value="mysql" /> <property name="transactionManager" ref="transactionManager" /> <property name="transactionsExternallyManaged" value="true" /> <property name="databaseSchemaUpdate" value="true" /> <property name="mailServerHost" value="localhost" /> <property name="mailServerPort" value="2525" /> </bean>
The following problems occur when a timer boundary event is fired:
SCHWERWIEGEND: No valid EE environment for injection of org.activiti.cdi.impl.context.DefaultBusinessProcessAssociationManager SCHWERWIEGEND: No valid EE environment for injection of org.activiti.cdi.impl.context.DefaultBusinessProcessAssociationManager$ThreadScopedAssociation SCHWERWIEGEND: No valid EE environment for injection of org.activiti.cdi.impl.context.DefaultBusinessProcessAssociationManager SCHWERWIEGEND: No valid EE environment for injection of org.activiti.cdi.impl.context.DefaultBusinessProcessAssociationManager SCHWERWIEGEND: No valid EE environment for injection of org.activiti.cdi.impl.context.DefaultBusinessProcessAssociationManager
No exception is logged to the server log. I tried to debug and find the reason why this messages are logged, in the CdiResolver a IllegalStateException is thrown in the getWrappedResolver().getValue(this.context, base, property) method, and then the ProgrammaticBeanLookup.lookup(property.toString(), getBeanManager()) performs the lookup. I dont know if this messages is only informal but logged with the SEVERE level, as it seems, at least what i discovered till now, that injection into the executed service task which is executed after a timer bondary event fired on an user task works.
Of course the timer boundary event is not used in the jsf-task-management webapp, it is used in another process in an different webapp.