Using a JNDI datasource created by another application with Tomcat

前端 未结 5 1206
梦谈多话
梦谈多话 2020-12-10 21:56

I have a .properties file in my application which contains dataSource properties. I set up a JNDI reference to this dataSource using the following code :

//          


        
5条回答
  •  一整个雨季
    2020-12-10 21:58

    Actually, it is possible to access others JNDI resources, if the servlet implements org.apache.catalina.ContainerServlet. This interface has a org.apache.catalina.Wrapper attribute, that is "populated" by the container itself.

    through that, I created a simple application to monitor resources.

    BUT, I would like to do that in a listener, so my resource monitor could start when the container starts. Anyone knows a way?

提交回复
热议问题