2
votes

WSO2 Registry 4.5.x based on Carbon 4.x plattform allows to deploy WARs. For configuration of resources I want to use JNDI.

As described here, I try to configure JNDI resources: 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>

(about factory: see here http://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html#Adding_Custom_Resource_Factories) The library with URLResourceFactory is deployed in $CARBON_HOME/lib/endorsed

This configuration works in a Tomcat 7.x but not in the WSO2 Tomcat. I am inclined to file an issue. Or am I lacking anything WSO2 specific?

1

1 Answers

1
votes

WSO2 Registry 4.5.X does not support hosting webapps out of the box, unless you have installed the webapp management feature on top of WSO2 Registry.

You can find more info related to JNDI Resources configurations from this post [1]. A sample is also included in that post which demonstrates the configurations and accessing resources defined as global naming resources with custom resource factory implementation.

[1] http://kishanthan.wordpress.com/2012/05/31/how-to-register-jndi-resources-for-webapps-in-wso2-application-server/