It could be interesting to check if installing the CXF feature doesn't install a new JNDI ContextFactory that cross the jndi feature one.

I will check as soon as I have some time.

Regards
JB

On 2015-05-27 22:46, Christian Schneider wrote:
Can you post your code somewhere? I would be especially interested in
how you define the DataSource.

In the mean time you can have a look at some of my examples:
This is about JPA and DataSources:
http://liquid-reality.de/display/liquid/2015/03/05/Apache+Karaf+Tutorial+Part+9+-+Annotation+based+blueprint+and+JPA
[2]

and this about CXF:
http://liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi
[3]

I don´t have a tutorial for both at the same time but used in in
production systems several times. So it should be no problem.

Christian

2015-05-18 15:29 GMT+02:00 ellirael <[email protected]>:

After installing CXF feature I met some problem with datasource
recognition
from bundle that uses JPA and registers servet.

javax.naming.NoInitialContextException: Unable to find the
InitialContextFactory org.eclipse.jetty.jndi.InitialContextFactory.
        at

org.apache.aries.jndi.ContextHelper.getInitialContext(ContextHelper.java:148)
        at

org.apache.aries.jndi.OSGiInitialContextFactoryBuilder.getInitialContext(OSGiInitialContextFactoryBuilder.java:49)
        at

javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
        at

javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
        at
javax.naming.InitialContext.init(InitialContext.java:242)
        at
javax.naming.InitialContext.<init>(InitialContext.java:216)
        at

org.apache.aries.jpa.container.unit.impl.JndiDataSource.getDs(JndiDataSource.java:64)
        at

org.apache.aries.jpa.container.unit.impl.DelayedLookupDataSource.getConnection(DelayedLookupDataSource.java:36)
        at

org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:110)
        at

org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
        at

org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:91)
        at

org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:603)

The same DataSource works nice when I inject dao service that uses
the same
datasource in my command bundle. After command invocation servlets
starts to
work properly.

The problem seems to occur for JPA bundles only. There is some sort
of
InitialContextFactory replacement.

--
View this message in context:

http://karaf.922171.n3.nabble.com/Problem-with-JPA-JNDI-after-installing-CXF-feature-tp4040429.html
[1]
Sent from the Karaf - User mailing list archive at Nabble.com.

--

--
 Christian Schneider
 http://www.liquid-reality.de [4]

 Open Source Architect
 http://www.talend.com [5]

Links:
------
[1]
http://karaf.922171.n3.nabble.com/Problem-with-JPA-JNDI-after-installing-CXF-feature-tp4040429.html
[2]
http://liquid-reality.de/display/liquid/2015/03/05/Apache+Karaf+Tutorial+Part+9+-+Annotation+based+blueprint+and+JPA
[3]
http://liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi
[4]
https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&amp;URL=http%3a%2f%2fwww.liquid-reality.de
[5]
https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&amp;URL=http%3a%2f%2fwww.talend.com

Reply via email to