Take a look at Spring Download now and want to do it right using the Java configuration and ultimately without web.xml . So, the tricky part is that a classic WAR file is required for the production environment.
Therefore, I specified a WAR for packaging in my Maven pom.xml file, and the main class is Application extends SpringBootServletInitializer .
It works well. Now the tricky part is that in a production environment, Datasource provided through JNDI . In a classic Spring application, you should reference this dependency in web.xml using resource-ref as follows:
<resource-ref> <res-ref-name>jdbc/DefaultDB</res-ref-name> <res-type>javax.sql.DataSource</res-type> </resource-ref>
All the studies carried out seem to indicate that I can get rid of web.xml and replace it with the corresponding context.xml file (in the META-INF folder):
<Resource name="jdbc/DefaultDB" auth="Container" type="javax.sql.DataSource" factory="com.sap.jpaas.service.persistence.core.JNDIDataSourceFactory"/>
Unfortunately this does not work: /
Interestingly, however, the regular servlet3 web application works just fine, see [ https://github.com/steinermatt/servlet3-sample] .
So, I am tempted to believe that the reason it does not work for the Spring application to boot is due to the w760> Boot Boot Boot ... boot process, so, really looking for any hints, suggestions for what it might be!
Any help is appreciated!
Matthias steiner
source share