2010-04-15 2 views
0

우리는 Websphere ^에서 전개하는 우리 프로젝트에서 정의 된 전체 스프링 빈을 가지고있다. 한 예로되는 다음 컨테이너 외부에 스프링 콩을 사용할 수 없습니다. 항상 WebSphere 컨텍스트 가져 오기

<bean id="oasJdbcData" class="oracle.jdbc.pool.OracleConnectionCacheImpl"> 
     <property name="driverType"> 
      <value>oracle.jdbc.driver.OracleDriver</value> 
     </property> 
     <property name="URL"> 
      <value>jdbc:oracle:thin:@oracle:1521:OASIS</value> 
     </property> 
     <property name="user"> 
      <value>oasis_owner</value> 
     </property> 
     <property name="password"> 
      <value>o3ngin33r</value> 
     </property> 
    </bean> 

이제 우리는 내 JUnit을

ServiceLocator.getInstance().getBean("oasJdbcData"; 

받고에서 다음을이 작업을 수행하려고 할 때 이제

private static ServiceLocator serviceLocator = new ServiceLocator(); 

private static ApplicationContext beanFactory = new ClassPathXmlApplicationContext(APPLICATION_CONTEXT_LOCATION); 

protected ServiceLocator() { 
} 

public ApplicationContext getBeanFactory() { 
    return beanFactory; 
} 

public static ServiceLocator getInstance() { 
    return serviceLocator; 

을 다음과 같이 서비스 로케이터 클래스가 예외

Caused by: javax.naming.ServiceUnavailableException: Could not obtain an initial context due to a communication failure. Since no provider URL was specified, the default provider URL of "corbaloc:iiop:[email protected]:2809/NameService" was used. Make sure that any bootstrap address information in the URL is correct and that the target name server is running. Possible causes other than an incorrect bootstrap address or unavailable name server include the network environment and workstation network configuration. [Root exception is org.omg.CORBA.TRANSIENT: java.net.ConnectException: Connection refused: connect:host=192.168.255.1,port=2809 vmcid: IBM minor code: E02 completed: No] 
    at com.ibm.ws.naming.util.WsnInitCtxFactory.mapInitialReferenceFailure(WsnInitCtxFactory.java:1968) 
    at com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1172) 
    at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootContextFromServer(WsnInitCtxFactory.java:720) 
    at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:643) 
    at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:489) 
    at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:113) 
    at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:428) 
    at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:144) 
    at javax.naming.InitialContext.lookup(InitialContext.java:361) 
    at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:155) 
    at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:88) 
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:153) 
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178) 
    at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:104) 
    at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105) 
    at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:200) 
    at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:186) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1368) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334) 
    ... 33 more 

명확하게 그것이 내가 원하지 않는 Websphere 의 IntialContext를 찾고 있음 몸이 내가 뭘 잘못하고 있는지 말할 수 있습니까?

답변

0

플랫폼 (운영 체제, 특히 네트워킹 설정)이 엉망입니다. 라우팅 설정, 방화벽 또는 DNS 설정이 잘못 구성되었을 수 있습니다. 재미있는 점은 프로파일을 만들 때 특정 설정을 저장하므로 WAS를 수정하지 않을 수도 있습니다. 설치를 시작하기 전에 모든 것을 시작하고 플랫폼이 건강한지 확인하십시오.

관련 문제