You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Shenghao Fang (JIRA)" <ji...@apache.org> on 2011/07/07 10:05:16 UTC
[jira] [Commented] (GERONIMO-5904) Reference bound in JNDI is not
dereferenced properly when lookup
[ https://issues.apache.org/jira/browse/GERONIMO-5904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13061119#comment-13061119 ]
Shenghao Fang commented on GERONIMO-5904:
-----------------------------------------
A patch for workaround this issue.
Create a ResourceReference to wrapper the Datasource.
> Reference bound in JNDI is not dereferenced properly when lookup
> ----------------------------------------------------------------
>
> Key: GERONIMO-5904
> URL: https://issues.apache.org/jira/browse/GERONIMO-5904
> Project: Geronimo
> Issue Type: Bug
> Security Level: public(Regular issues)
> Components: naming
> Affects Versions: 3.0
> Reporter: Shenghao Fang
> Assignee: Shenghao Fang
> Attachments: GERONIMO-5904.patch
>
>
> Get java.lang.ClassCastException: org.tranql.connector.jdbc.TranqlDataSource$SelfReference cannot be cast to javax.sql.DataSource on the following code snippet.
> {code}
> InitialContext ic = new InitialContext();
> activeDS = (DataSource)ic.lookup("jca:/org.apache.geronimo.plugins.monitoring/agent-ds/JCAConnectionManager/jdbc/ActiveDS");
> {code}
> An instance of org.tranql.connector.jdbc.TranqlDataSource is expected to be returned, but get an instance of org.tranql.connector.jdbc.TranqlDataSource$SelfReference.
> TranqlDataSource implements javax.naming.Referenceable, so an instance of javax.naming.Reference is bound on to JNDI, but it is expected to be dereferenced when lookup.
>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira