WSO2 AS JDNI查找 [英] WSO2 AS JDNI lookup
问题描述
在WSO2 AS 5.0.1中,我部署了一个应使用数据源的webapp。
我可以在tomcat-server.xml或WAR中的任何其他位置配置数据源,但是是否可以使用通过JNDI在Carbon Management Console中配置的数据源?
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?
执行的步骤:
-
在管理控制台中配置数据源,将其作为JNDI导出为jdbc / platform
Configure datasource in Management Console, export it as JNDI as jdbc/platform
META-INF / context.xml中的ResourceLink来链接全局资源:
ResourceLink in META-INF/context.xml to link the global resource:
< ResourceLink name = jdbc / platform global = jdbc / platform type = javax.sql.DataSource />
< ResourceLink name="jdbc/platform" global="jdbc/platform" type="javax.sql.DataSource" />
引用Web中的资源。 xml
Reference the resource in web.xml
< resource-ref>
< res-ref-name> jdbc / platform
< res-type> javax.sql.DataSource
< res-auth>应用程序
< resource-ref> < res-ref-name>jdbc/platform < res-type>javax.sql.DataSource < res-auth>Application
但是尝试查找jdbc / platform或java:comp / env / jdbc / platform无法解析为对象。在此上下文中未绑定具有以下消息的查找文件:名称[java:jdbc / platform]。找不到[java:jdbc]。或者,当使用comp / env作为前缀时,会抱怨'comp'不可用。
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.
WSO2 Carbon支持这种配置吗?
Is this kind of configuration supported by WSO2 Carbon?
推荐答案
当前不支持此功能,请参见 https://wso2.org/jira/browse/CARBON-13908 。
Currently this is not supported see https://wso2.org/jira/browse/CARBON-13908.
这篇关于WSO2 AS JDNI查找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!