JNDI설정

spring-boot 2020. 7. 22. 23:47


- JNDI 객체 가져오기 방법 중 하나
public DataSource jndiDataSource() throws IllegalArgumentException, NamingException {
    JndiObjectFactoryBean bean = new JndiObjectFactoryBean();
    bean.setJndiName     ("java:comp/env/" + jndiName);
    bean.setProxyInterface(DataSource.class);
    bean.setLookupOnStartup(false);
    bean.afterPropertiesSet();
    return (DataSource)bean.getObject();
}

https://stackoverflow.com/questions/36664417/spring-boot-jndi-value-lookup/37020384


- multi datasource
https://cnpnote.tistory.com/entry/SPRING-JNDI%EB%A1%9C-%EC%8A%A4%ED%94%84%EB%A7%81-%EB%B6%80%ED%8A%B8%EC%97%90%EC%84%9C-%EB%8B%A4%EC%A4%91-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EC%86%8C%EC%8A%A4-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0

- Embedded tomcat JNDI설정
https://stackoverflow.com/questions/52552866/spring-boot-2-embedded-tomcat-jndi-datasource-configuration

https://stackoverflow.com/questions/24941829/how-to-create-jndi-context-in-spring-boot-with-embedded-tomcat-container


- jeus op_lookup failed name not found
https://base-on.tistory.com/347

 

[JEUS]javax.naming.NameNotFoundException: 해결

javax.naming.NameNotFoundException: OP_LOOKUP failed: Databasesource1 [Root exception is javax.naming.NameNotFoundException: [Databasesource1] Name not found.]         at sun.ref..

base-on.tistory.com

 

Posted by 張's blog
,