lundi 2 mars 2015

cannot be opened because it does not exist

I seen this question has been asked a few times but I am still getting the same error.


I am getting the following error:



Caused by: java.io.FileNotFoundException: class path resource
[src/main/resources/Beans/beans.xml] cannot be opened because it does not
exist


`



package com.learntoprogram;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {

public static void main(String[] args) {

ApplicationContext context = new
ClassPathXmlApplicationContext("src/main/resources/Beans/beans.xml");

Logger logger = (Logger)context.getBean("logger");

logger.writeConsole("Hello There");
logger.writeFile("Hi again");

(((ClassPathXmlApplicationContext)context)).close();

}

}


I would post a picture but I am not allowed to for some reason.


I get the address from right clicking the beans.xml file and click on copy qualified Name. I delete everything before the src. What am I doing wrong?


Aucun commentaire:

Enregistrer un commentaire