View Full Version : Attribute "abstract" must be declared for element
assaf
Oct 20th, 2004, 08:41 AM
Using Spring IDE Beans Configuration Support 1.0.3 and Spring 1.1.1.
I have the following bean definition:
<bean id="daoParent" abstract="true">
<property name="sessionFactory"><ref local="sessionFactory"/></property>
</bean>
Spring Beans consistently tells me:
Attribute "abstract" must be declared for element type "bean".
The actual ApplicationContext loads up fine.
Any idea what Spring Beans is expecting here?
Best regards,
Assaf
Andreas Senft
Oct 20th, 2004, 08:55 AM
The notion of abstract beans is a quite recent addition in Spring (version 1.1 I think).
I would guess the spring-jar within Spring-Ide is older (as is the included DTD). So the validation seems to fail. The code however should work.
Hoping for an update :wink:
Andreas
Torsten Juergeleit
Oct 20th, 2004, 11:24 AM
The update of Spring IDE (which supports abstract beans too) is nearly finished. What we need is more testing.
If you like to be bleeding edge you can give it a try. The update site (usable with Eclipse's update manager or as a local updatesite) is available here:
http://springide-eclip.sourceforge.net/updatesite/
But be aware it's a unreleased development version. For questions, bug reports, comments regarding this version please use the corresponding developer mailing list:
http://lists.sourceforge.net/lists/listinfo/springide-eclip-developer
No support will be available for this development version on the official forum.
Cheers,
Torsten
garpinc2
Nov 4th, 2004, 08:26 AM
I tried but XML buddy editor still says abstract is invalid. Shows up find in the Spring Beans view however.
dadams
Nov 4th, 2004, 11:55 AM
Is the your XML doctype declaration pointing to an older DTD version that does not support abstract beans? I am guessing that XML buddy is validating against the doctype DTD whereas Spring IDE is validating against the version in its internal copy of spring-core.jar.
Derek Adams
http://www.gaijin-studio.org
(BTW, the 1.1.0 version of Spring IDE rocks! Great work! :D )
arsenjew
Nov 8th, 2004, 07:32 AM
There are two reasons I can imagine for the persisting validation error:
a) XMLBuddy keeps some sort of cache for DTDs it uses when offline. You will find it in your default Eclipse workspace directory under ../.metadata/.plugins/.com.objfac.xmleditor/.cache. If one of the Files in this directory contains the old spring-beans.dtd, then XMLBuddy stubbornly validates your document against this DTD.
b) If the validation error is indicated by Spring-IDE, then it should disappear if you remove the document in question from the list of Spring bean configurations and revalidate the XML.
Torsten Juergeleit
Nov 8th, 2004, 04:56 PM
If the problem marker was created by XmlBuddy then you can delete it by using XmlBuddy's menu entry "XML / Clear Validate".
Cheers,
Torsten
assaf
Nov 12th, 2004, 07:38 AM
a) XMLBuddy keeps some sort of cache for DTDs it uses when offline. You will find it in your default Eclipse workspace directory under ../.metadata/.plugins/.com.objfac.xmleditor/.cache. If one of the Files in this directory contains the old spring-beans.dtd, then XMLBuddy stubbornly validates your document against this DTD.
The file is encoded as a f + a number. You can find the DTD to filename mapping in meta.xml.
Simply deleting the fn file doesn't work, and I didn't dare modifying meta.xml by hand, against XMLBuddy's explicit instructions.
What I ended up doing was navigating to the DTD on the web, and replacing the contents of fn with the contents copied from the web, after which the XMLBuddy generated errors disappeared.
Isn't there a nicer way to do this on XMLBuddy?
Best regards,
Assaf
Andreas.Neuwirth
Feb 14th, 2005, 12:14 PM
There are two reasons I can imagine for the persisting validation error:
a) XMLBuddy keeps some sort of cache for DTDs it uses when offline. You will find it in your default Eclipse workspace directory under ../.metadata/.plugins/.com.objfac.xmleditor/.cache. If one of the Files in this directory contains the old spring-beans.dtd, then XMLBuddy stubbornly validates your document against this DTD.
b) If the validation error is indicated by Spring-IDE, then it should disappear if you remove the document in question from the list of Spring bean configurations and revalidate the XML.
I had the same problem with the "abstract" beans. After refreshing XMLBuddy's DTD cache, the problem was still there. Procedure b) showed, that it was a problem of the Spring-IDE.
I found that the JAR file ...eclipse\plugins\org.springframework.core_1.0.2\ spring-core.jar contained an old spring-beans.dtd (from version 1.0.2). I replaced that with a current version, and the error vanished...
garpinc2
Apr 7th, 2005, 04:03 PM
I've been using this since september without issue!! When is release?
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.