Hi All,
Thanks for helping me , well I need help to resolve this exception which I'm getting.
application.xml file is given below. I have written a class which ahs a mani method and method is also given below.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<bean id="logFactory"
class="com.ibm.ruc.utilities.logging.LogFactory"
factory-method="getInstance"/>
<bean id="exceptionResourceBundle" class="com.ibm.ruc.coreit.utilities.ResourceBundleAdapter">
<constructor-arg>
<value>exception.properties</value>
</constructor-arg>
</bean>
<bean id="exceptionHandler" class="com.ibm.ruc.utilities.exception.ExceptionHandler" factory-method="getInstance">
<property name="resourceBundle" ref="exceptionResourceBundle"/>
</bean>
<!-- CACHE specification -->
<bean id="systemPropertiesCAO"
class="com.ibm.ruc.utilities.cache.cao.PropertyCAO">
<property name="propertiesFile" value="system"/>
</bean>
<bean id="systemPropertiesCache"
class="com.ibm.ruc.utilities.cache.ConfigurationCache">
<constructor-arg ref="systemPropertiesCAO"/>
<property name="name" value="systemPropertiesCache"/>
<property name="logFactory" ref="logFactory"/>
</bean>
<bean id="errorPropertiesCAO"
class="com.ibm.ruc.utilities.cache.cao.PropertyCAO">
<property name="propertiesFile" value="exception"/>
</bean>
<bean id="errorPropertiesCache"
class="com.ibm.ruc.utilities.cache.ConfigurationCache">
<constructor-arg ref="errorPropertiesCAO"/>
<property name="name" value="errorPropertiesCache"/>
<property name="logFactory" ref="logFactory"/>
</bean>
<!-- Configuration Manager Specification -->
<bean id="configurationManager"
class="com.ibm.ruc.utilities.cache.ConfigurationManager"
factory-method="getInstance">
<property name="caches">
<map>
<entry key="systemPropertiesCache"
value-ref="systemPropertiesCache"/>
<entry key="errorPropertiesCache"
value-ref="errorPropertiesCache"/>
</map>
</property>
</bean>
<bean id="fileFactory" class="com.ibm.ruc.coreit.utilities.file.SimpleFileFactory"/>
<bean id="ObjectTranslator" class="uk.gov.tfl.lruc.batch.vehicle.oxm.ManualObjectTranslator">
<property name="logFactory" ref="logFactory"/>
<property name="exceptionHandler" ref="exceptionHandler"/>
<property name="configurationManager" ref="configurationManager"/>
<property name="loggerName" value="BatchVehicleExport"/>
</bean>
<bean id="Application" class="uk.gov.tfl.lruc.batch.vehicle.CoreBatchVehicleListApp">
<property name="logFactory" ref="logFactory"/>
<property name="exceptionHandler" ref="exceptionHandler"/>
<property name="configurationManager" ref="configurationManager"/>
<property name="loggerName" value="BatchVehicleExport"/>
<property name="fileFactory" ref="fileFactory"/>
<property name="objectTranslator" ref="ObjectTranslator"/>
</bean>
</beans>
-----------------------------------
public static void main(String[] pArgs)
{
try
{
ApplicationContext ctx = new ClassPathXmlApplicationContext(SPRING_CONTEXT_FILE);
CoreBatchVehicleListApp app = (CoreBatchVehicleListApp) ctx.getBean(APPLICATION_BEAN_NAME);
// get the key framework instances if any of these are missing we will get a runtime exception
app.getLogger();
app.getExceptionHandler();
app.getRequiredCache(SYSTEM_PROPERTIES_CACHE_NAME);
app.getRequiredCache(ERROR_PROPERTIES_CACHE_NAME);
if (null == app.mFileFactory)
{
throw new IllegalStateException("Please supply an appropriate FileFactoryInterface implementation");
}
if (null == app.mObjectTranslator)
{
throw new IllegalStateException("Please supply an appropriate OXMHandlerFactoryInterface implementation");
}
// Everything checks out if we get here - start processing
app.run();
}
catch (Exception e)
{
// Something has stopped processing. Exit with an abnormal termination code - we can't be sure that everything
// is in place so terminate with minimal support i.e we can't use the logger or exception handler
e.printStackTrace();
System.exit(ABNORMAL_TERMINATION_IN_INITIALISATION);
}
}