Hi

>> how can that be modified to load the jndi.properties file?
>
> The javadoc for InitialContext seems to indicate that this file will be
> processed automatically.
>
> If it isn't processed automatically, I'd suggest trying to figure out
> why.


>>Good to know, thank you.

>>Amazingly, this is the only Java example code I've ever seen which,
>>potentially, enables remote JNDI lookup for JMSContext.

Thanks all for responses. But what I actually want is to register a
URLStreamHandlerService for JNDI
In tomcat 7
I have used DirContextURLStreamHandler for that as follows

Properties properties = new Properties();
properties.put(URLConstants.URL_HANDLER_PROTOCOL, "jndi");
final URLStreamHandler handler = new DirContextURLStreamHandler();

bundleContext.registerService(URLStreamHandlerService.class.getName(),
        new AbstractURLStreamHandlerService() {
                private final static String EMPTY_STRING = "";
                public URLConnection openConnection(URL u) throws IOException {
                        return new URL(u, EMPTY_STRING, 
handler).openConnection();
                }
        }, properties);


But since with Tomcat 8 DirContextURLStreamHandler have been removed.

So how can I achieve the same thing in Tomcat 8?


Thanks

Best Regards

/Thusitha


On Tue, Mar 10, 2015 at 4:02 AM, Thufir <hawat.thu...@gmail.com> wrote:

> On Mon, 09 Mar 2015 14:11:08 -0400, Christopher Schultz wrote:
>
> >> how can that be modified to load the jndi.properties file?
> >
> > The javadoc for InitialContext seems to indicate that this file will be
> > processed automatically.
> >
> > If it isn't processed automatically, I'd suggest trying to figure out
> > why.
>
>
> Good to know, thank you.
>
> Amazingly, this is the only Java example code I've ever seen which,
> potentially, enables remote JNDI lookup for JMSContext.
>
>
>
> -Thufir
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 
Thusitha Dayaratne
Software Engineer
WSO2 Inc. - lean . enterprise . middleware |  wso2.com

Mobile  +94712756809
Blog      alokayasoya.blogspot.com
About    http://about.me/thusithathilina

Reply via email to