Re: Custom URL handlers in Tomcat web app

2009-12-04 Thread eugeny-a.smirnov
Hi I've resolved this issue in this way: URLStreamHandlerFactoryImpl.termspecProtocolHandler = handlerClass; try { for (final Field field : URL.class.getDeclaredFields()) { if ("factory".equalsIgnoreCase(field.getName()) ) { field.setAcce

Re: Custom URL handlers in Tomcat web app

2008-03-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 MK, MK wrote: | Plus, one could place a link to it from the ticket on the Java issue tracker, so | that people coming from there have a solution at hand. I simply don't see this | getting fixed anytime soon. Another good idea. I would be glad to su

Re: Custom URL handlers in Tomcat web app

2008-03-18 Thread MK
Christopher Schultz christopherschultz.net> writes: > Praveen, > > pmanvi wrote: > | I found that org.apache.catalina.loader.WebappLoader was setting the > | URL.setURLStreamHandlerFactory() with DirContextURLStreamHandlerFactory, > | basically jndi stream handler. > | I updated this file rebuil

Re: Custom URL handlers in Tomcat web app

2008-03-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Praveen, pmanvi wrote: | I found that org.apache.catalina.loader.WebappLoader was setting the | URL.setURLStreamHandlerFactory() with DirContextURLStreamHandlerFactory, | basically jndi stream handler. | I updated this file rebuild the class & placed

Re: Custom URL handlers in Tomcat web app

2008-03-18 Thread pmanvi
Hi Matt, Since I was working with legacy code, I don;t wanted to any code. I found that org.apache.catalina.loader.WebappLoader was setting the URL.setURLStreamHandlerFactory() with DirContextURLStreamHandlerFactory, basically jndi stream handler. I updated this file rebuild the class & placed

Re: Custom URL handlers in Tomcat web app

2008-03-18 Thread MK
Hi Praveen, pmanvi gmail.com> writes: > ... > > Do let me know if you find some solution to the same. actually, in the end I got it working using Christoph's suggestion to use the URL(scheme, host, port, path, handler) constructor. Unless that legacy system you're using unwraps and reconstruct

Re: Custom URL handlers in Tomcat web app

2008-03-13 Thread pmanvi
Hi Matt, I am trying to port legacy JRun application to Tomcat & facing same problem. I also tried out the listed options but without any luck. Do let me know if you are able to crack. Since I have legacy application, I do not want to introduce any new code to make it work. Thanks, Praveen M.

Re: Custom URL handlers in Tomcat web app

2008-03-13 Thread pmanvi
Hi Matt, Today I was trying to port one legacy application from JRun to Tomcat & facing same problem with URL. URL.setURLStreamHandlerFactory.java.lang.Error: factory already defined 1. I tried out setting -Djava.protocol.handler.pkgs= pointing to where my CustomURLStreamHander is present in cat

Re: Custom URL handlers in Tomcat web app

2008-02-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Matthias, MK wrote: | actually I just realized that this is not gonna help if Tomcat does not honor | the java.protocol.handler.pkgs setting, because even if Tomcat can load the JAR | and knows where to look for it, it would still need to read this s

Re: Custom URL handlers in Tomcat web app

2008-02-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Matthias, MK wrote: | Christopher Schultz christopherschultz.net> writes: |> |> As I'm reading more in the API, I can see that the URL class has a |> constructor that takes a URLStreamHandler. Could you utilize this |> constructor instead? | | that'

Re: Custom URL handlers in Tomcat web app

2008-02-25 Thread MK
MK nts.ricoh.co.jp> writes: > [...] > I am using Tomcat 5.5 by the way. > > I will try rolling a jar from my protocol handler and put it in the places you > suggested. Maybe that'll work, I'll report back. actually I just realized that this is not gonna help if Tomcat does not honor the java.pro

Re: Custom URL handlers in Tomcat web app

2008-02-25 Thread MK
Christopher, thanks a lot for your replies. Christopher Schultz christopherschultz.net> writes: > MK wrote: > | Actually I don't even call URL.openConnection, because I don't need it > at all. > | It's really just that the java.net.URL constructor requires that there > exists an > | object which

Re: Custom URL handlers in Tomcat web app

2008-02-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Matthias, MK wrote: | Actually I don't even call URL.openConnection, because I don't need it at all. | It's really just that the java.net.URL constructor requires that there exists an | object which implements this behavior just in case someone shoul

Re: Custom URL handlers in Tomcat web app

2008-02-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Matthias, Christopher Schultz wrote: | From the bug you mentioned in your original post, it looks like | putting it into your webapp just isn't going to work. Instead, you'll | have to install it into a ClassLoader that is higher-up in the chain. | A

Re: Custom URL handlers in Tomcat web app

2008-02-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Matthias, MK wrote: | Christopher Schultz christopherschultz.net> writes: |> |> How did you set the [Java] property? | | I am running my web app inside an Eclipse WTP server container project. So I set | the property as a JVM argument in the Server

Re: Custom URL handlers in Tomcat web app

2008-02-24 Thread MK
Christopher Schultz christopherschultz.net> writes: > > [...] > | problem is, none of these approaches work in Tomcat 5.5. For 1), this > simply > | didn't have any effect for me. 2) neither, maybe Tomcat simply ignores > that > | property? > > How did you set the property? I am running my web

Re: Custom URL handlers in Tomcat web app

2008-02-22 Thread Bill Barker
"Christopher Schultz" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > MK, > > MK wrote: > | I have the following problem: > | My Web application needs to handle Lotus Notes URLs which use the scheme > | "notes". However, since Java

Re: Custom URL handlers in Tomcat web app

2008-02-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 MK, MK wrote: | I have the following problem: | My Web application needs to handle Lotus Notes URLs which use the scheme | "notes". However, since Java does not know this protocol by default, it throws a | MalformedUrlException when I construct a jav