AnselmEcho (2) [Avatar] Offline
#1
I am getting an error when attempting to load the code in the very first chapter. The error is below. Anything obvious I am missing? I can post code if that would help:

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountDao' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1008Esmiliepos 0): Field or property 'classLoader' cannot be found on object of type 'org.springframework.beans.factory.config.BeanExpressionContext'
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:77smilie
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:72smilie
MikB (202) [Avatar] Offline
#2
Re: classLoader error
I can't tell without code, but something could be missing in the setup of Spring. Those kind of errors typically come when Spring lacks something. I've had several of similar errors when it was quite hard to pinpoint the actual error in some validation code or something seemingly unrelated to the error message.

Do it step by step and use the wizards in STS if you're using that to get started with a known good projects. And write tests with Spring-test. Mockito and others.
AnselmEcho (2) [Avatar] Offline
#3
Re: classLoader error
I may have missed it in the book but is there a recommended template to use when beginning working with the code? I am a little familiar with Spring MVC projects so I have been using that template (with some modifications) but I'm sure there is something better for chapter 1.
MikB (202) [Avatar] Offline
#4
Re: classLoader error
Well, I've tried to stick to the source code and setup as described at http://springinpractice.com/book/#code-and-setup. I also use the ideas in practice in my own projects, so I get to know them.

I attempt to always research testing libraries so I can pinpoint any errors, also for the book code as this is the best way IMHO to get to know the code. Of course some stuff is trivial and I try not to get stuck anywhere.