[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jetty-dev] How to access jndi out of webapp?
|
Hi Andy,
I understand you are using the jetty-osgi integration, you use jetty
to declare the jndi object and in an OSGi bundle that is not related
to a web-application you are looking for the same object in jndi.
We have not tested this particular situation yet.
Let's chat and come up with a test-case so we can reproduce the issue
and fix it.
Best,
Hugues
On Fri, Jan 15, 2010 at 8:12 PM, Michael Zhu <zhu@xxxxxxxxxxx> wrote:
> Hi, all,
> I am working on BPMS integration stuff with jetty server, now I get one
> problem to access jndi. The problem is we want to access the jndi out of
> webapp.
>
> More details for the case:
> 1): Define the naming resource in jetty.xml with jvm scope or server
> scope.
> 2): Access the jndi with below simple code
> --------------------------------------------------------
> System.getProperties().setProperty("java.naming.factory.url.pkgs",
> "org.eclipse.jetty.jndi");
> System.getProperties().setProperty("java.naming.factory.initial",
> "org.eclipse.jetty.jndi.InitialContextFactory");
>
> InitialContext ic = new InitialContext();
> Object object = ic.lookup(jndiName); // the jndiName is already
> defined in jetty.xml
> --------------------------------------------------------
> The above code will be ok if in one webapp(web context configured), but
> it will be failed if not within one webapp.
>
> Is it any way to access the jndi out of the webapp?
>
> Lots of thanks if anyone can help!
>
> Regards,
> Andy
> _______________________________________________
> jetty-dev mailing list
> jetty-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>
>