1

Getting error while running spring program. My program is like below:

enter image description here

And my program to read the xml file :

public static void main(String[] args) {
        //String springConfig = "src/main/resources/config/FacebookSimulator.xml";
        //String springConfig = "/root/fbdata/FacebookSimulator.xml";
        String springConfig = "/config/FacebookSimulator.xml";


        //ApplicationContext context = new FileSystemXmlApplicationContext(springConfig);
        ApplicationContext context = new ClassPathXmlApplicationContext(springConfig);


        JobLauncher jobLauncher = (JobLauncher) context.getBean("jobLauncher");
        Job job = (Job) context.getBean("simulatorJob");   

This works perfectly in windows.But while running in linux it is showing error like below:

org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [config/FaceBookSimulator.xml]; nested exception is org.springframework.beans.FatalBeanException: Class [org.springframework.batch.core.configuration.xml.CoreNamespaceHandler] for namespace [http://www.springframework.org/schema/batch] does not implement the [org.springframework.beans.factory.xml.NamespaceHandler] interface
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:414)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)

My question is where exactly should I place facebook.xml in linux system. i made this as a jar and running in linux

Mudassar
  • 3,135
  • 17
  • 22
John
  • 99
  • 1
  • 9

0 Answers0