WSO2 AS JDNI lookup

谁说我不能喝 提交于 2020-01-05 05:50:53

问题


In WSO2 AS 5.0.1 I deploy a webapp which should use a datasource. I can configure the datasource in tomcat-server.xml or any other place in the WAR, but is it possible to use a datasource that is configured in the Carbon Management Console through JNDI?

Steps taken:

  1. Configure datasource in Management Console, export it as JNDI as jdbc/platform

  2. ResourceLink in META-INF/context.xml to link the global resource:

    < ResourceLink name="jdbc/platform" global="jdbc/platform" type="javax.sql.DataSource" />

  3. Reference the resource in web.xml

    < resource-ref> < res-ref-name>jdbc/platform < res-type>javax.sql.DataSource < res-auth>Application

However trying to lookup jdbc/platform or java:comp/env/jdbc/platform does not resolve into an object. The lookup files with messages like: Name [java:jdbc/platform] is not bound in this Context. Unable to find [java:jdbc]. or, when using comp/env as prefix it will complain that 'comp' is not available.

Is this kind of configuration supported by WSO2 Carbon?


回答1:


Currently this is not supported see https://wso2.org/jira/browse/CARBON-13908.




回答2:


This feature will work on AS 5.1.0 version which planed to release very soon.



来源:https://stackoverflow.com/questions/13849443/wso2-as-jdni-lookup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!