• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

setting URLStreamHandlerFactory from webapp in Tomcat

 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We want to set an URLStreamHandlerFactory from our web application running in Tomcat. Well, in fact we just want to support an additional protocol, and this seems to be the only way to do that.

Problem is that the factory is only allowed to be set once per JVM via URL.setURLStreamHandlerFactory, and Tomcat seems to already set one. We have no idea what to do - our hope is that Tomcat might provide a workaround for that limitation, but didn't find anything googling. (What did the Sun developers think when they designed it that way??? )
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it really necessary to change the factory - wouldn't registering the protocol handler class be sufficient?
[ April 24, 2007: Message edited by: Ulf Dittmer ]
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ulf Dittmer:
Is it really necessary to change the factory - wouldn't registering the protocol handler class be sufficient?



It probably will. Thanks for the pointer!
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It probably *would* work, if our protocol wouldn't be called "class", which is not a valid java identifier and therefore cannot be used as part of a package name.

We will now try to do it via a dirty reflection hack...
 
reply
    Bookmark Topic Watch Topic
  • New Topic