Liferay 7.3: JNDIContextManager Implementation as an OSGi ModuleLiferay 7.3: JNDIContextManager Implementation as an OSGi Modulehttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1208071102024-03-19T10:30:41Z2024-03-19T10:30:41ZRE: OSGI Module with external DependenciesGamini Muthukumaranahttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1208078282021-05-28T20:17:48Z2021-05-27T12:09:58Z<p>Hi,</p>
<p>When debugging i see that creating a context and resolving the
required bean in WildflyRootContext works as the
namingProviderFactories contains enties. These entries are somehow
disappear after the JBoss Server and Liferay is started. Hence i
tried to test the issue by instantiating the bean after the JBoss
Server started and Liferay is up. In this case i get following the
CNFE : </p>
<p>
<em>javax.naming.NamingException: WFLYNAM0027: Instantiierung von
InitialContextFactory
org.wildfly.naming.client.WildFlyInitialContextFactory vom
Klassenlader
org.eclipse.osgi.internal.loader.EquinoxClassLoader@69c96ce3[com.liferay.gogo.shell.web:4.0.14(id=695)]
fehlgeschlagen [Root exception is java.lang.ClassNotFoundException:
org.wildfly.naming.client.WildFlyInitialContextFactory cannot be
found by com.liferay.gogo.shell.web_4.0.14]</em></p>
<p>My module contains the jar in lib that
contains <em>org.wildfly.naming.client packages and</em> the
Bundle-ClassPath contains a reference to it.</p>
<p>I also exported all org.wildfly.naming.client packages and tried.
Still i get the same problem. </p>
<p>Has anyone any idea what i miss here? Thanks.</p>Gamini Muthukumarana2021-05-27T12:09:58ZLiferay 7.3: JNDIContextManager Implementation as an OSGi ModuleGamini Muthukumaranahttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1208071092021-06-02T15:04:09Z2021-05-25T16:34:54Z<p>Hi all,</p>
<p>we are in process of migrating a customer liferay 6.2 project into
Liferay 7.3. This Liferay Portal runs on JBoss EAP 7.3.5 Server and
contains few custom jars to fetch data from another JBoss Server over
Bean-calls (ejb).</p>
<p>OSGi Framework supports JNDI Calls within OSGi Container as it is
described in <a
href="https://docs.osgi.org/download/r6/osgi.cmpn-6.0.0.pdf">https://docs.osgi.org/download/r6/osgi.cmpn-6.0.0.pdf</a>.
All what is needed is an implementation of JNDIContextManager that
deliver an Context instance that enable JNDI calls.</p>
<p>
<em>
<strong>My question is; do we have a standard JNDIContextManager
implementation for Liferay 7.3? </strong></em></p>
<p>Secondly; i tried an OSGi Module by extracting code from an apache
example <a
href="http://www.apache.org/dyn/closer.cgi/aries/org.apache.aries.jndi-1.0.0.jar"
target="_blank"
title="http://www.apache.org/dyn/closer.cgi/aries/org.apache.aries.jndi-1.0.0.jar">http://www.apache.org/dyn/closer.cgi/aries/org.apache.aries.jndi-1.0.0.jar.</a>
and deployed in OSGi Container as a service. I can access this from my
consumer module whereas i get the exception:</p>
<p>
<em>class cs.jndi.context.manager.impl.CsJndiContextManagerImpl cannot
be cast to class org.osgi.service.jndi.JNDIContextManager
(cs.jndi.context.manager.impl.CsJndiContextManagerImpl is in unnamed
module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader
@14de92ba; org.osgi.service.jndi.JNDIContextManager is in unnamed
module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader
@66a1b9f5) </em></p>
<p>(cs.jndi.context.manager.impl.CsJndiContextManagerImpl is the
implementation and org.osgi.service.jndi.JNDIContextManager is the
interface from osgi.cmpn-6.0.0.jar.)</p>
<p>It would be great if someo