I have an OSGi Application that uses log4j 2.17.1, slf4j-api-2.0.3.jar, and slf4j-reload4j-2.0.3.jar. The web server is running Tomcat 8.0.53. I'm getting this log4j2 error in the debug log when starting the application, and I'm not getting any logs although the application is running.
DEBUG StatusLogger Not in a ServletContext environment, thus not loading WebLookup plugin.
DEBUG StatusLogger Unable to retrieve WatchEventService from ClassLoader org.company.dao.webcontainer.tomcat.WebAppClassLoader#140c9f39
java.lang.NullPointerException
at java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:354)
at java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:393)
at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:474)
at org.apache.logging.log4j.core.util.WatchManager.getEventServices(WatchManager.java:164)
at org.apache.logging.log4j.core.util.WatchManager.<init>(WatchManager.java:137)
at org.apache.logging.log4j.core.config.AbstractConfiguration.<init>(AbstractConfiguration.java:140)
at org.apache.logging.log4j.core.config.DefaultConfiguration.<init>(DefaultConfiguration.java:46)
at org.apache.logging.log4j.core.LoggerContext.<init>(LoggerContext.java:95)
at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.createContext(ClassLoaderContextSelector.java:254)
at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.locateContext(ClassLoaderContextSelector.java:218)
at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:140)
at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:123)
at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:117)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:150)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
at org.apache.logging.log4j.LogManager.getContext(LogManager.java:309)
at org.apache.log4j.LogManager$PrivateManager.getContext(LogManager.java:244)
at org.apache.log4j.LogManager.getRootLogger(LogManager.java:89)
at org.slf4j.reload4j.Reload4jLoggerFactory.<init>(Reload4jLoggerFactory.java:66)
at org.slf4j.reload4j.Reload4jServiceProvider.initialize(Reload4jServiceProvider.java:35)
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:152)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:139)
at org.slf4j.LoggerFactory.getProvider(LoggerFactory.java:422)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:408)
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.apache.cxf.common.logging.LogUtils.<clinit>(LogUtils.java:103)
at org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser.<clinit>(AbstractBeanDefinitionParser.java:65)
at org.apache.cxf.jaxrs.spring.NamespaceHandler.init(NamespaceHandler.java:27)
at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:131)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1406)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1401)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:168)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:138)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:94)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:508)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:609)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:510)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4900)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5363)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:755)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:731)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.company.dao.webcontainer.tomcat.TomcatWrapper.startWebApp(TomcatWrapper.java:187)
at org.company.dao.webcontainer.tomcat.TomcatWrapper.prepareAllWebApps(TomcatWrapper.java:141)
at org.company.dao.webcontainer.tomcat.TomcatWrapper.startServer(TomcatWrapper.java:208)
at org.company.dao.webcontainer.tomcat.Application.start(Application.java:30)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
I have org.apache.logging.log4j.core.util in the 'Export-Package' of the MANIFEST.MF file. Am I missing anything?
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Dao Logging
Bundle-SymbolicName: org.company.dao.logging;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: org.company.dao.logging.Activator
Require-Bundle: org.eclipse.core.runtime
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: bin/,
lib/slf4j-api-2.0.3.jar,
lib/log4j-slf4j-impl-2.17.1.jar,
lib/log4j-1.2-api-2.17.1.jar,
lib/log4j-api-2.17.1.jar,
lib/log4j-core-2.17.1.jar,
lib/commons-logging-1.2.jar
Export-Package: org.apache.commons.logging,
org.apache.commons.logging.impl,
org.apache.log4j,
org.apache.log4j.bridge,
org.apache.log4j.builders,
org.apache.log4j.builders.appender,
org.apache.log4j.builders.filter,
org.apache.log4j.builders.layout,
org.apache.log4j.builders.rewrite,
org.apache.log4j.builders.rolling,
org.apache.log4j.component.helpers,
org.apache.log4j.config,
org.apache.log4j.helpers,
org.apache.log4j.jmx,
org.apache.log4j.layout,
org.apache.log4j.legacy.core,
org.apache.log4j.or,
org.apache.log4j.or.jms,
org.apache.log4j.pattern,
org.apache.log4j.rewrite,
org.apache.log4j.spi,
org.apache.log4j.varia,
org.apache.log4j.xml,
org.apache.logging.log4j,
org.apache.logging.log4j.core,
org.apache.logging.log4j.core.appender,
org.apache.logging.log4j.core.appender.db,
org.apache.logging.log4j.core.appender.db.jdbc,
org.apache.logging.log4j.core.appender.mom,
org.apache.logging.log4j.core.appender.mom.jeromq,
org.apache.logging.log4j.core.appender.mom.kafka,
org.apache.logging.log4j.core.appender.nosql,
org.apache.logging.log4j.core.appender.rewrite,
org.apache.logging.log4j.core.appender.rolling,
org.apache.logging.log4j.core.appender.rolling.action,
org.apache.logging.log4j.core.appender.routing,
org.apache.logging.log4j.core.async,
org.apache.logging.log4j.core.config,
org.apache.logging.log4j.core.config.arbiters,
org.apache.logging.log4j.core.config.builder.api,
org.apache.logging.log4j.core.config.builder.impl,
org.apache.logging.log4j.core.config.composite,
org.apache.logging.log4j.core.config.json,
org.apache.logging.log4j.core.config.plugins,
org.apache.logging.log4j.core.config.plugins.convert,
org.apache.logging.log4j.core.config.plugins.processor,
org.apache.logging.log4j.core.config.plugins.util,
org.apache.logging.log4j.core.config.plugins.validation,
org.apache.logging.log4j.core.config.plugins.validation.constraints,
org.apache.logging.log4j.core.config.plugins.validation.validators,
org.apache.logging.log4j.core.config.plugins.visitors,
org.apache.logging.log4j.core.config.properties,
org.apache.logging.log4j.core.config.status,
org.apache.logging.log4j.core.config.xml,
org.apache.logging.log4j.core.config.yaml,
org.apache.logging.log4j.core.filter,
org.apache.logging.log4j.core.impl,
org.apache.logging.log4j.core.jackson,
org.apache.logging.log4j.core.jmx,
org.apache.logging.log4j.core.layout,
org.apache.logging.log4j.core.layout.internal,
org.apache.logging.log4j.core.lookup,
org.apache.logging.log4j.core.message,
org.apache.logging.log4j.core.net,
org.apache.logging.log4j.core.net.ssl,
org.apache.logging.log4j.core.osgi,
org.apache.logging.log4j.core.parser,
org.apache.logging.log4j.core.pattern,
org.apache.logging.log4j.core.script,
org.apache.logging.log4j.core.selector,
org.apache.logging.log4j.core.time,
org.apache.logging.log4j.core.time.internal,
org.apache.logging.log4j.core.tools,
org.apache.logging.log4j.core.tools.picocli,
org.apache.logging.log4j.core.util,
org.apache.logging.log4j.core.util.datetime,
org.apache.logging.log4j.internal,
org.apache.logging.log4j.message,
org.apache.logging.log4j.simple,
org.apache.logging.log4j.spi,
org.apache.logging.log4j.status,
org.apache.logging.log4j.util,
org.apache.logging.slf4j,
org.slf4j,
org.slf4j.event,
org.slf4j.helpers,
org.slf4j.impl,
org.slf4j.spi
edit
Updating log4j to 2.19.0 cleared the error but I'm getting messages like this now
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions 1.7.x or earlier.
SLF4J: Ignoring binding found at [bundleresource://8.fwk600746945:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See https://www.slf4j.org/codes.html#ignoredBindings for an explanation.
Here's all of the slf4j jars in my OSGi Bundle
root#8be4d7b90d60:/opt/core_server/default/plugins# find . -name "*slf4j*"
./com.company.platform.analytics.agent.model-2.0.0-SNAPSHOT/target/lib/slf4j-reload4j-2.0.3.jar
./com.company.platform.analytics.agent.model-2.0.0-SNAPSHOT/target/lib/slf4j-api-2.0.3.jar
./com.github.codegerm:org.cg.eventbus-1.0.9/target/lib/slf4j-reload4j-2.0.3.jar
./com.github.codegerm:org.cg.eventbus-1.0.9/target/lib/slf4j-api-2.0.3.jar
./com.company.platform.internal.agent-2.0.0-SNAPSHOT/target/lib/slf4j-reload4j-2.0.3.jar
./com.company.platform.internal.agent-2.0.0-SNAPSHOT/target/lib/slf4j-api-2.0.3.jar
./com.company.platform.data.common-2.0.0-SNAPSHOT/target/lib/slf4j-reload4j-2.0.3.jar
./com.company.platform.data.common-2.0.0-SNAPSHOT/target/lib/slf4j-api-2.0.3.jar
./com.github.codegerm:org.cg.services.core-1.0.12/target/lib/slf4j-reload4j-2.0.3.jar
./com.github.codegerm:org.cg.services.core-1.0.12/target/lib/slf4j-api-2.0.3.jar
./com.company.platform.configuration.management:com.company.platform.configuration.management-2.0.0-SNAPSHOT/target/lib/slf4j-reload4j-2.0.3.jar
./com.company.platform.configuration.management:com.company.platform.configuration.management-2.0.0-SNAPSHOT/target/lib/slf4j-api-2.0.3.jar
./org.cg.dao.logging_1.0.0/lib/log4j-slf4j-impl-2.19.0.jar
./org.cg.dao.logging_1.0.0/lib/slf4j-api-2.0.3.jar
./com.company.platform.ingestion-2.0.0-SNAPSHOT/target/lib/slf4j-reload4j-2.0.3.jar
./com.company.platform.ingestion-2.0.0-SNAPSHOT/target/lib/slf4j-api-2.0.3.jar
./com.company.platform.ingestion-2.0.0-SNAPSHOT/target/lib/jcl-over-slf4j-1.7.14.jar
./com.company.platform.security-2.0.0-SNAPSHOT/target/lib/slf4j-reload4j-2.0.3.jar
./com.company.platform.security-2.0.0-SNAPSHOT/target/lib/slf4j-api-2.0.3.jar
./com.company.platform.security-2.0.0-SNAPSHOT/target/lib/jcl-over-slf4j-1.7.14.jar
edit-2 Replacing log4j-slf4j-impl-2.19.0.jar with log4j-slf4j2-impl-2.19.0.jar fixed the "SLF4J: No SLF4J providers were found" issue.
Thanks to #Piotr!
I had to upgrade log4j to 2.19.0 then use log4j-slf4j2-impl instead of log4j-slf4j-impl to bind with slf4j 2.0.3.
All is good now!
I am trying to implement a logger using aop in my spring application. But at the moment when I try to add the **<aop:aspectj-autoproxy />** tag, I get the error below. I have added all the needed jars needed for aop. If I remove this tag, the spring xml file shows no error on server start-up. I searched for this error, and I came to know that there might be some issue with the jars added to the application but I am unable to find the problem. Kindly help!
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/springapp-servlet.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.MutablePropertyValues.add(Ljava/lang/String;Ljava/lang/Object;)Lorg/springframework/beans/MutablePropertyValues;
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:394)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:316)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:284)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:126)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:419)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:349)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:427)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:341)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.NoSuchMethodError: org.springframework.beans.MutablePropertyValues.add(Ljava/lang/String;Ljava/lang/Object;)Lorg/springframework/beans/MutablePropertyValues;
at org.springframework.aop.config.AopConfigUtils.registerOrEscalateApcAsRequired(AopConfigUtils.java:123)
at org.springframework.aop.config.AopConfigUtils.registerAspectJAnnotationAutoProxyCreatorIfNecessary(AopConfigUtils.java:90)
at org.springframework.aop.config.AopNamespaceUtils.registerAspectJAnnotationAutoProxyCreatorIfNecessary(AopNamespaceUtils.java:76)
at org.springframework.aop.config.AspectJAutoProxyBeanDefinitionParser.parse(AspectJAutoProxyBeanDefinitionParser.java:41)
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:72)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1320)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1310)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:475)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:372)
... 32 more
Mar 11, 2015 12:58:50 AM org.apache.catalina.core.ApplicationContext log
I am getting below exception on deploying Spring 4.0.1 app in Tomcat 6.0.37:
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean#0': Invocation of init method failed; nested exception is java.lang.AbstractMethodError: org.hibernate.validator.internal.engine.ConfigurationImpl.getDefaultParameterNameProvider()Ljavax/validation/ParameterNameProvider;
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:700)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.AbstractMethodError: org.hibernate.validator.internal.engine.ConfigurationImpl.getDefaultParameterNameProvider()Ljavax/validation/ParameterNameProvider;
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191)
at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:176)
at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.configureParameterNameProviderIfPossible(LocalValidatorFactoryBean.java:276)
at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:245)
at org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean.afterPropertiesSet(OptionalValidatorFactoryBean.java:40)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
... 36 more
Following related dependencies are added in build.gradle:
dependencies {
providedCompile "javax.servlet:servlet-api:2.5"
providedCompile "javax.servlet.jsp:jsp-api:2.2"
providedCompile "javax.el:el-api:2.2"
compile "javax.servlet.jsp.jstl:jstl-api:1.2"
compile "org.glassfish.web:jstl-impl:1.2"
compile "org.slf4j:jcl-over-slf4j:1.7.6"
compile "org.slf4j:slf4j-api:1.7.6"
compile ("org.hibernate:hibernate-validator:4.3.1.Final") {
exclude group: "javax.xml.bind", module: "jaxb-api"
exclude group: "com.sun.xml.bind", module: "jaxb-impl"
}
compile "javax.validation:validation-api:1.1.0.Final"
// Spring 4.0.1 and other dependencies below
....
}
Is the error because of spring-beans and spring-webmvc depends on EL 2.2.4 version whereas Tomcat 6 comes with EL 2.1. If so, how to resolve it? Also, I do not have rights to update libs in Tomcat dir.
The error has nothing to do with the EL. It has all to do with the javax.validation api and hibernate.
java.lang.AbstractMethodError: org.hibernate.validator.internal.engine.ConfigurationImpl.getDefaultParameterNameProvider()Ljavax/validation/ParameterNameProvider
Hibernate validator 4.3.x is an implementation of javax.validation 1.0 (JSR-303). However you are including the 1.1 API version. Either downgrade the included javax.validation version or upgrade your hibernate validator to 5.0.x.
Check to see if there are multiple references to validator in your pom file
<?xml version="1.0" encoding="UTF-8"?>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>${hibernate-val.version}</version>
</dependency>
i have a CDH4 cluster running Map-Reduce V1. when I tried to install oozie CDh4 from tarball and configured it as per the instructions given at
https://ccp.cloudera.com/display/CDH4DOC/Oozie+Installation#OozieInstallation-Configuringthehadoopversion
On starting the service i get the following error in logs
INFO: Starting Servlet Engine: Apache Tomcat/6.0.32
11 Oct, 2012 11:51:57 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor oozie.xml
ERROR: Oozie could not be started
REASON: java.lang.NoClassDefFoundError: org/apache/hadoop/util/ReflectionUtils
Stacktrace:
-----------------------------------------------------------------
java.lang.NoClassDefFoundError: org/apache/hadoop/util/ReflectionUtils
at org.apache.oozie.service.Services.setServiceInternal(Services.java:349)
at org.apache.oozie.service.Services.<init>(Services.java:107)
at org.apache.oozie.servlet.ServicesLoader.contextInitialized(ServicesLoader.java:38)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1315)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.ReflectionUtils
I don't see this in the CDH4 docs, but under CDH3u3 you had to copy the hadoop-core libray into <oozie-home>/lib. That jar contains the missing class from your stack trace.
Edit:
For the life of me, I can't find this in the docs anywhere for cdh3u3, either. So, I copied it and other jars I needed, but I don't remember where I read this.
Moved to Spring 3.1.1 from Spring 3.0.5 now my App does not work can someone please tell me what is up? I removed all the 3.0.5 jars and added the 3.1.1 jars
2012-05-14 12:01:41,195 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.context.ApplicationContextException: Couldn't locate: org.springframework.ldap.core.support.BaseLdapPathContextSource. If you are using LDAP with Spring Security, please ensure that you include the spring-ldap jar file in your application; nested exception is java.lang.ClassNotFoundException: org.springframework.ldap.core.support.BaseLdapPathContextSource
at org.springframework.security.config.ldap.ContextSourceSettingPostProcessor.postProcessBeanFactory(ContextSourceSettingPostProcessor.java:34)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:681)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:664)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:446)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
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:616)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.ClassNotFoundException: org.springframework.ldap.core.support.BaseLdapPathContextSource
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
at org.springframework.security.config.ldap.ContextSourceSettingPostProcessor.postProcessBeanFactory(ContextSourceSettingPostProcessor.java:32)
... 21 more
May 14, 2012 12:01:41 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.context.ApplicationContextException: Couldn't locate: org.springframework.ldap.core.support.BaseLdapPathContextSource. If you are using LDAP with Spring Security, please ensure that you include the spring-ldap jar file in your application; nested exception is java.lang.ClassNotFoundException: org.springframework.ldap.core.support.BaseLdapPathContextSource
at org.springframework.security.config.ldap.ContextSourceSettingPostProcessor.postProcessBeanFactory(ContextSourceSettingPostProcessor.java:34)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:681)
Have you done what it suggests and verified that spring-ldap is included with your app? That's clearly where the class in question lives. My guess is that you blindly removed all the jars named spring-* and added in all the 3.1 spring-* jar files, but spring-ldap isn't included with the base spring 3.1 distro. In fact, its versioning is completely separate, and it's presently at version 1.3.1.