Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Spring JIRA by Nick Williams, 1 year ago
org.springframework.context.event.ContextRefreshedEvent cannot be cast to com.wrox.site.Event1
via Spring JIRA by Nick Williams, 1 year ago
org.springframework.context.event.ContextRefreshedEvent cannot be cast to com.wrox.site.Event1
java.lang.ClassCastException: org.springframework.context.event.ContextRefreshedEvent cannot be cast to com.wrox.site.Event1	at com.wrox.site.MyListener$$Lambda$3.onApplicationEvent(Unknown Source)	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:98)	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:344)	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948)	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:496)	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765)	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5210)	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702)	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:698)	at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1491)	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:491)	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:792)	at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:468)	at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:415)	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:491)	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:792)	at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1465)	at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:75)	at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1306)	at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1398)	at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:827)	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:491)	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)	at sun.rmi.transport.Transport$1.run(Transport.java:177)	at sun.rmi.transport.Transport$1.run(Transport.java:174)	at java.security.AccessController.doPrivileged(Native Method)	at sun.rmi.transport.Transport.serviceCall(Transport.java:173)	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)	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:724)