• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setting URLStreamHandlerFactory from webapp in Tomcat

 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • 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??? )
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • 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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic