首页 文章

WSO2 Carbon 4.x JNDI Tomcat

提问于
浏览
2

基于Carbon 4.x平台的WSO2 Registry 4.5.x允许部署WAR . 对于资源配置,我想使用JNDI .

如此处所述,我尝试配置JNDI资源:http://kishanthan.wordpress.com/2012/05/31/how-to-register-jndi-resources-for-webapps-in-wso2-application-server/

1)WEB-INF / web.xml

<resource-ref>
    <res-ref-name>url/ZoneConfiguration</res-ref-name>
    <res-type>java.net.URL</res-type>
    <res-auth>Container</res-auth>
</resource-ref>

2)META-INF / context.xml

<Context debug="5" reloadable="true" crossContext="true">
     <ResourceLink name="url/ZoneConfiguration" global="url/ZoneConfiguration" type="java.net.URL"/>    
</Context>

3)$ CARBON_HOME / repository / conf / tomcat / catalina-server.xml:

<GlobalNamingResources>
     <Resource name="url/ZoneConfiguration" factory="org.jee.jndi.URLResourceFactory" 
        type="java.net.URL" url="file:///temp/local.zone.properties"/>      
  </GlobalNamingResources>

(关于工厂:请参见此处http://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html#Adding_Custom_Resource_Factories)带有URLResourceFactory的库部署在$ CARBON_HOME / lib / endorsed中

此配置适用于Tomcat 7.x,但不适用于WSO2 Tomcat . 我倾向于提出问题 . 或者我缺少WSO2特有的东西?

1 回答

相关问题