Troubleshooting
Problem
Attempts to run custom Java OMS Service classes that implement YIFCustomApi through an IDE leads to the error - log4j:WARN No appenders could be found for logger (com.yantra.ycp.core. YCPErrorDescriberImpl).
Symptom
Below is the complete error stack:
log4j:WARN No appenders could be found for logger (com.yantra.ycp.core.
YCPErrorDescriberImpl).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig
for more info.
Sterling Platform failed to initialize !
null
<?xml version="1.0" encoding="UTF-8"?>
<Errors>
<Error ErrorCode="YFC0005"
ErrorDescription="Error_description_not_available"
ErrorRelatedMoreInfo="Cannot initialize Log4j, please check that your
log4j.configuration property is correct.">
<Attribute Name="ErrorCode" Value="YFC0005"/>
<Attribute Name="ErrorDescription" Value="
Error_description_not_available"/>
<Attribute Name="ErrorRelatedMoreInfo" Value="Cannot initialize
Log4j, please check that your log4j.configuration property is correct."
/>
<Stack>com.yantra.yfc.util.YFCException
at com.yantra.yfc.log.YFCLogManager.configureLogging(YFCLogManager.
java:333)
at com.yantra.yfc.log.YFCLogManager.configureLogging(YFCLogManager.
java:266)
at com.yantra.yfs.core.YFSSystem.setLoggerProperties(YFSSystem.java:
177)
at com.yantra.yfs.core.YFSSystem.init(YFSSystem.java:104)
at com.yantra.yfs.core.YFSSystem.<clinit>(YFSSystem.java:80)
at com.yantra.yfs.japi.util.YFSInitializer.initializeQtyDisplay
(YFSInitializer.java:191)
at com.yantra.yfs.japi.util.YFSInitializer.initialize(YFSInitializer.
java:90)
at com.yantra.interop.client.YIFClientFactoryImpl.
doCommonInitializations(YIFClientFactoryImpl.java:87)
at com.yantra.interop.client.YIFClientFactoryImpl.getApi
(YIFClientFactoryImpl.java:296)
at com.yantra.interop.client.YIFClientFactoryImpl.getAutoApiClient
(YIFClientFactoryImpl.java:342)
at com.yantra.interop.client.YIFClientFactoryImpl.getApi
(YIFClientFactoryImpl.java:317)
at com.yantra.interop.client.YIFClientFactoryImpl.getApi
(YIFClientFactoryImpl.java:242)
at com.yantra.interop.client.YIFClientFactoryImpl.getApi
(YIFClientFactoryImpl.java:237)
Cause
- log4j cannot find or read the correct properties.
- The EAR file was built without having issued deployer -t resourcejar before, so that the log4jconfig.custom.xml was not included.
Resolving The Problem
Ensure that log4jconfig.xml file was customized and included in the EAR file or not. If it was, there should be a file called log4jconfig.custom.xml in your <INSTALL_DIR>/resources folder. The customer_overrides.properties file should point to it as follows:
yfs.log4j.configuration=/resources/log4jconfig.custom.xml
You may create a log4jconfig.custom.xml file outside the EAR as follows(and retry the migration scenario):
- Create a new file in your CLASSPATH,
For example /folder/log4jconfig.custom.xml.
- Modify customer_overrides.properties used by your application server to add yfs.log4j.configuration=/folder/log4jconfig.custom.xml.
Note that the "/" in front of the parameter is required.
- Restart your application server.
NOTE: Ensure the path to 'log4jconfig.custom.xml' is in the classpath.
For example:
if /cust/software/Sterling_Properties/MC_Properties/externalizingProps is in the classpath, the entry in customer_overrides.properties needs to be:
yfs.log4j.configuration=/properties/log4jconfig.custom.xml
NOTE: The permissions of the file and folder the process is writing the logs to are correct.
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg22001036