|
|
autowiring xml file not found
OK, still working through the tutorial and am stuck again.
In EmployeeServiceIntegrationTest I have the following lines:
protected String[] getConfigLocations() { return new String[] { quot;classpath:/springtest/dwspring-service.xmlquot; }; }
Then I have created the XML file and stored it in my springtest directory. I double-checked where it's stored through my ecplipse properties on that file. When I run the test, I get FileNotFoundException on springtest/dwspring-service.xml. I'm not sure where to go from here.
Thanks.
Stupid, obvious question: is the springtest directory on your classpath? If you are using Eclipse the easiest way to make sure it is is to put it in the source folder that contains your test classes (e.g. src/test/java).
OK, you tell me. Here is the location of my test:
/home/thom/workspace/springtest/springtest/EmployeeServiceIntegrationTest.java
And here is the location of the xml file:
/home/thom/workspace/springtest/springtest/dwspring2_service.xml
And then here's the call again, cause I might have changed it:
protected String[] getConfigLocations() { return new String[] { quot;classpath:/springtest/dwspring2-service.xmlquot; }; }
I'm still not real sure on how Eclipse handles directories. It's always a little confusing for me, but my knee jerk response says I should not have a problem. Your opinion is welcome, since I'm stuck!
Also, I'm choosing to interpret the word stupid in your response as a description of question and not as addressing me. Just kidding. I'm frequently stupid, but try not to let people know by having them call me that.
It was the question (mine) that was stupid. Sorry if it seemed I implied otherwise.
Is there a typo in your last post (dwspring2_service.xml != dwspring2-service.xml)? If not then that might be your problem.
What package is your EmployeeServiceIntegrationTest defined in? If it is in the package springtest that suggests that one of your source directories in Eclipse is lt;workspacegt;/springtest. If that is so, then you should be good to go.
Good God! You see why I hate programming by myself. No one to stand over your shoulder and say quot;look at that stupid mistake you made there.quot;
Thanks, Dave. We all need lessons in the blatantly obvious sometimes. Fixing the underscore fixed my problem. |
|