tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <>
Subject Re: tomcat 8 depends on URL.setURLStreamHandlerFactory method
Date Wed, 01 Oct 2014 18:44:26 GMT
On 01/10/2014 16:59, Johan Compagner wrote:
> Hi,
> we have tomcat completely as an OSGI plugin project:
> so that we can start it from our eclipse application and also dynamically
> add servlets and filters from all kinds of plugins (so everything is osgi
> based)
> Our app uses websockets quite heavily so  i thought lets update now to the
> latest 8 that has a lot of improvements in this area.
> Problem is that in StandardRoot
> there is a line:
> TomcatURLStreamHandlerFactory.register();
> in the internalInit
> this tries to call URL.setURLStreamHandlerFactory(this);
> in the constructor of that TomcatURLStreamHandlerFactory class
> but this is in eclipse or i guess in an osgi environment not really possible
> because that is already set so now it bombs out with "factory al ready set"
> error
> Is there any workaround for this or is there any way to improve tomcat 8 so
> that it places nicer inside an osgi container like eclipse?

You need to call the static disable() method before you start Tomcat.
That will stop Tomcat trying to register the factory.

If you want to be able to use WAR URLs (necessary to support web
applications that are packaged as WARs and *not* unpacked) then you'll
need to register the WarURLStreamHandler with whatever factory you have


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message