JNDI lookup works fine using lookUp but not when used in persistence.xml of JPA

后端 未结 2 2121
感情败类
感情败类 2021-02-19 10:10

I am using tomcat connection pool, jpa, hibernate. The datasource i created in context.xml of tomcat works fine if I try to get it using :

source = (DataSource)          


        
2条回答
  •  借酒劲吻你
    2021-02-19 10:51

    Maybe try the persistence.xml JNDI defined name including both the namespace ("java:comp/env") as well as the JNDI path ("jdbc/kids") in a single-string (i.e put them together).

提交回复
热议问题