I am trying to deploy one of spring boot project and using Apache Webserver (Centos 7). While deploying my project there I am getting below long list of exception. It is running fine on my local machine but when I shifted code to production then getting below exception. I don’t know where is the issue. Please suggest some solution to this.

2022-05-16 03:35:27.169  INFO 14092 --- [ost-startStop-1] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
    2022-05-16 03:35:28.067  WARN 14092 --- [ost-startStop-1] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apiController': Unsatisfied dependency expressed through field 'stripeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stripeService': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [wing.rakhi.ecdl.service.StripeService] from ClassLoader [ParallelWebappClassLoader
      context: ecdl
      delegate: false
    ----------> Parent Classloader:
    java.net.URLClassLoader@65b54208
    ]
    2022-05-16 03:35:28.068  INFO 14092 --- [ost-startStop-1] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
    2022-05-16 03:35:28.072  INFO 14092 --- [ost-startStop-1] com.zaxxer.hikari.HikariDataSource       : HikariPool-3 - Shutdown initiated...
    2022-05-16 03:35:28.078  INFO 14092 --- [ost-startStop-1] com.zaxxer.hikari.HikariDataSource       : HikariPool-3 - Shutdown completed.
    2022-05-16 03:35:28.098  INFO 14092 --- [ost-startStop-1] ConditionEvaluationReportLoggingListener :
    
    Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
    2022-05-16 03:35:28.106 ERROR 14092 --- [ost-startStop-1] o.s.boot.SpringApplication               : Application run failed
    
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apiController': Unsatisfied dependency expressed through field 'stripeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stripeService': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [wing.rakhi.ecdl.service.StripeService] from ClassLoader [ParallelWebappClassLoader
      context: ecdl
      delegate: false
    ----------> Parent Classloader:
    java.net.URLClassLoader@65b54208
    ]
            at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:596) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:374) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1411) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:845) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.1.7.RELEASE.jar:2.1.7.RELEASE]
            at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:743) ~[spring-boot-2.1.7.RELEASE.jar:2.1.7.RELEASE]
            at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:390) ~[spring-boot-2.1.7.RELEASE.jar:2.1.7.RELEASE]
            at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) ~[spring-boot-2.1.7.RELEASE.jar:2.1.7.RELEASE]
            at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:151) [spring-boot-2.1.7.RELEASE.jar:2.1.7.RELEASE]
            at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:131) [spring-boot-2.1.7.RELEASE.jar:2.1.7.RELEASE]
            at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:91) [spring-boot-2.1.7.RELEASE.jar:2.1.7.RELEASE]
            at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:171) [spring-web-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5225) [catalina.jar:8.5.40]
            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:8.5.40]
            at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754) [catalina.jar:8.5.40]
            at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730) [catalina.jar:8.5.40]
            at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) [catalina.jar:8.5.40]
            at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1135) [catalina.jar:8.5.40]
            at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1869) [catalina.jar:8.5.40]
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_272]
            at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_272]
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_272]
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_272]
            at java.lang.Thread.run(Thread.java:748) [na:1.8.0_272]
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stripeService': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [wing.rakhi.ecdl.service.StripeService] from ClassLoader [ParallelWebappClassLoader
      context: ecdl
      delegate: false
    ----------> Parent Classloader:
    java.net.URLClassLoader@65b54208
    ]
            at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:265) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1269) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1184) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1251) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1171) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:593) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            ... 32 common frames omitted
    Caused by: java.lang.IllegalStateException: Failed to introspect Class [wing.rakhi.ecdl.service.StripeService] from ClassLoader [ParallelWebappClassLoader
      context: ecdl
      delegate: false
    ----------> Parent Classloader:
    java.net.URLClassLoader@65b54208
    ]
            at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:507) ~[spring-core-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:404) ~[spring-core-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:389) ~[spring-core-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:248) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            ... 44 common frames omitted
    Caused by: java.lang.NoClassDefFoundError: com/stripe/model/PaymentIntent
            at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_272]
            at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[na:1.8.0_272]
            at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[na:1.8.0_272]
            at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:489) ~[spring-core-5.1.9.RELEASE.jar:5.1.9.RELEASE]
            ... 47 common frames omitted
    Caused by: java.lang.ClassNotFoundException: com.stripe.model.PaymentIntent
            at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1364) ~[catalina.jar:8.5.40]
            at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1185) ~[catalina.jar:8.5.40]
            ... 51 common frames omitted
    
    16-May-2022 03:35:28.107 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
     org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ecdl]]
            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
            at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
            at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
            at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
            at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1135)
            at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1869)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
            at java.lang.Thread.run(Thread.java:748)
    Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apiController': Unsatisfied dependency expressed through field 'stripeService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stripeService': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [wing.rakhi.ecdl.service.StripeService] from ClassLoader [ParallelWebappClassLoader
      context: ecdl
      delegate: false
    ----------> Parent Classloader:
    java.net.URLClassLoader@65b54208
    ]
            at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:596)
            at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
            at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:374)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1411)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
            at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
            at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:845)
            at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
            at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
            at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:743)
            at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:390)
            at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
            at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:151)
            at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:131)
            at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:91)
            at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:171)
            at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5225)
            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
            ... 10 more
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stripeService': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [wing.rakhi.ecdl.service.StripeService] from ClassLoader [ParallelWebappClassLoader
      context: ecdl
      delegate: false
    ----------> Parent Classloader:
    java.net.URLClassLoader@65b54208
    ]
            at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:265)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1269)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1184)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
            at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
            at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277)
            at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1251)
            at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1171)
            at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:593)
            ... 32 more
    Caused by: java.lang.IllegalStateException: Failed to introspect Class [wing.rakhi.ecdl.service.StripeService] from ClassLoader [ParallelWebappClassLoader
      context: ecdl
      delegate: false
    ----------> Parent Classloader:
    java.net.URLClassLoader@65b54208
    ]
            at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:507)
            at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:404)
            at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:389)
            at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:248)
            ... 44 more
    Caused by: java.lang.NoClassDefFoundError: com/stripe/model/PaymentIntent
            at java.lang.Class.getDeclaredMethods0(Native Method)
            at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
            at java.lang.Class.getDeclaredMethods(Class.java:1975)
            at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:489)
            ... 47 more
    Caused by: java.lang.ClassNotFoundException: com.stripe.model.PaymentIntent
            at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1364)
            at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1185)
            ... 51 more

The log clearly shows the problem:

java.lang.ClassNotFoundException: com.stripe.model.PaymentIntent

You’re missing a dependency, probably this one: com.stripe:stripe-java.

You need to make sure its jar is present in your war‘s WEB-INF/lib or in Tomcat’s lib directory.

1