Java - javax naming NameNotFoundException DefaultDS not found

February 1, 2016

Problem:

play javax.naming.NameNotFoundException: DefaultDS not found

Solution:

Make sure you include an jndiName to you database configuration, for example:

    “db” : { “default” : { “driver” : com.mysql.jdbc.Driver }},
    “db” : { “default” : { “url” : “jdbc:mysql://xxx.xxx.xxx.xxx:xxxx/<database_name>” }},
    “db” : { “default” : { “username” : }},
    “db” : { “default” : { “password” : }}.
**_    “db” : { “default” : { “jndiName” : DefaultDS }},_**