블로그 이미지
올해목표 // 10월 어학연수 떠나자~ 자수씨

카테고리

전체글 (1457)
Brand New! (28)
주절주절 (213)
MOT (11)
해외쇼핑 (49)
쇼핑노트 (150)
취미생활 (94)
iPhone (4)
Eclipse (121)
Google (83)
Spring (31)
JAVA (176)
JavaScript (59)
WEB (49)
Database (20)
OS (26)
Tools (8)
Tips (26)
IT정보 (1)
Book (21)
Programming (37)
외부행사 (43)
주변인들 (17)
여행노트 (60)
학교생활 (30)
회사생활 (52)
사회생활 (5)
외국어공부 (12)
잡동사니 (30)
Total
Today
Yesterday
 
04-19 12:12
 

달력

« » 2024.4
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
 

최근에 올라온 글

최근에 달린 댓글

JNDI 저장소가 필요해서 stand-alone 으로 띄울 수 있는 걸 찾아보기도 하고 이것저것 연구해본 결과... JBoss의 마이크로컨테이너를 이용하여 JNDI 서버를 띄우는 것이 가장 쉽고 편한 방법이란 것을 찾았습니다.


간단하게 설명하면 아래와 같습니다.

1. JBoss AS 를 다운받습니다. (5.1.0.GA 기준)

2. ./server/minimal/conf/jboss-service.xml 에서 "jboss:service=Naming" 관련 mbean 설정을 확인합니다.

 - 포트 설정 등등...

3. JBoss 를 띄울 때, "-b 0.0.0.0 -c minimal" 옵셥을 추가하여 띄우면 끝!!



이것 때문에 한 몇 개월 고민만 하고 작업은 실제로 한 것은 많이 없었는데, 당장 필요하니깐 몸이 또 움직이는군요... 음



Posted by 자수씨
, |

JBoss 에서 네이밍 서비스를 이용하기 위해서 InitialContext 객체를 그냥 생성하게 되면 아래와 같은 오류를 접하게 됩니다.

javax.naming.CommunicationException: Could not obtain connection to any of these urls: vm://localhost and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server vm:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server vm:1099 [Root exception is java.net.UnknownHostException: vm]]

JBoss 에서는 InitialContext 생성 시에 "java.naming.provider.url" 기본 값이  "vm:localhost:1099" 로 설정이 되어있어, vm 프로토콜을 찾지 못하고 처리를 재대로 못하게 되는 것입니다.


다음과 같은 프로퍼티 설정으로 오류를 해결할 수 있습니다.

기존 소스
InitialContext context = new InitialContext();

변경된 소스
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
properties.put(Context.PROVIDER_URL, "jnp://localhost:1099");
InitialContext context = new InitialContext(properties);


~


Posted by 자수씨
, |

글 보관함

최근에 받은 트랙백