Issue while configuring jndi in weblogic

Dear All,

We are using embedded camunda which was working fine before. We recently change datasource configuration through jndi and after that changes we are facing issue as as below…

Any help is appreciated… Thanks in advance

ERROR context:156 - ENGINE-16004 Exception while closing command context: ENGINE-03051 There was an exception while invoking the TaskListener. Message: 'Exception while invoking TaskListener: Pre-bound JDBC Connection found! JpaTransactionManager does not support running within DataSourceTransactionManager if told to manage the DataSource itself. It is recommended to use a single JpaTransactionManager for all transactions on a single DataSource, no matter whether JPA or JDBC access.'
org.camunda.bpm.engine.ProcessEngineException: ENGINE-03051 There was an exception while invoking the TaskListener. Message: ‘Exception while invoking TaskListener: Pre-bound JDBC Connection found! JpaTransactionManager does not support running within DataSourceTransactionManager if told to manage the DataSource itself. It is recommended to use a single JpaTransactionManager for all transactions on a single DataSource, no matter whether JPA or JDBC access.’
at org.camunda.bpm.engine.impl.db.EnginePersistenceLogger.invokeTaskListenerException(EnginePersistenceLogger.java:446)
at org.camunda.bpm.engine.impl.persistence.entity.TaskEntity.fireEvent(TaskEntity.java:960)
at org.camunda.bpm.engine.impl.persistence.entity.TaskEntity.setAssignee(TaskEntity.java:861)
at org.camunda.bpm.engine.impl.persistence.entity.TaskEntity.delegate(TaskEntity.java:359)
at org.camunda.bpm.engine.impl.cmd.DelegateTaskCmd.execute(DelegateTaskCmd.java:52)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.camunda.bpm.engine.impl.interceptor.Command

Here is my applicationContext.xml

<?xml version="1.0" encoding="UTF-8"?>
<!-- Commented to implement JNDI - end -->


<bean id="transactionManager"
	class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
	<property name="dataSource" ref="dataSourceCamunda" />
</bean>


<bean id="processEngineConfiguration"
	class="org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration">
	<property name="processEngineName" value="default" />
	<property name="dataSource" ref="dataSourceCamunda" />
	<property name="transactionManager" ref="transactionManager" />
	<property name="databaseSchemaUpdate" value="false" />
	<property name="jdbcBatchProcessing" value="false" /><!-- Added 
		by Apar : https://forum.camunda.io/t/fresh-installation-fails-on-startup-oracle-12c/6259/2 -->
	<property name="jobExecutorActivate" value="true" />
	<property name="metricsEnabled" value="false" /><!-- Added for 
		Meter log error : https://docs.camunda.org/manual/7.8/user-guide/process-engine/metrics/ -->
	<property name="jobExecutorDeploymentAware" value="true"/>
	<property name="history" value="audit" />
	<property name="processEnginePlugins">
		<list>
			<!--<ref bean="ldapIdentityProviderPlugin" /> -->
			<!--<ref bean="administratorAuthorizationPlugin" /> -->
			<bean id="spinPlugin"
				class="org.camunda.spin.plugin.impl.SpinProcessEnginePlugin" />
			<bean id="connectPlugin"
				class="org.camunda.connect.plugin.impl.ConnectProcessEnginePlugin" />
		</list>
	</property>
</bean>

<bean id="processEngine"
	class="org.camunda.bpm.engine.spring.ProcessEngineFactoryBean">
	<property name="processEngineConfiguration"
		ref="processEngineConfiguration" />
</bean>

<bean id="ldapIdentityProviderPlugin"
	class="org.camunda.bpm.identity.impl.ldap.plugin.LdapIdentityProviderPlugin">
	<!--<property name="serverUrl" value="******" 
		/> -->
	<property name="serverUrl"
		value="*********************" />
	<property name="baseDn" value="dc=*********,dc=**" />
	<property name="managerDn" value="" />
	<property name="managerPassword" value="" />
	<property name="userSearchBase" value="cn=users" />
	<property name="userSearchFilter"
		value="(objectclass=person)" />
	<property name="userIdAttribute" value="uid" />
	<property name="userFirstnameAttribute" value="cn" />
	<property name="userLastnameAttribute" value="sn" />
	<property name="userEmailAttribute" value="mail" />
	<property name="userPasswordAttribute" value="userPassword" />
	<property name="groupSearchBase"
		value="cn=DubaiCustomGroups,cn=groups" />
	<property name="groupSearchFilter"
		value="(objectclass=orclGroup)" />
	<property name="groupIdAttribute" value="uid" />
	<property name="groupNameAttribute" value="cn" />
	<property name="groupMemberAttribute" value="uniquemember" />
</bean>

<!--<bean id="administratorAuthorizationPlugin" class="org.camunda.bpm.engine.impl.plugin.AdministratorAuthorizationPlugin"> 
	<property name="administratorUserName" value="admin" /> </bean> -->

<bean id="administratorAuthorizationPlugin"
	class="org.camunda.bpm.engine.impl.plugin.AdministratorAuthorizationPlugin">
	<property name="administratorGroupName"
		value="*************" />
</bean>


<bean id="repositoryService" factory-bean="processEngine"
	factory-method="getRepositoryService" />
<bean id="runtimeService" factory-bean="processEngine"
	factory-method="getRuntimeService" />
<bean id="taskService" factory-bean="processEngine"
	factory-method="getTaskService" />
<bean id="historyService" factory-bean="processEngine"
	factory-method="getHistoryService" />
<bean id="managementService" factory-bean="processEngine"
	factory-method="getManagementService" />
<bean id="identityService" factory-bean="processEngine"
	factory-method="getIdentityService" />

<!-- JNDI Config start -->
  <jee:jndi-lookup id="dataSourceCamunda" jndi-name="jdbc/camunda_ds"/>

<!-- JNDI Config end -->

Hello @Anurag_Tripathi,

I think that the datasource is not configured correctly for the process engine or at least I don’t see it in the provided file.
Please have a look at our docs:

The processEngineConfiguration attributes transactionManager and dataSource must be configured consistently, i.e. the transactionManager bean must actually manage the data source. If that is not the case, the process engine will use auto-commit mode for the data source connection, potentially leading to inconsistencies in the database.

Also, in case you are using the enterprise edition, I would recommend you to open a support ticket if the issue persists:

Hope that helps.

Best,
Yana

Thanks Yana for your reply.

We have created jndi data source as, you can check context file…

<jee:jndi-lookup id=“dataSourceCamunda” jndi-name=“jdbc/camunda_ds”/>

transactionManager bean and processEngineConfiguration bean both have reference of dataSourceCamunda.

Is there another way to configure jndi camunda or we missed something?

Appreciate your help on this.

Dear All,

Kindly help on this issue.

Thanks,
Anurag

@Anurag_Tripathi are you using @Transactional in delegates are in implementations?

We are @Transactional at class level,. Scenario : we delegate and update status in another DB.

Hi @Anurag_Tripathi,

I didn’t find <tx:annotation-driven/> declaration in your config. But you are using annotation driven transaction in the process application. You need to add the below property in spring configuration file:

<tx:annotation-driven/>

We have another context file where we are using. this context file has another data source to connect with different database.

Here is entry we found in and different context file.
<tx:annotation-driven transaction-manager=“transactionManager” />

We have added the entry for camunda context.xml but still getting same issue.

Dear All,

Any help ??

Thanks in advance…