How to access resource via JNDI in RCPTT [message #1749992] |
Wed, 14 December 2016 18:13  |
Eclipse User |
|
|
|
Hi,
I have an already RAPiefed web application which works fine in Tomcat 7.
However, when using RCPTT (and RAP support plugin) I'm having a problem with accessing db resource over JNDI, specified in of the Spring context XMLs.
Searched the web, followed some articles and installed Jetty JNDI and Osgi.Boot (and relevant dependencies) in a hope that the JNDI configuration will be picked-up from the jetty.xml (I tried to use -Djetty.home because Boot activator can use this one for external jetty home).
I can see in the OSGi console that both JNDI and Boot bundles are active and the best I got is ClassNotFoundException: org.eclipse.jetty.jndi.InitialContextFactory.
Previously, it was complaining on missing java.naming.factory.initial, which I fixed by adding a system property.
The above error is usually a sign that a package is not exported, but I may be wrong.
Is there a way to work with JNDI resources and RCPTT?
Any help is highly appreciated.
Tnx,
|
|
|
|
Re: How to access resource via JNDI in RCPTT [message #1750182 is a reply to message #1750106] |
Fri, 16 December 2016 17:54  |
Eclipse User |
|
|
|
Hi Artem,
I resolved the problem by adding org.eclipse.jetty.jndi into Required-Bundle attribute of my bundle, requiring JNDI resource. However, that partially solved the problem because it complains that can't find the rest of the name e.g env/jndi/myDs. The main cause for this, is missing JNDI resource definition which is usually created in jetty.xml and/or jetty-env.xml.
But, I don't how to point Jetty server to look at the external Jetty home folder. I couldn't find any system property that could do the job.
On the other side, I found org.eclipse.jetty.osgi.boot bundle which reads "jetty.home" system property, but don't know if (and how) can be used instead org.eclipse.equinox.http.jetty.
So, to wrap-up the question: how to point RCPTT RAP plugin to external Jetty home so JNDI resources can work properly for my app?
Cheers,
|
|
|
Powered by
FUDForum. Page generated in 0.04014 seconds