IBM Support

Resolving log4j error when attempting to run custom Java OMS service classes through IDE in OMS 9.4.

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&#xd;
at com.yantra.yfc.log.YFCLogManager.configureLogging(YFCLogManager.
java:333)&#xd;
at com.yantra.yfc.log.YFCLogManager.configureLogging(YFCLogManager.
java:266)&#xd;
at com.yantra.yfs.core.YFSSystem.setLoggerProperties(YFSSystem.java:
177)&#xd;
at com.yantra.yfs.core.YFSSystem.init(YFSSystem.java:104)&#xd;
at com.yantra.yfs.core.YFSSystem.&lt;clinit&gt;(YFSSystem.java:80)&#xd;
at com.yantra.yfs.japi.util.YFSInitializer.initializeQtyDisplay
(YFSInitializer.java:191)&#xd;
at com.yantra.yfs.japi.util.YFSInitializer.initialize(YFSInitializer.
java:90)&#xd;
at com.yantra.interop.client.YIFClientFactoryImpl.
doCommonInitializations(YIFClientFactoryImpl.java:87)&#xd;
at com.yantra.interop.client.YIFClientFactoryImpl.getApi
(YIFClientFactoryImpl.java:296)&#xd;
at com.yantra.interop.client.YIFClientFactoryImpl.getAutoApiClient
(YIFClientFactoryImpl.java:342)&#xd;
at com.yantra.interop.client.YIFClientFactoryImpl.getApi
(YIFClientFactoryImpl.java:317)&#xd;
at com.yantra.interop.client.YIFClientFactoryImpl.getApi
(YIFClientFactoryImpl.java:242)&#xd;
at com.yantra.interop.client.YIFClientFactoryImpl.getApi
(YIFClientFactoryImpl.java:237)&#xd;

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):

  1. Create a new file in your CLASSPATH,
    For example /folder/log4jconfig.custom.xml.


  2. 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.


  3. 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.

[{"Product":{"code":"SS6PEW","label":"IBM Sterling Order Management"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Distributed Order Management","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

Modified date:
16 June 2018

UID

swg22001036