This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Spring and the fly likes Cannot find the declaration of element 'beans' Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Cannot find the declaration of element Watch "Cannot find the declaration of element New topic
Author

Cannot find the declaration of element 'beans'

Jayavardhan geepi
Ranch Hand

Joined: Jul 21, 2010
Posts: 66
I'm using Spring3.1.1 and in config file I'm using below namespace declarations.

But if I change the xsd value to 'spring-beans-2.5.xsd ' (in xsi:schemaLocation) it works fine.
But not with spring-beans-3.1.xsd.
Can someone please help? I'm using eclipse.

Thanks
Jayavardhan geepi
Ranch Hand

Joined: Jul 21, 2010
Posts: 66
Sorry. Found out the issue.
I had spring jars of version 2.5.6 on classpath and not 3.1.1.
After addding 3.1.1 jar to classpath, its resolved.
Thanks
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

That is why I never put the version number with the xsd in schemaLocation, so that there won't ever be errors. It will just take the highest version of the xsd that is in the classpath.

So I would just put

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch.xsd"

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot find the declaration of element 'beans'
 
Similar Threads
context not bount error in dispatcher-servlet.xml file : please help
Namespace Query
applicationContext.xml - Can not find definition for element 'beans'
The matching wildcard is strict, but no declaration can be found for element 'context:annotation'
Cannot find the declaration of element 'beans' -- application context invalid?