Configuring JNDI for Database Custom Field

I cannot seem to get this plugin to work.

I have added the following resource in server.xml:

<Resource name="jdbc/myDB"

			 	 auth="Container" type="javax.sql.DataSource"

			 	 username="userName"

			 	 password="password"

			 	 driverClassName="net.sourceforge.jtds.jdbc.Driver"

			 	 url="jdbc:jtds:sqlserver://myserver:1433;database=MyDb;"

			  />

I have used this JNDI Name: java:comp/env/jdbc/myDB

and I get this error in the log:

2013-10-03 06:56:03,531 http-bio-8080-exec-2 ERROR user 416x85x1 vawvqi 10.255.32.85 /secure/QuickCreateIssue!default.jspa [commons.jira.kconfig.PluginConfiguration] Database JNDI >>java:comp/env/jdbc/myDB<<, error obtaining connection

2013-10-03 06:56:03,531 http-bio-8080-exec-2 ERROR user 416x85x1 vawvqi 10.255.32.85 /secure/QuickCreateIssue!default.jspa [databasecf.querydb.impl.QueryDatabaseImpl] Not connected. Possible database misconfiguration ?

2013-10-03 06:56:03,531 http-bio-8080-exec-2 ERROR user 416x85x1 vawvqi 10.255.32.85 /secure/QuickCreateIssue!default.jspa [databasecf.querydb.impl.QueryDatabaseImpl] Could not execute SQL query >>

3 answers

1 accepted

Use context.xml, not server.xml. It might work.

Could you pls try the exact string "jdbc/myDB" ? I cannot find it right now, but JNDI had some problems with namespaces (e.g. "jdbc") on some tomcats, so what I recommend is to use a simple string "myDB" in both places. We anyway add the prefix "java:comp/env" and search for it if it is not found from the very first time ;)

Of course, this assumes that the config is right.

For reference: http://confluence.kepler-rominfo.com/display/DBCF/Data+Source+Configuration

I have made the change to the DS name in the server.xml file as well as in the plugin configuration but I still get the same error. Is there a way I can test the connection string to confirm it is working properly?

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,026 views 12 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot