I have a DataSource configured in a Weblogic 12c as shown on the image below:
And I also have a web application on the same Weblogic server that uses this datasource:
Whenever I start Weblogic from the ground up everything works fine. But, after it is up, if I try to shutdown the webapplication and then start it again, I have an "javax.naming.NameNotFoundException" as shown below:
This is the code I am using to get the datasource:
@Bean
public DataSource dataSource() {
final JndiDataSourceLookup dsLookup = new JndiDataSourceLookup();
dsLookup.setResourceRef(true);
DataSource dataSource = dsLookup.getDataSource("jdbc/xdrstoredbds");
return dataSource;
}
What may I be missing?