tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
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:
> 
> https://github.com/Servoy/servoy-eclipse-tomcat/tree/master/org.apache.tomcat
> 
> 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
> 
> https://apache.googlesource.com/tomcat/+/defeda9492a54194ea56e4a8220069608a7aa8f0/java/org/apache/catalina/webresources/StandardRoot.java
> 
> 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
configured.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message