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=<my.package> pointing to where my CustomURLStreamHander is present in catalina.sh 2. Added the required jar common/lib & other mentioned places
As you have said both didn't help as "java.protocol.handler.pkgs" setting is not working. http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/naming/resources/jndi/Handler.html I also did not find anything about this is Tomcat configuration files. Do let me know if you find some solution to the same. Thanks, Praveen M. MK-24 wrote: > > Hi everybody, > > 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 java.net.URL from a notes:// > URL-string. > > So, I read up on custom URL handlers and as far as I understand, you have > to > code a custom URLStreamHandler class and a custom URLConnection class. > Okay, no > big deal. However, there are three ways to register your new handler: > > 1) put it in the sun.net.www.protocol.yourprotocol package > 2) put it in a custom package and declare that package to the JRE using > the > java.protocol.handler.pkgs system property > 3) register a custom URLStreamHandlerFactory using > URL.setUrlStreamHandlerFactory > > 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? 3) doesn't work because Tomcat already registers its own > factory, and > for some reason I can't quite put my hands on you are not allowed to call > that > method twice per JVM instance. > > This issue is also discussed on Sun's Java issue tracker: > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4648098 > > The ticket has been opened six years ago and still no fix! > > Does Tomcat meanwhile have some workaround for this? I mean, I don't even > need > an actual URL connection, I just want to pass custom URL strings, which > should > be perfectly fine if they are valid URLs, no?! > > I hope you can help! > > Best, > Matt > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Custom-URL-handlers-in-Tomcat-web-app-tp15629476p16027888.html Sent from the Tomcat - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]