NoClassDefFoundError: DefaultLifecycleProcessor$1 when undeplying spring-messaging application - spring

I have a Spring application running on Tomcat 7. After adding WebSockets I started to see the following errors in the logs during undeployment.
Other then the logs and increased time of undeployment (it waits for a timeout), it all works fine.
There is nothing fancy in the added WebSockets code. Just a single #Controller, one subclass of AbstractWebSocketMessageBrokerConfigurer and one subclass of AbstractSecurityWebSocketMessageBrokerConfigurer.
What's the matter? I don't think I'm missing any jars.. I could see org.springframework.context.support.DefaultLifecycleProcessor class in the jar spring-context-4.2.2-RELEASE which I have in my WEB-INF/lib. The anoymous class DefaultLifecycleProcessor$1 is there too.
14 Mar 2016 23:25:34,508 INFO [context.support.DefaultLifecycleProcessor] Stopping beans in phase 2147483647
14 Mar 2016 23:25:34,508 DEBUG [context.support.DefaultLifecycleProcessor] Asking bean 'stompWebSocketHandlerMapping' of type [class org.springframework.web.socket.server.support.WebSocketHandlerMapping] to stop
14 Mar 2016 23:25:34,508 WARN [context.support.DefaultLifecycleProcessor] Failed to stop bean 'stompWebSocketHandlerMapping'
java.lang.NoClassDefFoundError: org/springframework/context/support/DefaultLifecycleProcessor$1
at org.springframework.context.support.DefaultLifecycleProcessor.doStop(DefaultLifecycleProcessor.java:229)
at org.springframework.context.support.DefaultLifecycleProcessor.access$300(DefaultLifecycleProcessor.java:51)
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.stop(DefaultLifecycleProcessor.java:363)
at org.springframework.context.support.DefaultLifecycleProcessor.stopBeans(DefaultLifecycleProcessor.java:202)
at org.springframework.context.support.DefaultLifecycleProcessor.onClose(DefaultLifecycleProcessor.java:118)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:969)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:928)
at org.springframework.web.servlet.FrameworkServlet.destroy(FrameworkServlet.java:828)
at org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:1481)
at org.apache.catalina.core.StandardWrapper.stopInternal(StandardWrapper.java:1842)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5647)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1028)
at org.apache.catalina.startup.HostConfig.undeploy(HostConfig.java:1478)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1406)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1626)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:328)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1374)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.springframework.context.support.DefaultLifecycleProcessor$1
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1718)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
... 25 more
14 Mar 2016 23:25:34,509 DEBUG [context.support.DefaultLifecycleProcessor] Asking bean 'subProtocolWebSocketHandler' of type [class org.springframework.web.socket.messaging.SubProtocolWebSocketHandler] to stop
14 Mar 2016 23:25:34,509 WARN [context.support.DefaultLifecycleProcessor] Failed to stop bean 'subProtocolWebSocketHandler'
java.lang.NoClassDefFoundError: org/springframework/context/support/DefaultLifecycleProcessor$1
at org.springframework.context.support.DefaultLifecycleProcessor.doStop(DefaultLifecycleProcessor.java:229)
at org.springframework.context.support.DefaultLifecycleProcessor.access$300(DefaultLifecycleProcessor.java:51)
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.stop(DefaultLifecycleProcessor.java:363)
at org.springframework.context.support.DefaultLifecycleProcessor.stopBeans(DefaultLifecycleProcessor.java:202)
at org.springframework.context.support.DefaultLifecycleProcessor.onClose(DefaultLifecycleProcessor.java:118)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:969)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:928)
at org.springframework.web.servlet.FrameworkServlet.destroy(FrameworkServlet.java:828)
at org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:1481)
at org.apache.catalina.core.StandardWrapper.stopInternal(StandardWrapper.java:1842)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5647)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1028)
at org.apache.catalina.startup.HostConfig.undeploy(HostConfig.java:1478)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1406)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1626)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:328)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1374)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519)
at java.lang.Thread.run(Thread.java:745)
14 Mar 2016 23:25:34,509 DEBUG [context.support.DefaultLifecycleProcessor] Asking bean 'simpAnnotationMethodMessageHandler' of type [class org.springframework.web.socket.messaging.WebSocketAnnotationMethodMessageHandler] to stop
14 Mar 2016 23:25:34,509 WARN [context.support.DefaultLifecycleProcessor] Failed to stop bean 'simpAnnotationMethodMessageHandler'
java.lang.NoClassDefFoundError: org/springframework/context/support/DefaultLifecycleProcessor$1
at org.springframework.context.support.DefaultLifecycleProcessor.doStop(DefaultLifecycleProcessor.java:229)
at org.springframework.context.support.DefaultLifecycleProcessor.access$300(DefaultLifecycleProcessor.java:51)
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.stop(DefaultLifecycleProcessor.java:363)
at org.springframework.context.support.DefaultLifecycleProcessor.stopBeans(DefaultLifecycleProcessor.java:202)
at org.springframework.context.support.DefaultLifecycleProcessor.onClose(DefaultLifecycleProcessor.java:118)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:969)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:928)
at org.springframework.web.servlet.FrameworkServlet.destroy(FrameworkServlet.java:828)
at org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:1481)
at org.apache.catalina.core.StandardWrapper.stopInternal(StandardWrapper.java:1842)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5647)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1028)
at org.apache.catalina.startup.HostConfig.undeploy(HostConfig.java:1478)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1406)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1626)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:328)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1374)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519)
at java.lang.Thread.run(Thread.java:745)
14 Mar 2016 23:25:34,509 DEBUG [context.support.DefaultLifecycleProcessor] Asking bean 'simpleBrokerMessageHandler' of type [class org.springframework.messaging.simp.broker.SimpleBrokerMessageHandler] to stop
14 Mar 2016 23:25:34,509 WARN [context.support.DefaultLifecycleProcessor] Failed to stop bean 'simpleBrokerMessageHandler'
java.lang.NoClassDefFoundError: org/springframework/context/support/DefaultLifecycleProcessor$1
at org.springframework.context.support.DefaultLifecycleProcessor.doStop(DefaultLifecycleProcessor.java:229)
at org.springframework.context.support.DefaultLifecycleProcessor.access$300(DefaultLifecycleProcessor.java:51)
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.stop(DefaultLifecycleProcessor.java:363)
at org.springframework.context.support.DefaultLifecycleProcessor.stopBeans(DefaultLifecycleProcessor.java:202)
at org.springframework.context.support.DefaultLifecycleProcessor.onClose(DefaultLifecycleProcessor.java:118)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:969)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:928)
at org.springframework.web.servlet.FrameworkServlet.destroy(FrameworkServlet.java:828)
at org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:1481)
at org.apache.catalina.core.StandardWrapper.stopInternal(StandardWrapper.java:1842)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5647)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1028)
at org.apache.catalina.startup.HostConfig.undeploy(HostConfig.java:1478)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1406)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1626)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:328)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1374)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519)
at java.lang.Thread.run(Thread.java:745)
14 Mar 2016 23:25:34,510 DEBUG [context.support.DefaultLifecycleProcessor] Asking bean 'userDestinationMessageHandler' of type [class org.springframework.messaging.simp.user.UserDestinationMessageHandler] to stop
14 Mar 2016 23:25:34,510 WARN [context.support.DefaultLifecycleProcessor] Failed to stop bean 'userDestinationMessageHandler'
java.lang.NoClassDefFoundError: org/springframework/context/support/DefaultLifecycleProcessor$1
at org.springframework.context.support.DefaultLifecycleProcessor.doStop(DefaultLifecycleProcessor.java:229)
at org.springframework.context.support.DefaultLifecycleProcessor.access$300(DefaultLifecycleProcessor.java:51)
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.stop(DefaultLifecycleProcessor.java:363)
at org.springframework.context.support.DefaultLifecycleProcessor.stopBeans(DefaultLifecycleProcessor.java:202)
at org.springframework.context.support.DefaultLifecycleProcessor.onClose(DefaultLifecycleProcessor.java:118)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:969)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:928)
at org.springframework.web.servlet.FrameworkServlet.destroy(FrameworkServlet.java:828)
at org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:1481)
at org.apache.catalina.core.StandardWrapper.stopInternal(StandardWrapper.java:1842)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5647)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1028)
at org.apache.catalina.startup.HostConfig.undeploy(HostConfig.java:1478)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1406)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1626)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:328)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1374)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519)
at java.lang.Thread.run(Thread.java:745)
14 Mar 2016 23:26:04,511 WARN [context.support.DefaultLifecycleProcessor] Failed to shut down 5 beans with phase value 2147483647 within timeout of 30000: [stompWebSocketHandlerMapping, subProtocolWebSocketHandler, simpAnnotationMethodMessageHandler, simpleBrokerMessageHandler, userDestinationMessageHandler]

Have you packaged this as a fat jar, and are you redeploying the updated jar BEFORE shutting down the running app? That is what was happening to me, because I was using ansible to download the fat jar, with a handler to restart the app if the jar had changed.
I solved it by staging the new jar first, and if it is different, stopping the app before copying the staged jar.
See here for more info

I think you are missing the spring-websocket jar on your classpath. This error is not related to the spring-context library, the code while starting/stopping isn't able to find a component which should be started/stopped. As you mentioned websockets, spring-websocket must do the trick for you. Or even the org.springframework.integration library.

A general wisdom here is to check your server logs first (ex: catalina.out in case of tomcat), instead of your application logs
In my case the issue was with the fat jar as it had multiple slf4j-log4j12 and the following error surrounded in server logs
Caused by: java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.Log4jLoggerFactory loaded from jar:file:/myjar.jar!/lib/slf4j-log4j12-1.7.8.jar!/). If you are using Weblogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml Object of class [org.slf4j.impl.Log4jLoggerFactory] must be an instance of class ch.qos.logback.classic.LoggerContext
which got resolved by exclusion of
<groupId>org.slf4j-log4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
from one of the jar which was causing the conflict

Related

java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V

04-Feb-2020 18:25:39.794 INFO [localhost-startStop-1] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#6e2af876: defining beans [sessionFactory,sessionFactoryCCA,sessionFactorySSO,login,internalUsersMgmt,rolesMgmt,sessionManager,productManager,birtManager,templateManager,reportFileManager,dashboardDetailsDAO,configDynamicFilterDAO,oAMDataDAO,scheduledFileManager,cronTrigger,loginDAO,internalUsersDAO,applicationResourceDAO,reportTemplateStoreDAO,reportFileStoreDAO,scheduledFileStoreDAO,templateSchedulingParamDAO,reportUtilsDAO,rolesDAO,myFilter,userMasterDAO,userRoleDAO,sessionServiceDAO,permissionDAO,roleMenuDAO,rolePermissionDAO,ssoManagerDAO]; root of factory hierarchy
04-Feb-2020 18:25:39.794 SEVERE [localhost-startStop-1] org.springframework.web.context.ContextLoader.initWebApplicationContext Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1403)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:272)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:196)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4699)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5165)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:970)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1841)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
at net.sf.cglib.core.ClassEmitter.begin_class(ClassEmitter.java:77)
at net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:173)
at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:215)
at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
at org.hibernate.impl.SessionFactoryImpl.<clinit>(SessionFactoryImpl.java:321)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:855)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:774)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1400)
... 25 more
04-Feb-2020 18:25:39.805 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
04-Feb-2020 18:25:39.889 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/omega] startup failed due to previous errors
04-Feb-2020 18:25:39.922 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [omega] registered the JDBC driver [org.apache.derby.jdbc.AutoloadedDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
04-Feb-2020 18:25:39.923 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [omega] registered the JDBC driver [oracle.jdbc.OracleDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
04-Feb-2020 18:25:39.923 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [omega] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
04-Feb-2020 18:25:39.933 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [omega] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)` `
java.lang.Object.wait(Object.java:503)
java.util.TimerThread.mainLoop(Timer.java:526)
java.util.TimerThread.run(Timer.java:505)` `

starting apache ignite from spring, hibernate l2 cache

I have tried both instantiating the IgniteSpringBean and manually calling Ignition.start() from java, but no matter what, I get this. This example is where I call Ignition.start() from java, log message is "DONE WITH IGNITION !" (logged after Ignition.start() is complete). Does the empty "name=" mean something? Maybe hibernate doesn't know what the instance name is?
Jan 11, 2018 3:09:27 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/api.war
Jan 11, 2018 3:10:12 PM org.apache.ignite.logger.java.JavaLogger warning
WARNING: Message queue limit is set to 0 which may lead to potential OOMEs when running cache operations in FULL_ASYNC or PRIMARY_SYNC modes due to message queues growth on sender and receiver sides.
Jan 11, 2018 3:10:12 PM org.apache.ignite.logger.java.JavaLogger warning
WARNING: Checkpoints are disabled (to enable configure any GridCheckpointSpi implementation)
Jan 11, 2018 3:10:12 PM org.apache.ignite.logger.java.JavaLogger warning
WARNING: Collision resolution is disabled (all jobs will be activated upon arrival).
Jan 11, 2018 3:10:13 PM org.apache.ignite.logger.java.JavaLogger warning
WARNING: Nodes started on local machine require more than 80% of physical RAM what can lead to significant slowdown due to swapping (please decrease JVM heap size, data region size or checkpoint buffer size) [required=13549MB, available=16049MB]
01-11-2018 15:10:14.954 [localhost-startStop-1] {env=''} WARN c.s.s.d.i.MyLocalContainerEntityManagerFactoryBean: !!!!!!!!!!!!!!!!!! DONE WITH IGNITION !!!!!!!!!!!!!!!!!!!
01-11-2018 15:10:14.968 [localhost-startStop-1] {env=''} WARN c.s.s.d.i.MyLocalContainerEntityManagerFactoryBean: !!!!!!!!!!!!!!!!!! DONE WITH ENTITY MANAGER FACTORY CONSTRUCTOR !!!!!!!!!!!!!!!!!!!
01-11-2018 15:10:15.625 [localhost-startStop-1] {env=''} INFO c.s.s.d.i.MyLocalContainerEntityManagerFactoryBean: Building JPA container EntityManagerFactory for persistence unit 'cloudorch-jpa'
01-11-2018 15:10:21.389 [localhost-startStop-1] {env=''} WARN o.s.w.c.s.XmlWebApplicationContext: Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactoryJpa' defined in URL [file:/opt/cloud-orchestrator/etc/config/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.spi.CacheImplementor]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:540) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:229) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:956) ~[spring-context-4.1.1.RELEASE.jar:4.1.1.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:747) ~[spring-context-4.1.1.RELEASE.jar:4.1.1.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) ~[spring-context-4.1.1.RELEASE.jar:4.1.1.RELEASE]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) [spring-web-4.1.1.RELEASE.jar:4.1.1.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) [spring-web-4.1.1.RELEASE.jar:4.1.1.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) [spring-web-4.1.1.RELEASE.jar:4.1.1.RELEASE]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973) [tomcat-catalina-7.0.52.jar:7.0.52]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467) [tomcat-catalina-7.0.52.jar:7.0.52]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-catalina-7.0.52.jar:7.0.52]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) [tomcat-catalina-7.0.52.jar:7.0.52]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) [tomcat-catalina-7.0.52.jar:7.0.52]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632) [tomcat-catalina-7.0.52.jar:7.0.52]
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073) [tomcat-catalina-7.0.52.jar:7.0.52]
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857) [tomcat-catalina-7.0.52.jar:7.0.52]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_121]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_121]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_121]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_121]
Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.spi.CacheImplementor]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:261) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:225) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:273) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1857) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:398) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:152) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-4.1.1.RELEASE.jar:4.1.1.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318) ~[spring-orm-4.1.1.RELEASE.jar:4.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1627) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1564) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
... 25 common frames omitted
Caused by: org.apache.ignite.IgniteIllegalStateException: Ignite instance with provided name doesn't exist. Did you call Ignition.start(..) to start an Ignite instance? [name=]
at org.apache.ignite.internal.IgnitionEx.grid(IgnitionEx.java:1312) ~[ignite-core-2.3.0.jar:2.3.0]
at org.apache.ignite.Ignition.ignite(Ignition.java:530) ~[ignite-core-2.3.0.jar:2.3.0]
at org.apache.ignite.cache.hibernate.HibernateRegionFactory.start(HibernateRegionFactory.java:107) ~[ignite-hibernate-1.0.0.jar:1.0.0]
at org.hibernate.internal.CacheImpl.<init>(CacheImpl.java:70) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:40) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:35) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.initiateService(SessionFactoryServiceRegistryImpl.java:91) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:251) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
... 38 common frames omitted
01-11-2018 15:10:21.411 [localhost-startStop-1] {env=''} ERROR o.s.w.c.ContextLoader: Context initialization failed
Looks like you're using a very old version of ignite-hibernate module:
~[ignite-hibernate-1.0.0.jar:1.0.0]
Make sure that version for all Ignite artifact you use is the same (e.g. 2.3.0).

Deployment Compound Projects using Utility Module With Hibernate 5 and Spring 4 in Eclipse on Tomcat failed

I decided to split the work to more modules in Eclipse Mars (Neon). One module is deployable as war REST Service. Using integrated Tomcat (version 8.0.41) to use: Right click on Server in Servers View -> Add and Remove causes:
15:42:21.104 [localhost-startStop-1] INFO o.s.web.context.ContextLoader - Root WebApplicationContext: initialization started
15:42:21.123 [localhost-startStop-1] INFO o.s.w.c.s.AnnotationConfigWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Thu Jun 29 15:42:21 CEST 2017]; root of context hierarchy
15:42:21.201 [localhost-startStop-1] INFO o.s.w.c.s.AnnotationConfigWebApplicationContext - Registering annotated classes: [class com.deepam.spring.config.AppRestConfig]
15:42:21.218 [localhost-startStop-1] ERROR o.s.web.context.ContextLoader - Context initialization failed
java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724)
at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531)
at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355)
at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)
at java.lang.Class.createAnnotationData(Class.java:3521)
at java.lang.Class.annotationData(Class.java:3510)
at java.lang.Class.getAnnotations(Class.java:3446)
at org.springframework.core.type.StandardAnnotationMetadata.<init>(StandardAnnotationMetadata.java:68)
at org.springframework.beans.factory.annotation.AnnotatedGenericBeanDefinition.<init>(AnnotatedGenericBeanDefinition.java:56)
at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.registerBean(AnnotatedBeanDefinitionReader.java:167)
at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.registerBean(AnnotatedBeanDefinitionReader.java:142)
at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.register(AnnotatedBeanDefinitionReader.java:131)
at org.springframework.web.context.support.AnnotationConfigWebApplicationContext.loadBeanDefinitions(AnnotationConfigWebApplicationContext.java:210)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:614)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:515)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4851)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Jun 29, 2017 3:42:21 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724)
at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531)
at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355)
at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)
at java.lang.Class.createAnnotationData(Class.java:3521)
at java.lang.Class.annotationData(Class.java:3510)
at java.lang.Class.getAnnotations(Class.java:3446)
at org.springframework.core.type.StandardAnnotationMetadata.<init>(StandardAnnotationMetadata.java:68)
at org.springframework.beans.factory.annotation.AnnotatedGenericBeanDefinition.<init>(AnnotatedGenericBeanDefinition.java:56)
at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.registerBean(AnnotatedBeanDefinitionReader.java:167)
at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.registerBean(AnnotatedBeanDefinitionReader.java:142)
at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.register(AnnotatedBeanDefinitionReader.java:131)
at org.springframework.web.context.support.AnnotationConfigWebApplicationContext.loadBeanDefinitions(AnnotationConfigWebApplicationContext.java:210)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:614)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:515)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4851)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Jun 29, 2017 3:42:21 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file
Jun 29, 2017 3:42:21 PM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [201] milliseconds.
Jun 29, 2017 3:42:21 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/SpringOracleJDBCJPAREST] startup failed due to previous errors
Jun 29, 2017 3:42:21 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
Jun 29, 2017 3:42:21 PM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:170)
at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1030)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1006)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:958)
at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:583)
at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:116)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4898)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5537)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:221)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:149)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
If I the same .war file generated from Eclipse this way: Right click on Parent project -> Run as - Maven Install put into {Apache Tomcat Innstallation}/webaaps directory manually, it woks fine without errors. How can I setup Eclipse to enable automatic deployment without Context initialization failed errors?
P.S. One big project merged all together has no problem with deployment. It works fine as expected.
The solution is to undeploy .war file from Tomcat integrated environment and copy it straightforwardly into $tomcat_home/webapps deployment directory. Every setting can be as they previously were set. It means, Tomcat can be administrated from Eclipse as well. We can restart Tomcat from Eclipse, look on log using Console View etc.
I suppose, that Context needs some further configuration or it is a bug, but this workaround works fine.
There is only one limitation, that automatic deployment is not possible and Tomcat doesn't display deployed modules in View Servers.

Tomcat unable to start application

I have installed petclinic application in tomcat server. During tomcat start up and loading of petclinic application I am having the error with the followed stack trace. How to resolve this issue ?
apache-tomcat-7.0.47/webapps/petclinic
Oct 27, 2016 12:14:36 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error during ServletContainerInitializer processing
javax.servlet.ServletException: Failed to instantiate WebApplicationInitializer class at
org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:160)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5423)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1120)
at
org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1678)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:483)
at java.util.concurrent.FutureTask.run(FutureTask.java:274) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627)
at java.lang.Thread.run(Thread.java:798) Caused by:
java.lang.NoClassDefFoundError:
org.glassfish.jersey.server.ResourceConfig at
java.lang.J9VMInternals.verifyImpl(Native Method) at
java.lang.J9VMInternals.verify(J9VMInternals.java:94) at
java.lang.J9VMInternals.initialize(J9VMInternals.java:169) at
java.lang.J9VMInternals.newInstanceImpl(Native Method) at
java.lang.Class.newInstance(Class.java:1781) at
org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:157)
... 12 more Caused by: java.lang.ClassNotFoundException:
org.glassfish.jersey.server.ResourceConfig at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
... 18 more
I think you didn't let spring know about some bean class.
Look at your context.xml or dispatcher-context.xml.
In the exception stack above,
it says java.lang.ClassNotFoundException occured.
Spring can't find class files even if you have them in your java src package.
If my answer doesn't solve your problem,
you need to show your xml or source code to make sure what the problem is.

can't deploy spring project on tomcat

I had a working spring project and updated the framework to version 3.2.2. Now I can build my project but I can't deploy it any more. Aparently Tomcat can't find a class responsible for the logging. But the springframework is in my CLASSPATH, and I'm sure it is contained in the WAR, too. Did I misunderstand the tomcat log?
I even started a new minimalistic spring project - same result.
I'm quite stuck here - any help is appreciated.
Here's my Netbeans log:
Tomcat server started.
Incrementally deploying http://localhost:8080/SpringTest
Completed incremental distribution of http://localhost:8080/SpringTest
Incrementally redeploying http://localhost:8080/SpringTest
Deploy is in progress...
deploy?config=file%3A%2Ftmp%2Fcontext9144781847406895845.xml&path=/SpringTest
FAIL - Deployed application at context path /SpringTest but context failed to start
/home/maex/NetBeansProjects/SpringTest/nbproject/build-impl.xml:1061: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 7 seconds)
And the more interesting Tomcat Apache log:
INFO: Starting Servlet Engine: Apache Tomcat/7.0.40
Jun 01, 2013 7:00:05 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor /home/maex/public_html/conf/Catalina/localhost/Bonjour.xml
Jun 01, 2013 7:00:05 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/home/maex/NetBeansProjects/Bonjour/build/web/WEB-INF/lib/servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Jun 01, 2013 7:00:07 PM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Bonjour]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1636)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NoClassDefFoundError: Lorg/apache/commons/logging/Log;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2317)
at java.lang.Class.getDeclaredFields(Class.java:1762)
at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:261)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:140)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:67)
at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:405)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 11 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.Log
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 25 more
Jun 01, 2013 7:00:07 PM org.apache.catalina.startup.HostConfig deployDescriptor
SEVERE: Error deploying configuration descriptor /home/maex/public_html/conf/Catalina/localhost/Bonjour.xml
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Bonjour]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1636)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
It looks like you have several issues, but let's start with the 2 obvious ones.
INFO: validateJarFile(/home/maex/NetBeansProjects/Bonjour/build/web/WEB-INF/lib/servlet-api.jar) - jar not loaded...
This error is cause by the inclusion of the servlet*.jar in your runtime, it only needs to be available during build time. The servlet container (e.g. tomcat) should provide the servlet*.jar for you at runtime.
Caused by: java.lang.NoClassDefFoundError: Lorg/apache/commons/logging/Log;
You are probably missing the commons logging jar. make it available, either in the webapp/WEB-INF/lib or container lib.

Resources