[
https://issues.apache.org/jira/browse/ARIES-1127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15857639#comment-15857639
]
Sergius Mohr commented on ARIES-1127:
-------------------------------------
My Workaround in embedded scenario with Apache Sling and Tomcat for accesing
JDBC-DataSource:
* don't use Aries JNDI bundles (and no other bundles like xbean-naming,
PAX-JDBC etc.)
* use (Tomcat) default JNDI ObjectFactory
(java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory,
java.naming.factory.url.pkgs=org.apache.naming)
* add package "org.apache.naming" to org.osgi.framework.system.packages (or
sling.system.packages in my case)
Now i can access my Tomcat-DataSource "java:/comp/env/jdbc/myDataSource" from
persistence.xml (or directly/manual from bundle).
> External JNDI Lookup and Object creation fails for embedded scenario
> --------------------------------------------------------------------
>
> Key: ARIES-1127
> URL: https://issues.apache.org/jira/browse/ARIES-1127
> Project: Aries
> Issue Type: Bug
> Components: JNDI
> Affects Versions: 0.3
> Reporter: Ajit Pendse
>
> In case of embedded scenario (e.g. in WAS CE container), no external lookups
> are successful as the object factory returned is always of type
> org.apache.aries.jndi.OSGiObjectFactoryBuilder. There is no way to override
> this currently and hence any object factories required by external JNDI
> lookups are ignored and object resolution, if required does not work.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)