Hello,
I'm trying to use the jackson-populator to put some fixed values into a database. However loading the application context always fails with a FileNotFoundException:-
java.io.FileNotFoundException: Could not open ServletContext resource [/]
The application context is:-
The data.json file is in src/main/resources/data.json. It seems as if I have specified location="/", though clearly I have not. I also tried having location="classpath:data.json" location="classpath:/data.json" all produce the same results.Code:<?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:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:repository="http://www.springframework.org/schema/data/repository" xsi:schemaLocation="http://www.springframework.org/schema/data/repository http://www.springframework.org/schema/data/repository/spring-repository.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd"> <repository:jackson-populator location="classpath*:/data.json" /> </beans>
If anyone knows what I've done wrong here i would be greatful if you could point it out.
Thanks,
Graeme.


Reply With Quote