Jenkins fails to start if libservlet2.5-java are installed on the system

Bug #827651 reported by Xerxes Rånby
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
jcaptcha (Ubuntu)
Fix Released
Medium
James Page
jenkins-winstone (Ubuntu)
Fix Released
Medium
James Page

Bug Description

Jenkins fails to start when both libservlet2.5 and libservlet2.4 are installed.
Jenkins itself only depend on the 2.4 version.

The presence of libservlet2.5 causes the following error:
Running from: /usr/share/jenkins/jenkins.war
[Winstone 2011/08/16 20:27:41] - Beginning extraction from war file
[Winstone 2011/08/16 20:27:41] - XML Error (Line 67): schema_reference.4: Failed to read schema document 'jar:file:/usr/share/java/servlet-api-2.5.jar!/javax/servlet/resources/javaee_5.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
[Winstone 2011/08/16 20:27:41] - XML Error (Line 68): schema_reference.4: Failed to read schema document 'jar:file:/usr/share/java/servlet-api-2.5.jar!/javax/servlet/resources/jsp_2_1.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
[Winstone 2011/08/16 20:27:42] - XML Error (Line 82): schema_reference.4: Failed to read schema document 'jar:file:/usr/share/java/servlet-api-2.5.jar!/javax/servlet/resources/jsp_2_0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
[Winstone 2011/08/16 20:27:43] - XML Error (Line 26): Document is invalid: no grammar found.
[Winstone 2011/08/16 20:27:43] - XML Error (Line 26): Document root element "web-app", must match DOCTYPE root "null".
[Winstone 2011/08/16 20:27:44] - Container startup failed
java.lang.ClassCastException: hudson.util.CharacterEncodingFilter cannot be cast to javax.servlet.Filter
    at winstone.FilterConfiguration.getFilter(FilterConfiguration.java:128)
    at winstone.WebAppConfiguration.<init>(WebAppConfiguration.java:915)
    at winstone.HostConfiguration.initWebApp(HostConfiguration.java:131)
    at winstone.HostConfiguration.<init>(HostConfiguration.java:73)
    at winstone.HostGroup.initHost(HostGroup.java:85)
    at winstone.HostGroup.<init>(HostGroup.java:45)
    at winstone.Launcher.<init>(Launcher.java:196)
    at winstone.Launcher.main(Launcher.java:391)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at Main._main(Main.java:248)
    at Main.main(Main.java:95)

A simple remove of the offending 2.5 package made jenkins happy again.
sudo apt-get remove libservlet2.5-java
/etc/init.d/jenkins restart

Related branches

Revision history for this message
James Page (james-page) wrote :

Confirmed - easily to reproduce

jenkins-winstone bundled xsd and dtd for various specifications but they where older versions with non-free copyright statements so where removed from the upstream tarball and the package is built against servlet and jsp jar files already in the archive containing these resources.

However the jsp jar file is missing from the Classpath manifest entry; it may be that having these external to the winstone.jar file does not work that well either.

I'll take a look and see which is the best way forward on this as it would be possible to patch in the CDDL/GPL distributed versions of these files if required.

Changed in jenkins-winstone (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → James Page (james-page)
status: Confirmed → In Progress
Revision history for this message
James Page (james-page) wrote :

Fixing the issue with resource revealed a further problem in that jcaptcha also has a MANIFEST Class-Path entry for servlet-api - as this should be 'provided' it should not load the jar so I'll update to remove.

Changed in jcaptcha (Ubuntu):
importance: Undecided → Medium
status: New → In Progress
assignee: nobody → James Page (james-page)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package jcaptcha - 2.0~alpha1-1ubuntu1

---------------
jcaptcha (2.0~alpha1-1ubuntu1) oneiric; urgency=low

  * debian/libjcaptcha-java.classpath: removed servlet-api-2.5.jar from
    classpath as this should always be provided (LP: #827651).
 -- James Page <email address hidden> Thu, 18 Aug 2011 10:55:44 +0100

Changed in jcaptcha (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package jenkins-winstone - 0.9.10-jenkins-25+dfsg-0ubuntu2

---------------
jenkins-winstone (0.9.10-jenkins-25+dfsg-0ubuntu2) oneiric; urgency=low

  * Support offline validation of XML configuration files (LP: #827651):
    - debian/patches/specification-resources.patch: CDDL/GPL-2 licensed
      xsd+DTD resources for all servlet, jsp and j2ee specifications.
    - debian/copyright: documented copyright + license for
      specification-resources.patch.
    - debian/control: Removed dependency on libservlet2.5-java, no longer
      required.
    - debian/patches/series,debian/patches/use_system_servletapi.patch:
      Dropped patch as no longer required.
    - debian/libjenkins-winstone-java.classpath: Dropped as all required
      resources are now included in winstone.
 -- James Page <email address hidden> Thu, 18 Aug 2011 09:55:33 +0100

Changed in jenkins-winstone (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.