[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tomcat-user
Subject:    Re: What is the correct place to specifiy SPI service files for Java?
From:       Mark Thomas <markt () apache ! org>
Date:       2018-07-31 17:30:04
Message-ID: ee78c434-3c2a-3dbd-1d29-8957316f01c4 () apache ! org
[Download RAW message or body]

On 31/07/18 17:06, Thorsten Schöning wrote:
> Hi all,
> 
> I would like to get some attention on some older SO-question[1] about
> where to place SPI-service files of Java.
> 
> Following the docs, those should be placed in META-INF at the top
> level of some JAR and webapps designed to be used with Tomcat provide
> such a folder.

Correct. With the caveat that if the web application defines an
<absolute-ordering> in web.xml, only those JARs are searched.

See
https://github.com/apache/tomcat/blob/trunk/java/org/apache/catalina/startup/WebappServiceLoader.java
 for details.

Mark


> But it seems to be ignored during search for
> SPI-service files, instead those seem to be assumed in
> WEB-INF/classes/META-INF/services. The can easily be seen e.g. using
> Process Monitor in Windows.
> 
> As the SO-question lacks some official Tomcat-documentation or such, I
> am asking here: What is the correct place for such service files? Can
> this be configured somehow? Why is META-INF at the top level ignored?
> Is it used at all for anything or only WEB-INF/classes/META-INF for
> anything which is normally assumed to be in META-INF itself?
> 
> Thanks!
> 
> [1]: https://stackoverflow.com/questions/7692497/tomcat-wont-load-my-meta-inf-services-javax-servlet-servletcontainerinitializ
>  
> Mit freundlichen Grüßen,
> 
> Thorsten Schöning
> 


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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic