aem 6.5.18 startup with log4j errors | Community
Skip to main content
Level 2
November 24, 2023

aem 6.5.18 startup with log4j errors

  • November 24, 2023
  • 4 replies
  • 3027 views

Hi, everyone 

my aem startup with below error , seems like aem missing some Log4j2 dependency, can anyone help me fix it

 

ERROR StatusLogger Unable to load OSGI services for service class org.apache.logging.log4j.spi.Provider
java.lang.NullPointerException
at org.apache.logging.log4j.util.OsgiServiceLocator.loadServices(OsgiServiceLocator.java:61)
at org.apache.logging.log4j.util.ServiceLoaderUtil.loadServices(ServiceLoaderUtil.java:92)
at org.apache.logging.log4j.util.ServiceLoaderUtil.loadServices(ServiceLoaderUtil.java:77)
at org.apache.logging.log4j.util.ProviderUtil.<init>(ProviderUtil.java:67)
at org.apache.logging.log4j.util.ProviderUtil.lazyInit(ProviderUtil.java:145)
at org.apache.logging.log4j.util.ProviderUtil.hasProviders(ProviderUtil.java:129)
at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:90)
at org.apache.poi.ooxml.POIXMLRelation.<clinit>(POIXMLRelation.java:54)
at org.apache.tika.parser.pkg.StreamingZipContainerDetector.<clinit>(StreamingZipContainerDetector.java:61)
at org.apache.tika.parser.pkg.ZipContainerDetector.<init>(ZipContainerDetector.java:99)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/java.lang.Class.newInstance(Class.java:584)
at org.apache.tika.config.ServiceLoader.loadStaticServiceProviders(ServiceLoader.java:358)
at org.apache.tika.detect.DefaultDetector.getDefaultDetectors(DefaultDetector.java:56)
at org.apache.tika.detect.DefaultDetector.<init>(DefaultDetector.java:68)
at org.apache.tika.detect.DefaultDetector.<init>(DefaultDetector.java:73)
at org.apache.tika.detect.DefaultDetector.<init>(DefaultDetector.java:77)
at org.apache.tika.detect.DefaultDetector.<init>(DefaultDetector.java:81)
at org.apache.tika.parser.internal.Activator.start(Activator.java:40)
at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:698)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2402)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
at java.base/java.lang.Thread.run(Thread.java:829)
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

Magicr
Level 6
November 24, 2023

In SP17 either

TarunKumar
Community Advisor
Community Advisor
November 24, 2023

Hi @charlie_yc ,

The error you are getting because you have the log4j-api-2.x jar file in your classpath but you still need to add the log4j-core-2.x jar to the classpath. Add this dependency in both master pom and core pom.
Also, try updaing the version of Log4j 2. 

Thanks
Tarun

Level 2
November 24, 2023

Hi TarunKumar,

 

Thanks for your reply, but I didn't find any log4j-api-2.x dependency in my source code.

Do you think it's possible that the AEM service package bundle is causing this problem? This issue didn't show up before I updated my AEM to 6.5.18, and my last AEM version was 6.5.13

Jagadeesh_Prakash
Community Advisor
Community Advisor
November 27, 2023

@charlie_yc  Can you specify the AEM version and SP details? 

 

Check the compatibility of your AEM version with the Log4j version you are using. Different versions of AEM may have specific dependencies and requirements.

 

https://helpx.adobe.com/in/experience-manager/kb/aem-forms-vulnerability-cve-2021-44228.html#:~:text=AEM%206.5.,1).

 

Is any functionality breaking because of this ?

 

kautuk_sahni
Community Manager
Community Manager
December 4, 2023

@charlie_yc Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni