• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Invalid content was found starting with element 'beans:bean'

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey guys i'm unsure why i'm getting this error or how to go about fixing it

here is the code from the spring-security.xml

error

cvc-complex-type.2.4.a: Invalid content was found starting with element 'http'. One of '{"http://
www.springframework.org/schema/beans":description, "http://www.springframework.org/schema/beans":import,
"http://www.springframework.org/schema/beans":alias, "http://www.springframework.org/schema/beans":bean,
WC[##other:"http://www.springframework.org/schema/beans"], "http://www.springframework.org/schema/
beans":beans}' is expected.


spring-security.xml



pom.xml

 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I cannot see it, although our XML syntax highlighter seems to think that something is different about the xsi attribute.

Moving to the Spring forum.
 
Ranch Hand
Posts: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

i'm unsure why i'm getting this error...

cvc-complex-type.2.4.a: Invalid content was found starting with element 'http'. One of '{"http://
www.springframework.org/schema/beans":description, "http://www.springframework.org/schema/beans":import,
"http://www.springframework.org/schema/beans":alias, "http://www.springframework.org/schema/beans":bean,
WC[##other:"http://www.springframework.org/schema/beans"], "http://www.springframework.org/schema/
beans":beans}' is expected.


The reason though is absolutely clear. It means in the namespace "http://www.springframework.org/schema/beans" (as it is prefixed by beans as well as being the default namespace in your spring-security.xml), under the root beans only description, import, alias, bean or some element other than that in the same namespace are allowed. Now your xml has http, ... under it. Consequently, it is not an valid xml. You can deduce the reasoning all by looking at the xsd for the beans prefix as documented in the root as well... I won't insist this, it is too cumbersome to explain in prose.

In any case, you might be a bit careless in merging from various sources/tutorials to construct the spring-security.xml. Here are the main errors: the http etc are in fact in the http://.../security rather than in http://.../context namespace !!! Then if you want to spare prefix for the security namespace, you have to make it default rather than keeping the beans namespace as default. Third, the location of the security xsd is wrong and furthermore the version maybe as well.

Brief, thses are the corrections which probably make it work already, if not, the remaining correction should be related to finer behaviours sought after, such as this rather that etc. Whereas you may or may not want to have a lower version than 4.0 (such as 3.2, or 3.1 or 3.0.3 ... according to your need). Anything else is kind of detail.

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic