Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-2228

RegisterBuiltin fails to initialize when Servlet API not on the classpath

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 4.0.0.Final
    • 4.0.0.CR2
    • None
    • None

    Description

      When org.jboss.resteasy.plugins.providers.RegisterBuiltin is initialized when there is no Servlet API on the classpath, it results in a NoClassDefFoundError:

      java.lang.NoClassDefFoundError: javax/servlet/ServletConfig
      
      	at org.jboss.resteasy.microprofile.config.ServletConfigSource.getValue(ServletConfigSource.java:38)
      	at io.smallrye.config.SmallRyeConfig.getOptionalValue(SmallRyeConfig.java:95)
      	at org.jboss.resteasy.plugins.providers.RegisterBuiltin$5.run(RegisterBuiltin.java:194)
      	at org.jboss.resteasy.plugins.providers.RegisterBuiltin$5.run(RegisterBuiltin.java:191)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at org.jboss.resteasy.plugins.providers.RegisterBuiltin.isGZipEnabled(RegisterBuiltin.java:191)
      	at org.jboss.resteasy.plugins.providers.RegisterBuiltin.<clinit>(RegisterBuiltin.java:40)
      

      As https://github.com/resteasy/Resteasy/blob/master/resteasy-core/src/main/java/org/jboss/resteasy/microprofile/config/ServletConfigSource.java#L38 attempts to use the ServletConfig class, which isn't on the classpath, I get the error.

      Attachments

        Activity

          People

            rhn-support-asoldano Alessio Soldano
            kfinniga@redhat.com Ken Finnigan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: