NamingException while finding UserTransaction named java:comp/env/UserTransaction in JNDI

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

When JIRA application is running, the following exception is captured and flooding the logs file:

[core.entity.transaction.JNDIFactory] NamingException while finding UserTransaction named java:comp/env/UserTransaction in JNDI.
javax.naming.NameNotFoundException: Name UserTransaction is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:152)
at javax.naming.InitialContext.lookup(InitialContext.java:409)
at org.ofbiz.core.entity.transaction.JNDIFactory.getUserTransaction(JNDIFactory.java:113)
at org.ofbiz.core.entity.TransactionFactory.getUserTransaction(TransactionFactory.java:93)
at org.ofbiz.core.entity.TransactionUtil.getStatus(TransactionUtil.java:81)
at org.ofbiz.core.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:412)
at org.ofbiz.core.entity.GenericDAO.select(GenericDAO.java:464)
at org.ofbiz.core.entity.GenericHelperDAO.findByPrimaryKey(GenericHelperDAO.java:78)
at org.ofbiz.core.entity.GenericDelegator.findByPrimaryKey(GenericDelegator.java:543)
at org.ofbiz.core.entity.GenericDelegator.findByPrimaryKey(GenericDelegator.java:578)
at com.opensymphony.module.propertyset.ofbiz.OFBizPropertySet.get(OFBizPropertySet.java:277)
at com.opensymphony.module.propertyset.AbstractPropertySet.getString(AbstractPropertySet.java:305)
at com.atlassian.sal.jira.scheduling.JiraPluginSchedulerService.run(JiraPluginSchedulerService.java:66)
at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:60)
at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:47)
at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
at com.atlassian.multitenant.quartz.MultiTenantThreadPool$MultiTenantRunnable.run(MultiTenantThreadPool.java:72)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
2011-09-14 13:16:31,889 QuartzWorker-1 WARN ServiceRunner com.atlassian.jira.plugin.ext.bamboo.service.PlanStatusUpdateServiceImpl:job [core.entity.transaction.JNDIFactory][JNDIFactory.getUserTransaction] Failed to find UserTransaction named java:comp/env/UserTransaction in JNDI.

Cause

This problem mainly affects JIRA EAR/WAR installation type, whereby the 'UserTransaction' Resource is missing from the jira.xml file.

Resolution

  1. In order to fix the issue, we can add the UserTransaction in the jira.xml file:

    <Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction"
        factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/>
    <Manager pathname=""/>

    (info) Additional details on this are specified in the documentation on Configure JIRA's Context in Tomcat.

     

  2. Try to force JIRA to recompile the jsp files by doing the following:
    1. Shutdown JIRA
    2. Remove the work folder located in the tomcat installation directory to force JIRA recompile all jsp files.
    3. Delete the webapps/jira subdirectory of your Tomcat installation directory
    4. Restart JIRA

There is also a known issue with the configuration of dbconfig.xml as detailed in JIRA Functionality Fails due to InstanceAlreadyExistsException that may additionally be related to this.

Last modified on Mar 30, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.