On 01/08/18 17:29, Thorsten Schöning wrote:
> Guten Tag Mark Thomas,
> am Mittwoch, 1. August 2018 um 17:34 schrieben Sie:
> 
>> Nor should it. foo.war!/META-INF/services is not a valid location for an
>> SPI file.
> [...]
>> The correct locations are:
>> foo.war!/WEB-INF/lib/*.jar!/META-INF/services
> 
> So your argument is that a WAR is not a JAR and only JARs can contain
> META-INF/services? Is there a reason for such decision, is it
> something Java demands?

Service files are loaded by class loaders from the META-INF/services
directory.

*.jar!/META-INF/services
and
*.war/WEB-INF/classes/META-INF/services
are visible to class loaders

*.war!/META-INF/services
is not.

The servlet expert group recently discussed WAR vs JAR in the context of
Java 9 and mutli-version JARs. The conclusion was (I'm paraphrasing)
that WARs are not a specialised form of JAR and while they share a
common format a feature that is available to a JAR is NOT automatically
available to a WAR unless the Servlet spec (of Java EE spec) explicitly
states otherwise.

Containers are free to add container specific extensions if they wish
but they come with the usual (lack of) interoperability warnings.

Mark

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

Reply via email to