Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-12536

camel-google-mail: adding the camel component to a spring boot project leads to java.lang.NoSuchMethodError: javax.servlet.ServletContext.getClassLoader()Ljava/lang/ClassLoader;

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.21.1, 2.22.0
    • Fix Version/s: 2.20.4, 2.21.2, 2.22.0
    • Component/s: None
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      I've created a very simple spring boot (1.x) which includes camel-google-mail as dependency and when running the application, the following exception is thrown:

      java.lang.reflect.InvocationTargetException
          at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:498)
          at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run (AbstractRunMojo.java:527)
          at java.lang.Thread.run (Thread.java:748)
      Caused by: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.NoSuchMethodError: javax.servlet.ServletContext.getClassLoader()Ljava/lang/ClassLoader;
          at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh (EmbeddedWebApplicationContext.java:137)
          at org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:537)
          at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh (EmbeddedWebApplicationContext.java:122)
          at org.springframework.boot.SpringApplication.refresh (SpringApplication.java:693)
          at org.springframework.boot.SpringApplication.refreshContext (SpringApplication.java:360)
          at org.springframework.boot.SpringApplication.run (SpringApplication.java:303)
          at org.springframework.boot.SpringApplication.run (SpringApplication.java:1118)
          at org.springframework.boot.SpringApplication.run (SpringApplication.java:1107)
          at test.Application.main (Application.java:9)
          at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:498)
          at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run (AbstractRunMojo.java:527)
          at java.lang.Thread.run (Thread.java:748)
      Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getClassLoader()Ljava/lang/ClassLoader;
          at io.undertow.websockets.jsr.Bootstrap.handleDeployment (Bootstrap.java:92)
          at io.undertow.servlet.core.DeploymentManagerImpl.handleExtensions (DeploymentManagerImpl.java:263)
          at io.undertow.servlet.core.DeploymentManagerImpl.deploy (DeploymentManagerImpl.java:153)
          at org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory.createDeploymentManager (UndertowEmbeddedServletContainerFactory.java:412)
          at org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory.getEmbeddedServletContainer (UndertowEmbeddedServletContainerFactory.java:234)
          at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer (EmbeddedWebApplicationContext.java:164)
          at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh (EmbeddedWebApplicationContext.java:134)
          at org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:537)
          at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh (EmbeddedWebApplicationContext.java:122)
          at org.springframework.boot.SpringApplication.refresh (SpringApplication.java:693)
          at org.springframework.boot.SpringApplication.refreshContext (SpringApplication.java:360)
          at org.springframework.boot.SpringApplication.run (SpringApplication.java:303)
          at org.springframework.boot.SpringApplication.run (SpringApplication.java:1118)
          at org.springframework.boot.SpringApplication.run (SpringApplication.java:1107)
          at test.Application.main (Application.java:9)
          at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:498)
          at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run (AbstractRunMojo.java:527)
          at java.lang.Thread.run (Thread.java:748)
      
      

      Sample project included in the attached reproducer

        Attachments

        1. project.tgz
          1 kB
          Luca Burgazzoli

          Activity

            People

            • Assignee:
              acosentino Andrea Cosentino
              Reporter:
              lb Luca Burgazzoli
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: