georchestra / georchestra

This is the main geOrchestra Spatial Data Infrastructure repository, which hosts the source code.
http://www.georchestra.org/
GNU General Public License v3.0
129 stars 95 forks source link

geoserver + geonetwork - servlet-api-2.5.jar #870

Open fvanderbiest opened 9 years ago

fvanderbiest commented 9 years ago

According to http://stackoverflow.com/a/17745238 geoserver should not ship the servlet-api jar ...

In catalina.out:

INFO: validateJarFile(/var/lib/tomcat7/webapps/geoserver/WEB-INF/lib/servlet-api-2.5.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
fvanderbiest commented 9 years ago

Same is true for GeoNetwork:

geonetwork_1 | INFO: validateJarFile(/var/lib/tomcat6/webapps/geonetwork/WEB-INF/lib/servlet-api-2.5.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

pmauduit commented 9 years ago

(I hardly remember having commented a similar issue in the previous weeks)

We need to add the scope "provided" to the underlying pom.xml for the dependency servlet-api, as it is done for mapfishapp:

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.4</version>
      <scope>provided</scope>
    </dependency>

The main reason behind is that the servlet-api should be provided by the application server (tomcat), the webapp needs to know the classes at compile time, but the servlet-api.jar should not end up into the generated war.

fvanderbiest commented 9 years ago

Thanks Pierre.

fvanderbiest commented 9 years ago

Do you think we can do this in GS + GN for 15.06 ?

pmauduit commented 9 years ago

For GN it requires a little bit of investigation: There is no actual reason why we need jetty here: https://github.com/georchestra/geonetwork/blob/georchestra-15.06/pom.xml#L337 (I mean in the specific use of georchestra, it might be used for multinode-mode geonetwork, or embedded / all-in-one installer ...)

For GS, it does not seem to be the case anymore (as of 2.3.2-geor)