When trying to load the application context I get the following error:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 11 in XML document from class path resource [applicationContext-persistence.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
Below is the beans declaration. Oddly, the error is always on line 11, regardless of which namespace-location pair is on the line. I'm using 3.0.2.RELEASE and maven to manage the dependencies; I've checked that the jars are in maven's local repository. Anyone know how to resolve this?
Again, that all looks very clean. Great job on that configuration file, very easy to read.
OK, I once had an issue, not sure if it was the same as your, where I used STS/Eclipse IDE with Spring plugins and used the check boxes when creating the Spring Configuration file, and also using the Namespace tab at the bottom of the xml document in the IDE, and added or removed namespaces.
I saw that the IDE wouldn't have each value in xsi:schemaLocation on a separate line (I like it on separate lines like you have) they would have it scroll more to the right. And when I added carriage returns, then went back to add or remove a namespace that it wouldn't work.
If you are using Eclipse or STS Eclipse, try removing all the namespaces manually, then click on the namespace tab at the bottom and re-add them, keeping them in the long single line that it creates and see if you still get the error.
Joined: Mar 18, 2009
Mark Spritzler wrote:Again, that all looks very clean...
I found the error, it's on line 7 of the above posted app context, xmlns:xsi="htp://www.w3.org/2001/XMLSchema-instance"
However, once I fixed that I received the error message:
Surprisingly, the issue was that I hadn't retrieved hibernate's implementations of JPA 2.0. I was under the impression that spring-orm contained the hibernate implementation jars of JPA 2.0. Can you recommend any documents and/or other resources that I can use to clarify what is needed in order to implement JPA 2.0 via Hibernate? Thanks.