weblogic JNDI配置- 基于Spring XML配置

  |   0 评论   |   0 浏览

xml文件配置:JNDI

<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">     
    <property name="jndiName">  
        <value>${JNDI}</value>  
    </property>    
    <property name="resourceRef">  
        <value>${RESOURCEREF}</value>  
    </property>         
    <property name="jndiEnvironment">   
     <props>   
        <prop key="java.naming.provider.url">${Context.PROVIDER_URL}</prop>   
        <prop key="java.naming.factory.initial">${Context.INITIAL_CONTEXT_FACTORY}</prop>            
     </props>      
   </property>    
</bean>

app.properties配置参数

Context.INITIAL_CONTEXT_FACTORY=weblogic.jndi.WLInitialContextFactory
Context.PROVIDER_URL=t3://localhost:7001
JNDI=ceshi
RESOURCEREF=true